/* index_header.css - AiThai Header System CSS (Namespace: .ah-) - UPDATED with Topic Page Support */

/* ==================== CSS VARIABLES & RESET ==================== */
:root {
    /* AiThai Header Theme - Professional & Soothing */
    /* Background Colors */
    --ah-bg-primary: #1a1f2e;
    --ah-bg-secondary: #2d3748;
    --ah-bg-card: #4a5568;
    --ah-bg-hover: #5a6578;
    
    /* Text Colors */
    --ah-text-primary: #ffffff;
    --ah-text-secondary: #e2e8f0;
    --ah-text-muted: #a0aec0;
    --ah-text-subtle: #718096;
    
    /* Accent Colors - Sage Green Theme */
    --ah-accent-main: #68d391;      /* Sage green */
    --ah-accent-second: #81e6d9;    /* Mint green */
    --ah-accent-warm: #f6e05e;      /* Warm accent */
    --ah-accent-soft: #9ae6b4;     /* Soft green */
    
    /* Border Colors */
    --ah-border-primary: #4a5568;
    --ah-border-secondary: #5a6578;
}

/* 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-bg-secondary);
    padding: 12px 20px;
    border-bottom: 1px solid var(--ah-border-primary);
    border-radius: 12px;                    /* ← เพิ่มขอบมน */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ah-text-primary);
    line-height: 1.5;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* ← เพิ่มเงาเบาๆ */
}

/* Logo Styles */
.ah-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

/* เป็น */
.ah-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;      /* ← แก้ไขให้อยู่กลาง */
}

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

.ah-logo-icon {
    font-size: 28px;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: ah-pulse 2s infinite;
}

@keyframes ah-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ah-logo-text {
    font-size: 22px;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    margin: 0;
}

.ah-logo-tagline {
    font-size: 11px;
    color: var(--ah-text-muted);
    margin: 0;
    font-weight: 400;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.ah-logo-link:hover .ah-logo-tagline {
    opacity: 1;
    color: var(--ah-accent-main);
}

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

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

.ah-logo-image {
    height: 32px;
    width: auto;
    transition: all 0.3s ease;
}

.ah-logo-link h1 {
    font-size: 22px;
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    margin: 0;
    transition: all 0.3s ease;
}

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

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

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

/* ✅ NEW: Back Button for Topic Pages */
.ah-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(160, 174, 192, 0.08);
    border: 1px solid rgba(160, 174, 192, 0.15);
    color: var(--ah-text-secondary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.ah-back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(160, 174, 192, 0.1), transparent);
    transition: left 0.5s ease;
}

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

.ah-back-btn:hover {
    background: rgba(104, 211, 145, 0.12);
    border-color: rgba(104, 211, 145, 0.25);
    color: var(--ah-accent-main);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.15);
}

.ah-back-btn:active {
    transform: translateY(0);
    background: rgba(104, 211, 145, 0.15);
}

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

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

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

/* Create Post Button - Subtle & Elegant */
.ah-create-post-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(104, 211, 145, 0.08);
    border: 1px solid rgba(104, 211, 145, 0.15);
    color: var(--ah-accent-main);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.ah-create-post-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(104, 211, 145, 0.1), transparent);
    transition: left 0.5s ease;
}

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

.ah-create-post-btn:hover {
    background: rgba(104, 211, 145, 0.12);
    border-color: rgba(104, 211, 145, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.15);
}

.ah-create-post-btn:active {
    transform: translateY(0);
    background: rgba(104, 211, 145, 0.15);
}

/* Hamburger Menu - Modern & Clean */
.ah-hamburger-menu {
    width: 36px;
    height: 36px;
    background: rgba(160, 174, 192, 0.05);
    border: 1px solid rgba(160, 174, 192, 0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

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

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

.ah-hamburger-menu:hover {
    background: rgba(160, 174, 192, 0.08);
    border-color: rgba(104, 211, 145, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

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

.ah-hamburger-menu:hover span {
    background: var(--ah-accent-main);
}

.ah-hamburger-menu.ah-active {
    background: rgba(104, 211, 145, 0.1);
    border-color: var(--ah-accent-main);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.2);
}

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

.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-main);
}

/* ==================== SEARCH SECTION ==================== */
.ah-search-icon {
    color: var(--ah-text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
}

.ah-search-icon:hover {
    color: var(--ah-accent-main);
    transform: scale(1.1);
}

.ah-search-section {
    background: var(--ah-bg-secondary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--ah-border-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

.ah-search-container input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--ah-border-primary);
    border-radius: 8px;
    font-size: 14px;
    background: var(--ah-bg-card);
    color: var(--ah-text-primary);
    transition: all 0.3s ease;
}

.ah-search-container input:focus {
    outline: none;
    border-color: var(--ah-accent-main);
    box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.1);
}

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

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

.ah-search-container i:hover {
    color: var(--ah-accent-main);
}

/* ==================== GOOGLE AUTH BUTTON ==================== */
.ah-google-auth-btn {
    background: white;
    border: 1px solid #dadce0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ah-google-auth-btn:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

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

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

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

.ah-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ah-accent-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

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

.ah-auth-btn.ah-logout {
    background: none;
    border: 1px solid var(--ah-border-primary);
    color: var(--ah-text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ah-auth-btn.ah-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* ==================== MAIN MENU OVERLAY ==================== */
.ah-main-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    z-index: 9998;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

.ah-main-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(145deg, var(--ah-bg-secondary), var(--ah-bg-card));
    border-left: 1px solid rgba(104, 211, 145, 0.1);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -20px 0 60px rgba(0,0,0,0.3);
}

.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: 25px 20px;
    border-bottom: 1px solid rgba(104, 211, 145, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

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

.ah-main-menu-close {
    background: rgba(160, 174, 192, 0.08);
    border: 1px solid rgba(160, 174, 192, 0.15);
    color: var(--ah-text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.ah-main-menu-close:hover {
    color: var(--ah-text-primary);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg) scale(1.05);
}

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

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

.ah-quick-nav-section h4 {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--ah-text-primary);
    background: linear-gradient(135deg, var(--ah-accent-main), var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.ah-quick-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 10px;
    color: var(--ah-text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(74, 85, 104, 0.3);
    border: 1px solid rgba(160, 174, 192, 0.1);
    position: relative;
    overflow: hidden;
}

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

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

.ah-quick-nav-item:hover {
    background: rgba(104, 211, 145, 0.08);
    border-color: rgba(104, 211, 145, 0.25);
    color: var(--ah-text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.15);
}

.ah-quick-nav-item i {
    font-size: 18px;
    color: var(--ah-accent-main);
    transition: transform 0.3s ease;
}

.ah-quick-nav-item:hover i {
    transform: scale(1.1);
}

.ah-quick-nav-item.ah-active {
    background: rgba(104, 211, 145, 0.12);
    border-color: rgba(104, 211, 145, 0.35);
    color: var(--ah-text-primary);
    box-shadow: 0 4px 15px rgba(104, 211, 145, 0.2);
}

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

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

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

.ah-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    color: var(--ah-text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    background: rgba(74, 85, 104, 0.3);
    backdrop-filter: blur(10px);
}

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

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

.ah-menu-item:hover {
    background: rgba(104, 211, 145, 0.08);
    border-color: rgba(104, 211, 145, 0.2);
    color: var(--ah-text-primary);
    transform: translateX(6px);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.15);
}

.ah-menu-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--ah-accent-main);
    transition: transform 0.3s ease;
}

.ah-menu-item:hover i {
    transform: scale(1.1);
}

.ah-menu-item span {
    font-size: 15px;
    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(104, 211, 145, 0.15);
    padding: 25px 20px;
    text-align: center;
    background: rgba(74, 85, 104, 0.2);
}

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

.ah-menu-social a {
    color: var(--ah-text-muted);
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(160, 174, 192, 0.15);
    background: rgba(74, 85, 104, 0.3);
    backdrop-filter: blur(10px);
    text-decoration: none;
}

.ah-menu-social a:hover {
    color: var(--ah-accent-main);
    border-color: var(--ah-accent-main);
    background: rgba(104, 211, 145, 0.1);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.2);
}

.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(15, 23, 42, 0.8); 
    backdrop-filter: blur(5px);
    z-index: 10000; 
    display: none; 
    animation: ah-fadeIn 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 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 var(--ah-border-primary);
    border-radius: 12px; 
    width: 90%; 
    max-width: 400px; 
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4); 
    animation: ah-slideUp 0.3s ease;
}

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

.ah-auth-header {
    background: var(--ah-bg-card); 
    padding: 20px; 
    text-align: center;
    border-bottom: 1px solid var(--ah-border-primary); 
    position: relative;
}

.ah-auth-header h2 { 
    color: var(--ah-text-primary); 
    margin: 0; 
    font-size: 18px; 
    font-weight: 600; 
}

.ah-auth-close {
    position: absolute; 
    top: 15px; 
    right: 20px; 
    background: none; 
    border: none;
    color: var(--ah-text-muted); 
    font-size: 20px; 
    cursor: pointer; 
    transition: color 0.3s ease;
    width: 30px; 
    height: 30px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%;
}

.ah-auth-close:hover { 
    color: var(--ah-text-primary); 
    background: rgba(255,255,255,0.1); 
}

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

.ah-auth-message {
    padding: 10px 12px; 
    border-radius: 6px; 
    margin-bottom: 15px;
    font-size: 13px; 
    text-align: center;
}

.ah-auth-message.ah-success {
    background: rgba(104, 211, 145, 0.1); 
    border: 1px solid rgba(104, 211, 145, 0.3); 
    color: var(--ah-accent-main);
}

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

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

.ah-google-login-btn {
    width: 100%; 
    padding: 12px; 
    background: white; 
    color: #333;
    border: 1px solid #ddd; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 500;
    cursor: pointer; 
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center;
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 20px;
}

.ah-google-login-btn:hover {
    background: #f8f9fa; 
    border-color: #ccc; 
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ==================== MOBILE RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .ah-header {
        padding: 10px 15px;
    }
    
    .ah-logo-text {
        font-size: 20px;
    }
    
    .ah-header-right {
        gap: 12px;
    }
    
    .ah-nav-controls,
    .ah-topic-nav-controls {
        gap: 6px;
    }
    
    .ah-create-post-btn,
    .ah-back-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    .ah-hamburger-menu {
        width: 32px;
        height: 32px;
        padding: 8px;
        border-radius: 6px;
    }
    
    .ah-hamburger-menu span {
        width: 14px;
        height: 1.5px;
    }
    
    .ah-search-icon {
        font-size: 16px;
        padding: 6px;
    }
    
    .ah-google-auth-btn {
        width: 36px;
        height: 36px;
    }
    
    .ah-google-logo {
        width: 14px;
        height: 14px;
    }
    
    .ah-user-info {
        font-size: 12px;
    }
    
    .ah-user-info span {
        display: none; /* Hide name on mobile */
    }
    
    .ah-user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .ah-auth-btn.ah-logout {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    /* Mobile Menu Adjustments */
    .ah-main-menu {
        width: 100%;
        max-width: 280px;
        box-shadow: -15px 0 40px rgba(0,0,0,0.4);
    }
    
    .ah-main-menu-header {
        padding: 18px;
    }
    
    .ah-main-menu-header h3 {
        font-size: 16px;
    }
    
    .ah-main-menu-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .ah-main-menu-content {
        padding: 20px 0;
    }
    
    .ah-menu-item {
        padding: 12px 15px;
        margin: 0 8px;
        border-radius: 8px;
    }
    
    .ah-menu-item i {
        font-size: 15px;
        width: 20px;
    }
    
    .ah-menu-item span {
        font-size: 13px;
    }
    
    .ah-menu-item small {
        font-size: 10px;
    }
    
    .ah-menu-social {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .ah-menu-social a {
        width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 6px;
    }

    .ah-quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .ah-quick-nav-item {
        padding: 10px 6px;
        gap: 4px;
    }
    
    .ah-quick-nav-item i {
        font-size: 16px;
    }
    
    .ah-quick-nav-item span {
        font-size: 10px;
    }

    .ah-auth-popup {
        width: 95%;
        max-height: 90vh;
    }

    /* ✅ NEW: Mobile adjustments for back button */
    .ah-back-btn i {
        font-size: 13px;
    }
}

/* 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 {
        animation: none;
        transition: none;
    }
    
    .ah-create-post-btn:hover,
    .ah-back-btn:hover,
    .ah-hamburger-menu:hover {
        transform: none;
    }
    
    .ah-menu-item:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .ah-auth-overlay,
    .ah-auth-popup,
    .ah-main-menu-overlay,
    .ah-nav-controls,
    .ah-topic-nav-controls {
        display: none !important;
    }
}
/* แก้ไข ah-back-btn ให้เหมาะสมกับ icon เท่านั้น */
.ah-back-btn {
    width: 40px;                    /* เพิ่มขนาดให้ใหญ่ขึ้นนิดหน่อย */
    height: 40px;
    border-radius: 8px;
    background: rgba(160, 174, 192, 0.08);
    border: 1px solid rgba(160, 174, 192, 0.15);
    color: var(--ah-text-secondary);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;                /* เพิ่มขนาด icon ให้ใหญ่ขึ้น */
    position: relative;
    overflow: hidden;
}

.ah-back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(160, 174, 192, 0.1), transparent);
    transition: left 0.5s ease;
}

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

.ah-back-btn:hover {
    background: rgba(104, 211, 145, 0.12);
    border-color: rgba(104, 211, 145, 0.25);
    color: var(--ah-accent-main);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(104, 211, 145, 0.15);
}

.ah-back-btn:active {
    transform: translateY(0);
    background: rgba(104, 211, 145, 0.15);
}

.ah-back-btn i {
    font-size: 16px;                /* ขนาด icon ที่เหมาะสม */
    transition: transform 0.3s ease;
}

.ah-back-btn:hover i {
    transform: translateX(-3px);    /* เพิ่มการเคลื่อนไหวให้เห็นชัดขึ้น */
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ah-back-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .ah-back-btn i {
        font-size: 14px;
    }
    
    /* เอาส่วนที่ซ่อน span ออกเพราะไม่มี span แล้ว */
}
/* ==================== DUAL NAV: ข่าว + PROMPT ==================== */

/* Header — ให้ wrap ไม่ได้ และ compact */
.ah-header {
    padding: 8px 12px;
    flex-wrap: nowrap;
    min-height: 0;
}

.ah-dual-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-shrink: 0;
}

/* ฝั่ง เอไอไทย */
.ah-nav-news {
    padding-right: 10px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ah-nav-news .ah-logo-container {
    align-items: center;
}

.ah-nav-news .ah-logo-main {
    gap: 6px;
    margin-bottom: 1px;
}

.ah-nav-news .ah-logo-icon {
    font-size: 24px;
}

.ah-nav-news .ah-logo-text {
    font-size: 20px;
}

.ah-nav-news .ah-logo-tagline {
    font-size: 10.5px;
    text-align: center;
}

.ah-nav-news:hover .ah-logo-tagline {
    opacity: 1;
    color: var(--ah-accent-main);
}

/* เส้นแบ่งกลาง */
.ah-nav-divider {
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(104, 211, 145, 0.25) 30%,
        rgba(104, 211, 145, 0.25) 70%,
        transparent
    );
    margin: 4px 0;
    align-self: stretch;
    flex-shrink: 0;
}

/* ปุ่ม Prompt */
.ah-nav-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-left: 10px;
    padding: 7px 13px;
    border-radius: 9px;
    background: rgba(104, 211, 145, 0.07);
    border: 1px solid rgba(104, 211, 145, 0.2);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 52px;
    min-width: 74px;
    flex-shrink: 0;
}

.ah-nav-prompt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(246, 224, 94, 0.06), rgba(104, 211, 145, 0.06));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 9px;
}

.ah-nav-prompt:hover::before { opacity: 1; }

.ah-nav-prompt:hover {
    background: rgba(104, 211, 145, 0.12);
    border-color: rgba(104, 211, 145, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(104, 211, 145, 0.18);
}

.ah-nav-prompt:active { transform: translateY(0); }

.ah-nav-prompt-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    position: relative;
    z-index: 1;
}

.ah-nav-prompt-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ah-prompt-icon {
    font-size: 16px;
    background: linear-gradient(135deg, var(--ah-accent-warm), var(--ah-accent-main));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
}

.ah-nav-prompt:hover .ah-prompt-icon {
    transform: rotate(-8deg) scale(1.15);
}

.ah-prompt-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ah-accent-warm), var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    letter-spacing: 0.3px;
}

.ah-prompt-sub {
    font-size: 9.5px;
    color: var(--ah-text-muted);
    opacity: 0.75;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.ah-nav-prompt:hover .ah-prompt-sub {
    opacity: 1;
    color: var(--ah-accent-main);
}

/* ==================== MOBILE — เหมือน Desktop ==================== */
@media (max-width: 768px) {
    /* Header compact */
    .ah-header {
        padding: 7px 10px;
        border-radius: 8px;
    }

    /* header-right ให้ชิดกัน */
    .ah-header-right {
        gap: 8px;
        flex-shrink: 0;
    }

    /* เอไอไทย — เล็กลงอีกนิด แต่ยังมีทั้ง icon + text + tagline */
    .ah-nav-news .ah-logo-icon { font-size: 20px; }
    .ah-nav-news .ah-logo-text { font-size: 17px; }
    .ah-nav-news .ah-logo-tagline { font-size: 9px; }
    .ah-nav-news { padding-right: 8px; }
    .ah-nav-news .ah-logo-main { gap: 5px; }

    /* Prompt button — เล็กลงพอดีมือถือ */
    .ah-nav-prompt {
        margin-left: 8px;
        padding: 6px 10px;
        min-height: 46px;
        min-width: 64px;
        border-radius: 8px;
    }

    .ah-prompt-text { font-size: 15px; }
    .ah-prompt-icon { font-size: 13px; }
    .ah-prompt-sub { font-size: 8.5px; }
    .ah-nav-prompt-top { gap: 5px; }

    /* hamburger เล็กลง */
    .ah-hamburger-menu {
        width: 32px;
        height: 32px;
        padding: 8px;
        border-radius: 6px;
    }

    .ah-hamburger-menu span {
        width: 14px;
        height: 1.5px;
    }

    /* Google auth */
    .ah-google-auth-btn {
        width: 32px;
        height: 32px;
    }

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

    /* user info ซ่อนชื่อ แสดงแค่ avatar */
    .ah-user-info span { display: none; }
    .ah-user-avatar {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
}
/* ==================== VIP BUTTON ENHANCEMENTS ==================== */

/* VIP dot — กระพริบดึงดูดสายตา */
.ah-vip-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ah-accent-warm);
    box-shadow: 0 0 0 0 rgba(246, 224, 94, 0.6);
    animation: ah-vip-ping 1.8s infinite;
    z-index: 2;
}

@keyframes ah-vip-ping {
    0%   { box-shadow: 0 0 0 0 rgba(246, 224, 94, 0.7); }
    60%  { box-shadow: 0 0 0 6px rgba(246, 224, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(246, 224, 94, 0); }
}

/* Crown icon — ใช้ gold gradient เหมือนเดิมแต่เน้นขึ้น */
.ah-nav-vip .ah-prompt-icon {
    font-size: 15px;
    background: linear-gradient(135deg, #f6e05e, #f6ad55);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* VIP text — gradient gold เด่นขึ้น */
.ah-nav-vip .ah-prompt-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #f6e05e, #f6ad55, var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sub text hover */
.ah-nav-vip:hover .ah-prompt-sub {
    opacity: 1;
    color: var(--ah-accent-warm);
}

/* Mobile */
@media (max-width: 768px) {
    .ah-nav-vip .ah-prompt-text { font-size: 15px; letter-spacing: 1px; }
    .ah-nav-vip .ah-prompt-icon { font-size: 12px; }
    .ah-vip-dot { top: 5px; right: 5px; width: 6px; height: 6px; }
}

/* ==================== 5+ BADGE ==================== */
.ah-vip-badge {
    font-size: 10px;
    font-weight: 800;
    color: var(--ah-bg-primary);
    background: linear-gradient(135deg, #f6e05e, #f6ad55);
    padding: 1px 5px;
    border-radius: 20px;
    line-height: 1.4;
    letter-spacing: 0;
    margin-left: 2px;
    flex-shrink: 0;
}

/* ห้องพิเศษ text — เล็กลงนิดให้พอดีปุ่ม */
.ah-nav-vip .ah-prompt-text {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #f6e05e, #f6ad55, var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .ah-nav-vip .ah-prompt-text { font-size: 12px; }
    .ah-vip-badge { font-size: 9px; padding: 1px 4px; }
}

/* ==================== VIP ROBOT OVERRIDE ==================== */
/* Robot icon — gold gradient เหมือน VIP */
.ah-nav-vip .ah-prompt-icon {
    font-size: 17px;
    background: linear-gradient(135deg, #f6e05e, #f6ad55);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.3s ease;
}

.ah-nav-vip:hover .ah-prompt-icon {
    transform: scale(1.2) rotate(-5deg);
}

/* VIP text — กลับมาใหญ่และหนัก */
.ah-nav-vip .ah-prompt-text {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f6e05e, #f6ad55, var(--ah-accent-second));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .ah-nav-vip .ah-prompt-icon { font-size: 14px; }
    .ah-nav-vip .ah-prompt-text { font-size: 15px; letter-spacing: 1.5px; }
}