/* ========== CRITICAL CSS - ABOVE THE FOLD ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --primary-bg: #0a0a0f;
    --secondary-bg: #11111a;
    --accent-gold: #FFD700;
    --accent-red: #FF4757;
    --accent-blue: #1e90ff;
    --accent-purple: #9b59b6;
    --accent-gradient: linear-gradient(135deg, #FFD700, #FF8C00, #FF4757);
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --card-bg: rgba(25, 25, 35, 0.9);
    --border-color: rgba(255, 215, 0, 0.2);
    --glow-effect: 0 0 20px rgba(255, 215, 0, 0.3);
    --header-height: 70px;
}

body {
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========== OPTIMIZED HEADER ========== */
.header {
    background: rgba(10, 10, 15, 0.95);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    height: var(--header-height);
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-title {
    font-size: 22px;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.site-title span {
    color: var(--accent-gold);
}

/* ========== ANIME HERO SECTION ========== */
.anime-hero {
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10,10,15,0.9) 0%, rgba(25,25,35,0.9) 100%);
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero-content {
    display: flex;
    gap: 30px;
    padding: 40px 0;
    align-items: flex-start;
}

.anime-poster {
    flex-shrink: 0;
    width: 300px;
    height: 450px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
}

.anime-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anime-info {
    flex: 1;
}

.anime-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.anime-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.meta-item i {
    color: var(--accent-gold);
    font-size: 16px;
}

.rating-badge {
    background: var(--accent-gradient);
    color: var(--primary-bg);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.anime-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.anime-tag {
    padding: 6px 15px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-gold);
    transition: all 0.3s ease;
}

.anime-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
    max-width: 800px;
}

/* ========== NON-CRITICAL STYLES ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 4px;
}

/* ========== EPISODES SECTION ========== */
.episodes-section {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* ========== EPISODE CARD ========== */
.episode-card {
    background: rgba(20, 20, 30, 0.9);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    padding: 0;
}

.episode-header {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.15));
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.episode-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.episode-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.episode-number i {
    font-size: 14px;
}

.episode-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 10px;
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

/* ========== QUALITY TABS ========== */
.quality-tabs {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background: rgba(30, 30, 40, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quality-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 70px;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
}

.quality-tab:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--accent-gold);
}

.quality-tab.active {
    background: var(--accent-gradient);
    color: var(--primary-bg);
    border-color: var(--accent-gold);
}

/* ========== SERVER BUTTONS ========== */
.servers-container {
    padding: 15px 20px;
}

.server-notice {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--accent-gold);
}

.server-notice i {
    color: var(--accent-gold);
    font-size: 14px;
}

.server-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

/* ========== SERVER BUTTON ========== */
.server-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(35, 35, 45, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.server-btn:hover {
    background: rgba(45, 45, 55, 0.9);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.server-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.server-btn:nth-child(1) .server-icon {
    background: rgba(30, 144, 255, 0.2);
    color: var(--accent-blue);
}

.server-btn:nth-child(2) .server-icon {
    background: rgba(155, 89, 182, 0.2);
    color: var(--accent-purple);
}

.server-info {
    flex: 1;
    min-width: 0;
}

.server-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.server-size {
    font-size: 10px;
    color: #2ecc71;
    font-weight: 600;
    background: rgba(46, 204, 113, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.server-status {
    font-size: 10px;
    color: var(--accent-gold);
    font-weight: 600;
}

/* ========== RELATED SECTION ========== */
.related-section {
    padding: 30px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.related-section .section-title h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.related-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) var(--secondary-bg);
    -webkit-overflow-scrolling: touch;
}

.related-scroll::-webkit-scrollbar {
    height: 6px;
}

.related-scroll::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 3px;
}

.related-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 3px;
}

.related-card {
    flex: 0 0 auto;
    width: 200px;
    background: rgba(25, 25, 35, 0.8);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-decoration: none !important;
    display: block;
}

.related-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.related-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.related-card h3 {
    padding: 15px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    text-decoration: none !important;
}

/* ========== FOOTER (ANIMEHINDI STYLE) ========== */
.footer {
    background: var(--secondary-bg);
    margin-top: 40px;
    padding: 30px 25px 20px;
    border-top: 1px solid var(--border-color);
}

.footer-brand {
    text-align: center;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 22px;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 10px;
    display: block;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.social-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-gold);
    color: var(--primary-bg);
    transform: translateY(-3px);
}

.quick-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.quick-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.quick-link:hover {
    color: var(--accent-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 11px;
}

.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-bg);
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 3px 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    border: none;
    outline: none;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .anime-poster {
        width: 250px;
        height: 350px;
    }
    
    .server-buttons-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
        height: auto;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .hero-content {
        padding: 25px 0;
    }
    
    .anime-title {
        font-size: 24px;
    }
    
    .anime-poster {
        width: 200px;
        height: 280px;
    }
    
    .episodes-section {
        padding: 15px;
    }
    
    .related-section {
        padding: 25px 15px;
    }
    
    .footer {
        padding: 25px 15px 15px;
    }
    
    .server-buttons-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .server-btn {
        padding: 9px 12px;
    }
    
    .related-card {
        width: 180px;
    }
    
    .related-card img {
        height: 130px;
    }
    
    .quick-links {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .anime-title {
        font-size: 20px;
    }
    
    .anime-meta {
        gap: 10px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .anime-description {
        font-size: 14px;
    }
    
    .section-title h2 {
        font-size: 18px;
    }
    
    .quality-tabs {
        padding: 12px 15px;
    }
    
    .quality-tab {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 60px;
    }
    
    .servers-container {
        padding: 12px 15px;
    }
    
    .server-notice {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .server-name {
        font-size: 12px;
    }
    
    .related-card {
        width: 150px;
    }
    
    .related-card h3 {
        font-size: 12px;
        padding: 10px;
    }
}

/* Hide Watch Online section */
.watch-online-section {
    display: none;
}