/* Custom UX Improvements */

/* CVEfinder.io Featured Section */
#cvefinder {
    background: linear-gradient(135deg, #1abc9c 0%, #148f77 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

#cvefinder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h100v100H0z" fill="none"/><path d="M50 10L61 40H92L67 57L78 87L50 70L22 87L33 57L8 40H39z" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.3;
}

.bg-gradient-primary {
    position: relative;
}

.cvefinder-content {
    position: relative;
    z-index: 1;
}

.cvefinder-content h2 {
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.cvefinder-features {
    list-style: none;
    padding: 0;
    font-size: 1.1rem;
}

.cvefinder-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cvefinder-features li:last-child {
    border-bottom: none;
}

.cvefinder-features i {
    color: #FFD700;
}

.cvefinder-cta .btn {
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    transition: all 0.3s ease;
}

.cvefinder-cta .btn-light:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background-color: #FFD700 !important;
    color: #2c3e50 !important;
}

.cvefinder-cta .btn-outline-light:hover {
    background-color: white;
    color: #1abc9c !important;
    transform: translateY(-3px);
}

.cvefinder-card {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.cvefinder-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cvefinder-stats {
    display: flex;
    justify-content: space-around;
    margin: 2rem 0;
}

.cvefinder-stat-item {
    text-align: center;
}

.cvefinder-stat-number {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.cvefinder-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

.badge-success {
    background-color: #28a745 !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

/* Featured nav link */
.nav-link-featured {
    background-color: rgba(26, 188, 156, 0.2) !important;
    border: 2px solid rgba(26, 188, 156, 0.5);
    font-weight: 600;
}

.nav-link-featured:hover {
    background-color: rgba(26, 188, 156, 0.4) !important;
    border-color: #1abc9c;
}

.nav-link-featured i {
    color: #FFD700;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive adjustments for CVEfinder */
@media (max-width: 991px) {
    #cvefinder {
        padding: 3rem 0;
    }

    .cvefinder-content h2 {
        font-size: 2.5rem;
    }

    .cvefinder-card {
        margin-top: 2rem;
    }

    .cvefinder-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cvefinder-cta .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
}


/* Masthead badges */
.masthead-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.masthead-badges .badge {
    font-size: 1rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: #2c3e50 !important;
    border-radius: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.masthead-badges .badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Stats Section */
.stats-card {
    padding: 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stats-number {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.stats-label {
    font-size: 1rem;
    font-weight: 500;
}

/* Client badges */
.client-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.client-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.client-badge:hover {
    border-color: #1abc9c;
    background-color: #1abc9c;
    color: white;
    transform: scale(1.05);
}

/* CVE Cards */
.cve-card {
    background: white;
    border-left: 4px solid #1abc9c;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.cve-card:hover {
    box-shadow: 0 5px 20px rgba(26, 188, 156, 0.3);
    transform: translateX(5px);
}

.cve-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cve-card h5 {
    font-family: 'Courier New', monospace;
    font-weight: 700;
}

/* Better section backgrounds */
#stats {
    padding: 4rem 0;
}

#cve {
    padding: 4rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .masthead-badges {
        flex-direction: column;
        align-items: center;
    }

    .masthead-badges .badge {
        width: 100%;
        max-width: 300px;
    }

    .stats-number {
        font-size: 2.5rem;
    }

    .client-badge {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Mobile navigation improvements */
    .navbar-nav {
        text-align: center;
    }

    .nav-link {
        padding: 0.75rem 0 !important;
        margin: 0.25rem 0;
    }

    /* Mobile hero adjustments */
    .masthead-heading {
        font-size: 2rem !important;
    }

    .masthead-subheading {
        font-size: 1rem !important;
        padding: 0 1rem;
    }

    .masthead-avatar {
        width: 150px !important;
        height: 150px !important;
    }

    /* Mobile CVEfinder section */
    #cvefinder {
        padding: 2rem 0 !important;
    }

    .cvefinder-content h2 {
        font-size: 2rem !important;
    }

    .cvefinder-features {
        font-size: 1rem;
    }

    .cvefinder-cta .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.5rem;
    }

    /* Mobile stats section */
    .stats-card {
        padding: 1.5rem 1rem;
    }

    /* Mobile CVE cards */
    .cve-card {
        margin-bottom: 1rem;
    }

    /* Mobile project cards */
    .portfolio-item {
        margin-bottom: 1.5rem;
    }

    .project-title-overlay h5 {
        font-size: 1rem;
    }

    /* Mobile About section */
    .page-section.bg-primary .lead {
        font-size: 1rem !important;
    }

    .btn-outline-light {
        display: block;
        width: 100%;
        margin: 0.5rem 0 !important;
    }

    /* Mobile footer */
    footer .col-lg-4 {
        margin-bottom: 2rem;
    }

    footer .lead {
        font-size: 1rem !important;
    }

    /* Mobile modals */
    .modal-dialog {
        margin: 0.5rem;
    }

    .portfolio-modal-title {
        font-size: 1.5rem !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    .masthead-heading {
        font-size: 1.75rem !important;
    }

    .masthead-subheading {
        font-size: 0.9rem !important;
    }

    .stats-number {
        font-size: 2rem;
    }

    .stats-label {
        font-size: 0.9rem;
    }

    .cvefinder-content h2 {
        font-size: 1.75rem !important;
    }

    .page-section-heading {
        font-size: 1.75rem !important;
    }

    .client-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 991px) {
    .masthead-heading {
        font-size: 2.5rem !important;
    }

    .stats-number {
        font-size: 2.75rem;
    }

    .cvefinder-content h2 {
        font-size: 2.25rem;
    }

    .portfolio-item {
        margin-bottom: 2rem;
    }
}

/* Button improvements in About section */
.btn-outline-light {
    border-width: 2px;
    font-weight: 600;
}

.btn-outline-light:hover {
    background-color: white;
    color: #1abc9c !important;
}


/* Better hover effects for project cards */
.portfolio-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.portfolio-item:focus-within {
    outline: 3px solid #1abc9c;
    outline-offset: 4px;
}

/* Improve portfolio caption visibility */
.portfolio-item-caption {
    background-color: rgba(26, 188, 156, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-item-caption,
.portfolio-item:focus .portfolio-item-caption {
    opacity: 1;
}

/* Project title overlay */
.project-title-overlay {
    background-color: #2c3e50;
    color: white;
    padding: 0.75rem;
}

.project-title-overlay h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Improve navbar toggler */
.navbar-toggler {
    border: 2px solid white;
    padding: 0.5rem 0.75rem;
}

.navbar-toggler:hover,
.navbar-toggler:focus {
    background-color: #148f77 !important;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon-wrapper {
    display: inline-block;
}

/* Better navigation links */
.nav-link {
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #1abc9c;
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link:focus::after {
    width: 80%;
    left: 10%;
}

/* Active nav link */
.nav-link.active {
    background-color: rgba(26, 188, 156, 0.2) !important;
}

/* Improve modal close button */
.modal .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.2s ease;
    background-color: rgba(44, 62, 80, 0.8);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal .close:hover,
.modal .close:focus {
    opacity: 1;
    transform: rotate(90deg);
    background-color: rgba(44, 62, 80, 1);
}

.modal .close span {
    color: white;
}

/* Better button styles */
.btn {
    transition: all 0.3s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Social buttons */
.btn-social {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.25rem;
    line-height: 2rem;
    transition: all 0.3s ease;
}

.btn-social:hover,
.btn-social:focus {
    background-color: white;
    color: #2c3e50 !important;
    transform: translateY(-4px) scale(1.1);
}

/* Improve scroll-to-top button */
.scroll-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
}

.scroll-to-top a {
    width: 3.5rem;
    height: 3.5rem;
    background-color: rgba(26, 188, 156, 0.9);
    line-height: 3.5rem;
    transition: all 0.3s ease;
}

.scroll-to-top a:hover,
.scroll-to-top a:focus {
    background-color: #1abc9c;
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(26, 188, 156, 0.4);
}

/* Better link hover states */
a {
    transition: color 0.2s ease;
}

footer a {
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

footer a:hover,
footer a:focus {
    border-bottom-color: currentColor;
    text-decoration: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid #1abc9c;
    outline-offset: 3px;
}

/* Improve masthead avatar */
.masthead-avatar {
    border: 6px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.masthead-avatar:hover {
    transform: scale(1.05);
}

/* Better spacing for mobile */
@media (max-width: 768px) {
    .portfolio-item {
        margin-bottom: 2rem;
    }

    .nav-link {
        margin: 0.25rem 0;
    }

    .modal .close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
    }
}

/* Loading state for images */
img {
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Better divider visibility */
.divider-custom {
    margin: 2rem 0;
}

.divider-custom .divider-custom-icon {
    font-size: 2rem;
    color: #1abc9c;
}

/* Improve copyright section */
.copyright {
    background-color: #1a252f;
}

/* Better contrast for links in footer */
footer .lead a {
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

footer .lead a:hover {
    text-decoration-thickness: 2px;
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Improved modal backdrop */
.modal-backdrop.show {
    opacity: 0.7;
}

/* Better portfolio modal images */
.modal-body img {
    border-radius: 0.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

/* Navbar shrink animation */
.navbar {
    transition: padding 0.3s ease, background-color 0.3s ease;
}

.navbar-shrink {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
