/* ==========================================================================
   IPTV4U HELPful — THEME LIGHT GLASS + VERT ÉMERAUDE
   ==========================================================================
*/

/* ========================= VARIABLES ========================= */
:root {
    /* Primary Green - IPTV4U Brand */
    --primary: #10b981;
    --primary-light: #34d399;
    --primary-dark: #059669;
    --primary-glow: #10b981;
    --secondary-glow: #059669;
    --accent-glow: #34d399;

    /* Neutral palette */
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-glass-strong: rgba(255, 255, 255, 0.95);
    --bg-card: #ffffff;

    /* Text colors */
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #374151;

    /* Borders */
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.04);
    --border-primary: rgba(16, 185, 129, 0.2);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --shadow-glass: 0 8px 20px rgba(0,0,0,0.15);

    /* Glass blur */
    --blur: 12px;
    --blur-strong: 20px;

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-full: 9999px;

    /* Spacing */
    --s1: 0.25rem;
    --s2: 0.5rem;
    --s3: 0.75rem;
    --s4: 1rem;
    --s5: 1.25rem;
    --s6: 1.5rem;
    --s8: 2rem;
    --s12: 3rem;

    /* Animation */
    --transition: .25s cubic-bezier(0.4,0,0.2,1);
    --transition-slow: .4s cubic-bezier(0.4,0,0.2,1);
}

/* ========================= GLOBAL RESET ========================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { 
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================= CONTAINERS ========================= */
.container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--s4);
}

/* ========================= ANNOUNCEMENT BAR ========================= */
.announcement-bar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: var(--s3) 0;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.announcement-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.announcement-text {
    font-weight: 600;
}

.announcement-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: var(--s1) var(--s3);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.announcement-link:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* ========================= HEADER ========================= */
.site-header {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    border-bottom: 1px solid var(--border);
    padding: var(--s4) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.site-header.scrolled {
    background: var(--bg-glass-strong);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(var(--blur-strong));
}

/* Header content */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s6);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 165px;
    height: auto;
    transition: var(--transition);
}

.logo:hover img {
    transform: scale(1.05);
}

/* ========================= NAVIGATION ========================= */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--s2);
}

.nav-link {
    padding: var(--s3) var(--s4);
    display: flex;
    align-items: center;
    gap: var(--s2);
    text-decoration: none;
    color: var(--text);
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: var(--primary);
    background: var(--bg-soft);
}

.nav-link:hover::before,
.nav-item.active .nav-link::before {
    width: 80%;
}

.nav-icon {
    font-size: 0.9em;
    color: var(--primary);
    transition: var(--transition);
}

/* ========================= HEADER ACTIONS ========================= */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.action-btn {
    background: none;
    border: none;
    padding: var(--s3);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--bg-soft);
    color: var(--primary);
    transform: translateY(-1px);
}

/* ========================= MOBILE NAVIGATION ========================= */
.nav-toggle {
    display: none;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(var(--blur-strong));
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    border-left: 1px solid var(--border);
    transition: var(--transition-slow);
    z-index: 1001;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-header {
    padding: var(--s6) var(--s6) var(--s4);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass);
}

.mobile-nav-title {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

.mobile-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--s2);
    border-radius: var(--radius);
    transition: var(--transition);
}

.mobile-close:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

.mobile-nav-content {
    padding: var(--s6);
    display: flex;
    flex-direction: column;
    gap: var(--s2);
    flex: 1;
}

.mobile-nav-link {
    padding: var(--s4) var(--s4);
    text-decoration: none;
    color: var(--text);
    border-radius: var(--radius);
    transition: var(--transition);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--s3);
    border: 1px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    background: var(--primary);
    color: white;
    transform: translateX(4px);
    border-color: var(--primary-light);
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
}

/* ========================= THEME SWITCH ========================= */
.mobile-theme-switch {
    margin-top: auto;
    padding: var(--s4);
    border-top: 1px solid var(--border);
}

.theme-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: var(--s3) 0;
}

.theme-switch-text {
    font-weight: 600;
    color: var(--text);
}

.theme-switch-input {
    display: none;
}

.theme-switch-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    position: relative;
    transition: var(--transition);
}

.theme-switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.theme-switch-input:checked + .theme-switch-slider {
    background: var(--primary);
}

.theme-switch-input:checked + .theme-switch-slider::before {
    transform: translateX(20px);
}

/* ========================= OVERLAY ========================= */
.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.page-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========================= SEARCH OVERLAY ========================= */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 2000;
    padding-top: 20vh;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px);
    padding: var(--s8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass);
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border);
    transform: translateY(-20px);
    opacity: 0;
    transition: var(--transition-slow);
}

.search-overlay.active .search-container {
    transform: translateY(0);
    opacity: 1;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--s6);
}

.search-title {
    color: var(--text);
    font-weight: 700;
    font-size: 1.5rem;
}

.search-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--s2);
    border-radius: var(--radius);
    transition: var(--transition);
}

.search-close:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

.search-form {
    margin-bottom: var(--s6);
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: var(--s4) var(--s6);
    padding-right: 60px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.search-submit {
    position: absolute;
    right: var(--s2);
    background: var(--primary);
    border: none;
    padding: var(--s3);
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-submit:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.search-suggestions-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--s3);
    font-weight: 600;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}

.search-tag {
    padding: var(--s2) var(--s3);
    background: var(--bg-soft);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.search-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ========================= UTILITY CLASSES ========================= */
.no-scroll {
    overflow: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================= RESPONSIVE ========================= */
@media (max-width: 1024px) {
    .nav-list {
        gap: var(--s1);
    }
    
    .nav-link {
        padding: var(--s2) var(--s3);
        font-size: 0.9rem;
    }
}

@media (max-width: 920px) {
    .main-nav {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .header-actions {
        gap: var(--s1);
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 0 var(--s3);
    }
    
    .announcement-content {
        flex-direction: column;
        gap: var(--s2);
        text-align: center;
    }
    
    .mobile-nav {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .logo img {
        width: 140px;
    }
    
    .search-container {
        padding: var(--s6);
        margin: var(--s4);
    }
    
    .search-title {
        font-size: 1.25rem;
    }
    
    .mobile-nav {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================= ACCESSIBILITY ========================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}