/* index_header.css - AiThai Header System CSS (Namespace: .ah-) - Dark Red Theme with Sticky Navigation */

/* ==================== CSS VARIABLES & RESET ==================== */
:root {
    /* AiThai Header Theme - Dark Red, White, Black */
    /* Background Colors */
    --ah-bg-primary: #0f0f0f;          /* Pure black */
    --ah-bg-secondary: #1a1a1a;        /* Dark charcoal */
    --ah-bg-card: #2a1a1a;             /* Dark with red tint */
    --ah-bg-hover: #3a2222;            /* Darker red tint */
    
    /* Text Colors */
    --ah-text-primary: #ffffff;
    --ah-text-secondary: #f5f5f5;
    --ah-text-muted: #cccccc;
    --ah-text-subtle: #999999;
    
    /* Accent Colors - Dark Red Theme */
    --ah-accent-main: #8b2635;         /* Dark blood red */
    --ah-accent-second: #a0324d;       /* Medium dark red */
    --ah-accent-warm: #c53030;         /* Bright red accent */
    --ah-accent-soft: #744049;        /* Muted red */
    --ah-accent-light: #f56565;        /* Light red for hover */
    
    /* Border Colors */
    --ah-border-primary: #333333;
    --ah-border-secondary: #404040;
    
    /* Glass Effect */
    --ah-glass-bg: rgba(26, 26, 26, 0.85);
    --ah-glass-border: rgba(139, 38, 53, 0.2);
}

/* Reset only for AH components */
.ah-header,
.ah-header *,
.ah-search-section,
.ah-search-section *,
.ah-main-menu-overlay,
.ah-main-menu-overlay *,
.ah-auth-overlay,
.ah-auth-overlay * {
    box-sizing: border-box;
}

/* ==================== HEADER & LOGO STYLES ==================== */
.ah-header {
    background: var(--ah-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 20px;
    border: 1px solid var(--ah-glass-border);
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', sans-serif;
    color: var(--ah-text-primary);
    line-height: 1.5;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.4),
        0 2px 12px rgba(139, 38, 53, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 0 0 8px 0;
    transform: translateZ(0);
}

/* Enhanced Sticky Effect */
.ah-header.ah-scrolled {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-color: rgba(139, 38, 53, 0.35);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.6),
        0 4px 24px rgba(139, 38, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px) translateZ(0);
}

/* Logo Styles */
.ah-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
}

.ah-logo-link:hover {
    transform: scale(1.03) translateZ(0);
}

.ah-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ah-logo-main {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.ah-logo-icon {
    font-size: 32px;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: ah-pulse 3s infinite ease-in-out;
    filter: drop-shadow(0 0 8px rgba(139, 38, 53, 0.3));
}

@keyframes ah-pulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(139, 38, 53, 0.3));
    }
    50% { 
        transform: scale(1.08);
        filter: drop-shadow(0 0 12px rgba(139, 38, 53, 0.5));
    }
}

.ah-logo-text {
    font-size: 26px;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    filter: drop-shadow(0 0 8px rgba(139, 38, 53, 0.2));
}

.ah-logo-tagline {
    font-size: 12px;
    color: var(--ah-text-muted);
    margin: 0;
    font-weight: 400;
    opacity: 0.85;
    transition: all 0.4s ease;
    letter-spacing: 0.01em;
}

.ah-logo-link:hover .ah-logo-tagline {
    opacity: 1;
    color: var(--ah-accent-light);
    transform: translateY(-1px);
}

.ah-logo-link:hover .ah-logo-icon {
    animation: ah-bounce 0.8s ease;
}

@keyframes ah-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
    60% { transform: translateY(-2px); }
}

.ah-logo-image {
    height: 36px;
    width: auto;
    transition: all 0.4s ease;
    border-radius: 8px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.ah-logo-link h1 {
    font-size: 26px;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin: 0;
    transition: all 0.4s ease;
    letter-spacing: -0.02em;
}

.ah-logo-link:hover h1 {
    transform: scale(1.05);
}

/* ==================== HEADER RIGHT CONTROLS ==================== */
.ah-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Topic Page Navigation Controls */
.ah-topic-nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Back Button for Topic Pages */
.ah-back-btn {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(139, 38, 53, 0.2);
    color: var(--ah-text-secondary);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ah-back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 38, 53, 0.15), transparent);
    transition: left 0.6s ease;
}

.ah-back-btn:hover::before {
    left: 100%;
}

.ah-back-btn:hover {
    background: rgba(139, 38, 53, 0.15);
    border-color: rgba(139, 38, 53, 0.4);
    color: var(--ah-accent-light);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 32px rgba(139, 38, 53, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ah-back-btn:active {
    transform: translateY(0) scale(1.02);
    background: rgba(139, 38, 53, 0.2);
}

.ah-back-btn i {
    font-size: 18px;
    transition: transform 0.4s ease;
}

.ah-back-btn:hover i {
    transform: translateX(-3px);
}

/* Navigation Controls */
.ah-nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Create Post Button - Enhanced Dark Red Theme */
.ah-create-post-btn {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(139, 38, 53, 0.1);
    border: 1px solid rgba(139, 38, 53, 0.25);
    color: var(--ah-accent-light);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 16px rgba(139, 38, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ah-create-post-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 38, 53, 0.2), transparent);
    transition: left 0.6s ease;
}

.ah-create-post-btn:hover::before {
    left: 100%;
}

.ah-create-post-btn:hover {
    background: rgba(139, 38, 53, 0.2);
    border-color: rgba(139, 38, 53, 0.4);
    color: var(--ah-text-primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 32px rgba(139, 38, 53, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ah-create-post-btn:active {
    transform: translateY(0) scale(1.02);
    background: rgba(139, 38, 53, 0.25);
}

/* Hamburger Menu - Enhanced */
.ah-hamburger-menu {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 12px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ah-hamburger-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
}

.ah-hamburger-menu:hover::before {
    left: 100%;
}

.ah-hamburger-menu:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 38, 53, 0.3);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(139, 38, 53, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.ah-hamburger-menu span {
    width: 18px;
    height: 2px;
    background: var(--ah-text-secondary);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ah-hamburger-menu:hover span {
    background: var(--ah-accent-light);
    box-shadow: 0 0 8px rgba(139, 38, 53, 0.3);
}

.ah-hamburger-menu.ah-active {
    background: rgba(139, 38, 53, 0.15);
    border-color: var(--ah-accent-main);
    box-shadow: 
        0 8px 32px rgba(139, 38, 53, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ah-hamburger-menu.ah-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--ah-accent-light);
}

.ah-hamburger-menu.ah-active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.ah-hamburger-menu.ah-active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--ah-accent-light);
}

/* ==================== SEARCH SECTION ==================== */
.ah-search-icon {
    color: var(--ah-text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-search-icon:hover {
    color: var(--ah-accent-light);
    transform: scale(1.1);
    background: rgba(139, 38, 53, 0.1);
    box-shadow: 0 4px 16px rgba(139, 38, 53, 0.2);
}

.ah-search-section {
    background: var(--ah-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 16px;
    border: 1px solid var(--ah-glass-border);
    border-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', sans-serif;
    margin: 0 8px 8px 8px;
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ah-search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.ah-search-container input {
    width: 100%;
    padding: 14px 48px 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--ah-text-primary);
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.ah-search-container input:focus {
    outline: none;
    border-color: var(--ah-accent-main);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 4px rgba(139, 38, 53, 0.15),
        inset 0 2px 8px rgba(0, 0, 0, 0.2),
        0 4px 16px rgba(139, 38, 53, 0.2);
    transform: translateY(-1px);
}

.ah-search-container input::placeholder {
    color: var(--ah-text-muted);
    opacity: 0.8;
}

.ah-search-container i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ah-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.ah-search-container i:hover {
    color: var(--ah-accent-light);
    transform: translateY(-50%) scale(1.1);
}

/* ==================== GOOGLE AUTH BUTTON ==================== */
.ah-google-auth-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-google-auth-btn:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 255, 255, 1);
}

.ah-google-logo {
    width: 18px;
    height: 18px;
}

/* Auth Section User Display */
.ah-auth-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ah-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ah-text-primary);
    font-size: 14px;
    font-weight: 500;
}

.ah-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(139, 38, 53, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ah-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ah-auth-btn.ah-logout {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--ah-text-muted);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-auth-btn.ah-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ff6b6b;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

/* ==================== MAIN MENU OVERLAY ==================== */
.ah-main-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9998;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', sans-serif;
}

.ah-main-menu-overlay.ah-show {
    opacity: 1;
}

.ah-main-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: linear-gradient(145deg, var(--ah-bg-secondary), var(--ah-bg-card));
    border-left: 1px solid rgba(139, 38, 53, 0.2);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ah-main-menu-overlay.ah-show .ah-main-menu {
    transform: translateX(0);
}

.ah-main-menu-header {
    background: linear-gradient(135deg, var(--ah-bg-card), var(--ah-bg-secondary));
    padding: 32px 24px;
    border-bottom: 1px solid rgba(139, 38, 53, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.ah-main-menu-header h3 {
    font-size: 20px;
    margin: 0;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ah-main-menu-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ah-text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-main-menu-close:hover {
    color: var(--ah-text-primary);
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.ah-main-menu-content {
    padding: 36px 0;
}

/* Quick Navigation Section */
.ah-quick-nav-section {
    margin-bottom: 24px;
    padding: 0 24px;
}

.ah-quick-nav-section h4 {
    font-size: 14px;
    margin-bottom: 18px;
    color: var(--ah-text-primary);
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ah-quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ah-quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 16px;
    color: var(--ah-text-secondary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-quick-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 38, 53, 0.1), transparent);
    transition: left 0.6s ease;
}

.ah-quick-nav-item:hover::before {
    left: 100%;
}

.ah-quick-nav-item:hover {
    background: rgba(139, 38, 53, 0.1);
    border-color: rgba(139, 38, 53, 0.3);
    color: var(--ah-text-primary);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(139, 38, 53, 0.2);
}

.ah-quick-nav-item i {
    font-size: 20px;
    color: var(--ah-accent-main);
    transition: transform 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(139, 38, 53, 0.3));
}

.ah-quick-nav-item:hover i {
    transform: scale(1.15);
    color: var(--ah-accent-light);
    filter: drop-shadow(0 4px 8px rgba(139, 38, 53, 0.5));
}

.ah-quick-nav-item.ah-active {
    background: rgba(139, 38, 53, 0.15);
    border-color: rgba(139, 38, 53, 0.4);
    color: var(--ah-text-primary);
    box-shadow: 0 8px 24px rgba(139, 38, 53, 0.3);
}

.ah-quick-nav-item.ah-active i {
    color: var(--ah-accent-light);
    transform: scale(1.1);
}

.ah-quick-nav-item span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    letter-spacing: -0.01em;
}

/* Main Navigation */
.ah-main-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 48px;
}

.ah-menu-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    border-radius: 16px;
    color: var(--ah-text-secondary);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.ah-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 38, 53, 0.15), transparent);
    transition: left 0.7s ease;
}

.ah-menu-item:hover::before {
    left: 100%;
}

.ah-menu-item:hover {
    background: rgba(139, 38, 53, 0.1);
    border-color: rgba(139, 38, 53, 0.25);
    color: var(--ah-text-primary);
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 12px 40px rgba(139, 38, 53, 0.2);
}

.ah-menu-item i {
    font-size: 20px;
    width: 28px;
    text-align: center;
    color: var(--ah-accent-main);
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(139, 38, 53, 0.3));
}

.ah-menu-item:hover i {
    transform: scale(1.15);
    color: var(--ah-accent-light);
    filter: drop-shadow(0 4px 8px rgba(139, 38, 53, 0.5));
}

.ah-menu-item span {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    letter-spacing: -0.01em;
}

.ah-menu-item small {
    font-size: 12px;
    color: var(--ah-text-muted);
    opacity: 0.8;
    font-weight: 400;
}

.ah-menu-item:hover small {
    color: var(--ah-text-secondary);
    opacity: 1;
}

.ah-menu-footer {
    border-top: 1px solid rgba(139, 38, 53, 0.2);
    padding: 32px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ah-menu-social {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
}

.ah-menu-social a {
    color: var(--ah-text-muted);
    font-size: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ah-menu-social a:hover {
    color: var(--ah-accent-light);
    border-color: var(--ah-accent-main);
    background: rgba(139, 38, 53, 0.15);
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 32px rgba(139, 38, 53, 0.3);
}

.ah-menu-footer p {
    font-size: 12px;
    color: var(--ah-text-muted);
    margin: 0;
    opacity: 0.8;
}

/* ==================== AUTH POPUP STYLES ==================== */
.ah-auth-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000; 
    display: none; 
    animation: ah-fadeIn 0.4s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Display', sans-serif;
}

.ah-auth-overlay.ah-show { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

@keyframes ah-fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

.ah-auth-popup {
    background: var(--ah-bg-secondary); 
    border: 1px solid rgba(139, 38, 53, 0.2);
    border-radius: 20px; 
    width: 90%; 
    max-width: 420px; 
    overflow: hidden;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 8px 32px rgba(139, 38, 53, 0.2); 
    animation: ah-slideUp 0.4s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes ah-slideUp { 
    from { transform: translateY(40px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}

.ah-auth-header {
    background: var(--ah-bg-card); 
    padding: 24px; 
    text-align: center;
    border-bottom: 1px solid rgba(139, 38, 53, 0.2); 
    position: relative;
}

.ah-auth-header h2 { 
    color: var(--ah-text-primary); 
    margin: 0; 
    font-size: 20px; 
    font-weight: 700; 
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-warm));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ah-auth-close {
    position: absolute; 
    top: 18px; 
    right: 24px; 
    background: rgba(255, 255, 255, 0.06); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ah-text-muted); 
    font-size: 18px; 
    cursor: pointer; 
    transition: all 0.4s ease;
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-auth-close:hover { 
    color: var(--ah-text-primary); 
    background: rgba(239, 68, 68, 0.15); 
    border-color: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg) scale(1.1);
}

.ah-auth-content { 
    padding: 32px 24px; 
    background: var(--ah-bg-secondary); 
}

.ah-auth-message {
    padding: 12px 16px; 
    border-radius: 12px; 
    margin-bottom: 20px;
    font-size: 14px; 
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ah-auth-message.ah-success {
    background: rgba(139, 38, 53, 0.15); 
    border: 1px solid rgba(139, 38, 53, 0.3); 
    color: var(--ah-accent-light);
}

.ah-auth-message.ah-error {
    background: rgba(239, 68, 68, 0.15); 
    border: 1px solid rgba(239, 68, 68, 0.3); 
    color: #ff6b6b;
}

.ah-auth-message.ah-info {
    background: rgba(59, 130, 246, 0.15); 
    border: 1px solid rgba(59, 130, 246, 0.3); 
    color: #60a5fa;
}

.ah-google-login-btn {
    width: 100%; 
    padding: 16px; 
    background: rgba(255, 255, 255, 0.95); 
    color: #333;
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 14px; 
    font-size: 15px; 
    font-weight: 600;
    cursor: pointer; 
    transition: all 0.4s ease; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    gap: 12px; 
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ah-google-login-btn:hover {
    background: rgba(255, 255, 255, 1); 
    border-color: rgba(255, 255, 255, 0.4); 
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==================== STICKY SCROLL EFFECTS ==================== */
.ah-sticky-scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--ah-accent-main), var(--ah-accent-warm));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 1001;
    border-radius: 0 0 4px 4px;
}

/* JavaScript classes for scroll effects */
.ah-header.ah-scroll-up {
    transform: translateY(0) translateZ(0);
}

.ah-header.ah-scroll-down {
    transform: translateY(-100%) translateZ(0);
}

/* ==================== MOBILE RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .ah-header {
        padding: 12px 16px;
        border-radius: 20px;
        margin: 8px;
        top: 8px;
    }
    
    .ah-logo-text {
        font-size: 22px;
    }
    
    .ah-logo-icon {
        font-size: 28px;
    }
    
    .ah-logo-tagline {
        font-size: 10px;
    }
    
    .ah-header-right {
        gap: 12px;
    }
    
    .ah-nav-controls,
    .ah-topic-nav-controls {
        gap: 8px;
    }
    
    .ah-create-post-btn,
    .ah-back-btn {
        width: 38px;
        height: 38px;
        font-size: 15px;
        border-radius: 12px;
    }
    
    .ah-hamburger-menu {
        width: 38px;
        height: 38px;
        padding: 10px;
        border-radius: 12px;
    }
    
    .ah-hamburger-menu span {
        width: 16px;
        height: 2px;
    }
    
    .ah-search-icon {
        font-size: 18px;
        padding: 8px;
        border-radius: 10px;
    }
    
    .ah-google-auth-btn {
        width: 40px;
        height: 40px;
    }
    
    .ah-google-logo {
        width: 16px;
        height: 16px;
    }
    
    .ah-user-info {
        font-size: 12px;
    }
    
    .ah-user-info span {
        display: none;
    }
    
    .ah-user-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .ah-auth-btn.ah-logout {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: 10px;
    }
    
    .ah-search-section {
        padding: 16px 16px;
        border-radius: 16px;
        margin: 8px;
    }
    
    .ah-search-container input {
        padding: 12px 40px 12px 16px;
        border-radius: 14px;
        font-size: 15px;
    }
    
    .ah-main-menu {
        width: 100%;
        max-width: 320px;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.7);
    }
    
    .ah-main-menu-header {
        padding: 24px 20px;
    }
    
    .ah-main-menu-header h3 {
        font-size: 18px;
    }
    
    .ah-main-menu-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    .ah-main-menu-content {
        padding: 24px 0;
    }
    
    .ah-quick-nav-section {
        padding: 0 20px;
    }
    
    .ah-menu-item {
        padding: 14px 16px;
        margin: 0 10px;
        border-radius: 12px;
    }
    
    .ah-menu-item i {
        font-size: 18px;
        width: 24px;
    }
    
    .ah-menu-item span {
        font-size: 14px;
    }
    
    .ah-menu-item small {
        font-size: 11px;
    }
    
    .ah-menu-social {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .ah-menu-social a {
        width: 38px;
        height: 38px;
        font-size: 16px;
        border-radius: 12px;
    }

    .ah-quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ah-quick-nav-item {
        padding: 12px 8px;
        gap: 6px;
        border-radius: 12px;
    }
    
    .ah-quick-nav-item i {
        font-size: 18px;
    }
    
    .ah-quick-nav-item span {
        font-size: 11px;
    }

    .ah-auth-popup {
        width: 95%;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .ah-auth-header {
        padding: 20px;
    }
    
    .ah-auth-content {
        padding: 24px 20px;
    }
    
    .ah-google-login-btn {
        padding: 14px;
        border-radius: 12px;
        font-size: 14px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .ah-header {
        padding: 8px 10px;
        border-radius: 0 0 14px 14px;
        margin: 0 0 4px 0;
        top: 0;
    }
    
    .ah-logo-text {
        font-size: 20px;
    }
    
    .ah-logo-icon {
        font-size: 24px;
    }
    
    .ah-header-right {
        gap: 8px;
    }
    
    .ah-create-post-btn,
    .ah-back-btn,
    .ah-hamburger-menu {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
    
    .ah-create-post-btn,
    .ah-back-btn {
        font-size: 14px;
    }
    
    .ah-main-menu {
        max-width: 280px;
    }
    
    .ah-search-section {
        padding: 8px 10px;
        margin: 0 4px 4px 4px;
        border-radius: 10px;
    }
}

/* High Performance Mode (Reduced Animations) */
@media (prefers-reduced-motion: reduce) {
    .ah-logo-icon,
    .ah-create-post-btn,
    .ah-back-btn,
    .ah-hamburger-menu,
    .ah-menu-item,
    .ah-quick-nav-item,
    .ah-header {
        animation: none;
        transition: none;
    }
    
    .ah-create-post-btn:hover,
    .ah-back-btn:hover,
    .ah-hamburger-menu:hover,
    .ah-menu-item:hover,
    .ah-header.ah-scrolled {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .ah-auth-overlay,
    .ah-auth-popup,
    .ah-main-menu-overlay,
    .ah-nav-controls,
    .ah-topic-nav-controls,
    .ah-sticky-scroll-indicator {
        display: none !important;
    }
    
    .ah-header {
        position: static;
        box-shadow: none;
        background: white;
        color: black;
        border: 1px solid #ccc;
    }
}

/* Dark theme enhancements */
@media (prefers-color-scheme: dark) {
    .ah-google-auth-btn {
        background: rgba(255, 255, 255, 0.9);
    }
    
    .ah-google-login-btn {
        background: rgba(255, 255, 255, 0.9);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ah-header {
        border-width: 2px;
    }
    
    .ah-menu-item,
    .ah-quick-nav-item,
    .ah-create-post-btn,
    .ah-back-btn {
        border-width: 2px;
    }
}

/* ==================== JAVASCRIPT INTEGRATION CLASSES ==================== */
/* Add these classes via JavaScript for enhanced interactions */

.ah-page-loaded .ah-header {
    animation: ah-slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ah-slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ah-menu-opening .ah-hamburger-menu {
    transform: rotate(180deg);
}

.ah-search-active .ah-search-section {
    transform: scale(1.02);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.4),
        0 4px 24px rgba(139, 38, 53, 0.3);
}

/* Scroll progress indicator */
.ah-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--ah-accent-main), var(--ah-accent-warm));
    transform-origin: left;
    z-index: 1002;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 2px 8px rgba(139, 38, 53, 0.3);
}

/* Enhanced glass morphism effect for modern browsers */
@supports (backdrop-filter: blur(20px)) {
    .ah-header,
    .ah-search-section,
    .ah-main-menu {
        background: var(--ah-glass-bg);
    }
}

/* Fallback for older browsers */
@supports not (backdrop-filter: blur(20px)) {
    .ah-header,
    .ah-search-section {
        background: var(--ah-bg-secondary);
    }
    
    .ah-main-menu {
        background: linear-gradient(145deg, var(--ah-bg-secondary), var(--ah-bg-card));
    }
}