/* Header Styles - Minimalist Design */

.header {
    padding: 30px 5%;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
}

[data-theme="dark"] .header {
    background: rgba(26, 26, 26, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}



.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.header-email {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    min-width: 0;
    flex: 1;
}

.header-email i {
    font-size: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.header-email a {
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: var(--transition);
}

.header-email a:hover {
    color: var(--accent-primary);
}

.header-nav {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 5px 0;
    letter-spacing: 0;
    transform: translateY(0);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--accent-primary);
    color: white !important;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px) scale(1.05);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: rotate(15deg);
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    border: none;
    padding: 5px;
}

.mobile-menu-toggle:hover {
    color: var(--accent-primary);
}

/* Mobile Navigation */
@media (max-width: 968px) {
    .header {
        padding: 20px 4%;
    }

    .header-content {
        flex-wrap: nowrap;
        position: relative;
        justify-content: space-between;
        gap: 15px;
        width: 100%;
    }

    .header-email {
        font-size: 0.9rem;
    }

    .header-email a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 230px;
        display: block;
    }

    .mobile-menu-toggle {
        display: block;
        order: 2;
    }

    .theme-toggle {
        order: 1;
        flex-shrink: 0;
    }

    .header-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--border-color);
        order: 3;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        order: 3;
    }

    .header-nav.active {
        display: flex;
    }
}

/* Mobile Portrait */
@media (max-width: 640px) {
    .header {
        padding: 15px 4%;
    }

    .header-email {
        font-size: 0.8rem;
    }

    .header-email a {
        max-width: 180px;
    }

    .header-email i {
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .header-nav {
        gap: 15px;
    }
}

/* Ensure the main content is pushed below the fixed header. We set a CSS variable
   `--header-height` from JS so the layout adapts to header size (and responsive changes). */
.main-content {
    padding-top: var(--header-height, 100px);
    transition: padding-top 0.2s ease;
}

/* Compact header when user scrolls: reduces padding and slightly increases shadow */
.header.scrolled {
    padding: 10px 5%;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.18);
    background: rgba(248, 249, 250, 0.96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: padding 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

[data-theme="dark"] .header.scrolled {
    background: rgba(26, 26, 26, 0.96);
}

/* Small tweak so focusable elements inside header don't shift layout when header changes */
.header.scrolled .nav-link {
    transform: translateY(0);
}

