/* AltList Premium - Glassmorphism & Neon */
:root {
    /* Base Colors */
    --bg-dark: #050505;
    --bg-card: rgba(22, 27, 34, 0.7);
    --border: rgba(48, 54, 61, 0.6);
    --text: #e6edf3;
    --text-muted: #8b949e;

    /* Accents */
    --primary: #58a6ff;
    --primary-glow: rgba(88, 166, 255, 0.3);
    --gold: #f5c518;
    --gold-glow: rgba(245, 197, 24, 0.2);

    /* Glass Effect */
    --glass-bg: rgba(13, 17, 23, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --backdrop-blur: blur(12px);

    /* Animation */
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.05) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(245, 197, 24, 0.03) 0%, transparent 25%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: var(--glass-border);
    padding: 16px 0;
    margin-bottom: 40px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-item {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
}

/* Dropdown Menu (Simple CSS Hover) */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    width: 200px;
    background: #0d1117;
    border: var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s var(--ease);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary);
}

/* --- Hero Section (Index) --- */
.hero {
    text-align: center;
    padding: 60px 0 80px;
    animation: fadeIn 0.8s var(--ease);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Category Grid (Index - Standard) --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding-bottom: 60px;
}

.card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: all 0.3s var(--ease);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(88, 166, 255, 0.4);
    box-shadow: 0 10px 40px -10px var(--primary-glow);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 48px;
    color: var(--text-muted);
    transition: all 0.3s var(--ease);
    margin-bottom: 8px;
}

.card:hover .card-icon {
    transform: scale(1.1);
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.3px;
}

/* --- Page Content (Category Pages) --- */
.page-header {
    margin-bottom: 40px;
    animation: slideUp 0.6s var(--ease);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.page-title svg {
    color: var(--gold);
}

.section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-inline-start: 12px;
    border-inline-start: 2px solid var(--primary);
}

/* --- Premium Link Rows --- */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.link-row {
    display: flex;
    align-items: center;
    /* justify-content: space-between; REMOVED to fix 3-item layout */
    gap: 16px;
    /* Add gap for right-side items */
    padding: 16px 24px;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 12px;
    transition: all 0.2s var(--ease);
}

.link-row:hover {
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.3);
    transform: scale(1.01);
    box-shadow: 0 4px 20px -5px var(--primary-glow);
}

.link-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-inline-end: auto;
    /* Pushes link info to inline-start, external icon to inline-end */
}

.link-icon {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    transition: all 0.3s ease;
}

/* Gray dot when offline */
.link-row:has(.offline-badge) .link-icon {
    background: var(--text-muted);
    box-shadow: none;
    opacity: 0.5;
}

/* Hide external icon when offline */
.link-row:has(.offline-badge) .link-external {
    display: none;
}

.link-name {
    font-weight: 500;
    color: #fff;
}

.link-url {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s var(--ease);
}

.link-row:hover .link-url {
    opacity: 0.6;
    transform: translateX(0);
}

.link-external {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: #444;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    margin-top: 40px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    /* Hide complicated nav on mobile for now, just logo */
}

/* Offline Link Badge */
.offline-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    margin-inline-start: 0.8rem;
    background: rgba(255, 68, 68, 0.15);
    color: #ff5555;
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.1);
}

/* --- Enhancements: Status & Security --- */

/* Monitor Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(88, 166, 255, 0.05);
    /* Very subtle blue tint */
    border: 1px solid rgba(88, 166, 255, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.last-updated {
    font-weight: 500;
}

.link-stats {
    font-weight: 700;
    color: var(--primary);
}

/* Security Alert Banner (YTS Style) */
.security-alert {
    background: #000;
    border: 2px solid #46d369;
    /* Bright green border */
    border-radius: 0;
    /* Boxy look */
    padding: 20px;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 0 20px rgba(70, 211, 105, 0.1);
}

.security-alert h3 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.security-alert h3 span {
    color: #46d369;
    /* Green for IP */
}

.security-alert p {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.alert-btn {
    display: inline-block;
    color: #000;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    margin: 0 8px;
    /* Gap between buttons */
}

/* VPN Button (Green) */
.alert-btn.vpn {
    background: #46d369;
}

.alert-btn.vpn:hover {
    background: #3eb65b;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(70, 211, 105, 0.4);
}

/* AdBlock Button (Red/Orange) */
.alert-btn.adblock {
    background: #ff5555;
    color: #fff;
}

.alert-btn.adblock:hover {
    background: #e04444;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.4);
}

/* --- Navigation Enhancements (Back Btn & Category Chips) --- */

/* Back Button (Next to Page Title) */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    transition: all 0.2s var(--ease);
    margin-right: 12px;
    /* LTR */
}

/* RTL Support for Back Button */
html[dir="rtl"] .back-btn {
    margin-right: 0;
    margin-left: 12px;
    transform: scaleX(-1);
    /* Flip arrow for RTL */
}

.back-btn:hover {
    background: rgba(88, 166, 255, 0.15);
    color: var(--primary);
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateX(-4px);
    /* Hover effect LTR */
}

html[dir="rtl"] .back-btn:hover {
    transform: scaleX(-1) translateX(-4px);
    /* Correct visual flip + movement */
}


/* Category Navigation (Horizontal Chips - Wrapped) */
.category-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    /* Mobile-first: wrap to multiple lines */
    justify-content: center;
    /* Center align chips */
    padding: 0 0 24px 0;
    margin-bottom: 20px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 99px;
    /* Pill shape */
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.category-chip.active {
    background: rgba(88, 166, 255, 0.15);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.15);
}
/* --- Mobile Navigation & Banners --- */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Navbar Layout */
    .nav-content {
        position: relative;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none; /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        border-bottom: var(--glass-border);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
        animation: slideDown 0.3s ease-out;
    }

    .nav-links.mobile-active {
        display: flex;
    }

    /* Stack Banner Buttons */
    .security-alert div {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .alert-btn {
        width: 100%;
        margin: 0 !important;
        box-sizing: border-box;
        text-align: center;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
