/* Simple Scroll Animation - Name and Icons to Navbar */

/* Header Name Animation - appears in navbar left side */
.header-name {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.header-name.visible {
    opacity: 1;
}

/* Social icons - hide originals when in header mode */
.social-icons.header-mode {
    opacity: 0;
    pointer-events: none;
}

/* Cloned social icons in header */
.header-social-icons {
    position: absolute;
    top: 50%;
    left: 220px;
    transform: translateY(-50%);
    z-index: 1500 !important;
    display: flex;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto !important;
}

.header-social-icons.visible {
    opacity: 1;
}

.header-social-icons .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.1s ease;
    cursor: pointer !important;
    position: relative;
    z-index: 1500 !important;
    pointer-events: auto !important;
}

.header-social-icons .social-icon:hover {
    color: var(--primary-color);
}

.header-social-icons .social-icon svg {
    width: 22px;
    height: 22px;
    pointer-events: none !important;
}

/* Email icon needs to be slightly larger to match others */
.header-social-icons .social-icon:first-child svg {
    width: 28px;
    height: 28px;
    pointer-events: none !important;
}

/* Ensure all child elements don't block clicks */
.header-social-icons .social-icon * {
    pointer-events: none !important;
}

/* Ensure right-side elements stay in place */
.nav-right {
    position: relative;
    z-index: 11;
}

.nav-menu, .nav-toggle, .theme-toggle {
    position: relative;
    z-index: 11;
}

/* Prevent any movement of right-side elements */
.social-icons.header-mode ~ .nav-right,
.nav-right .nav-menu,
.nav-right .nav-toggle,
.nav-right .theme-toggle {
    transform: none !important;
    position: relative !important;
}

/* Navbar positioning - preserve existing sticky behavior */
.nav-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

/* Ensure scroll animations don't interfere with mobile menu */
.nav-menu.active {
    z-index: 1500 !important;
    position: absolute !important;
}

.nav-toggle {
    z-index: 1501 !important;
    position: relative !important;
}

/* Desktop - ensure menu button is hidden */
@media (min-width: 769px) {
    .nav-toggle {
        display: none !important;
    }
    
    .nav-menu {
        display: flex !important;
        position: static !important;
        width: auto !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 20px 0 !important;
        gap: 30px !important;
    }
}

/* Prevent header elements from blocking mobile menu */
.header-name {
    pointer-events: none;
}

.header-social-icons {
    pointer-events: auto;
}

.header-social-icons .social-icon {
    pointer-events: auto;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .header-name {
        font-size: 1.1rem;
        left: 15px;
    }
    
    .header-social-icons {
        left: 195px;
    }
    
    /* Ensure mobile menu stays above scroll animations */
    .nav-menu {
        z-index: 1600 !important;
        position: absolute !important;
        display: none;
    }
    
    .nav-menu.active {
        display: flex !important;
    }
    
    .nav-toggle {
        z-index: 1601 !important;
        position: relative !important;
    }
    
    /* Fix mobile menu positioning conflicts */
    .nav-right {
        position: relative !important;
        z-index: 1602 !important;
    }
}

@media (max-width: 480px) {
    /* Disable scroll animations for mobile phones */
    .header-name {
        display: none !important;
        opacity: 0 !important;
    }
    
    .header-social-icons {
        display: none !important;
        opacity: 0 !important;
    }
    
    /* Keep original social icons visible and in place on mobile */
    .social-icons {
        opacity: 1 !important;
        pointer-events: auto !important;
        position: relative !important;
        transform: none !important;
    }
    
    .social-icons.header-mode {
        opacity: 1 !important;
        pointer-events: auto !important;
        position: relative !important;
        transform: none !important;
    }
    
    /* Ensure mobile navigation works properly */
    .nav-toggle {
        display: flex !important;
        z-index: 2001 !important;
        position: relative !important;
    }
    
    .nav-right {
        z-index: 2002 !important;
        position: relative !important;
        order: 2 !important;
    }
    
    .nav-menu {
        z-index: 2000 !important;
        position: absolute !important;
    }
    
    .nav-container {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .header-social-icons {
        gap: 10px;
    }
    
    .header-social-icons .social-icon {
        width: 40px;
        height: 40px;
        cursor: pointer !important;
        pointer-events: auto !important;
        z-index: 1500 !important;
        position: relative !important;
    }
    
    .header-social-icons .social-icon svg {
        width: 20px;
        height: 20px;
        pointer-events: none !important;
    }
    
    .header-social-icons .social-icon:first-child svg {
        width: 24px;
        height: 24px;
        pointer-events: none !important;
    }
    
    .header-social-icons .social-icon * {
        pointer-events: none !important;
    }
}

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