/*
Theme Name: LazySano
Theme URI: https://lazysano.com/
Author: LazySano
Author URI: https://lazysano.com/
Description: A high-performance, visually stunning WordPress theme for anime
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lazysano
Domain Path: /languages
Tags: dark, rtl, anime, responsive
*/

:root {
    --primary-color: #005af0;
    --bg-dark: #0f0f0f;
    --bg-card: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --accent-blue: #2196f3;
    --accent-yellow: #ffeb3b;
    --gradient-overlay: linear-gradient(0deg, rgba(15, 15, 15, 1) 0%, rgba(15, 15, 15, 0.4) 60%, rgba(15, 15, 15, 0) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: min(92vw, 1600px);
    margin: 0 auto;
    padding: 0 clamp(16px, 2vw, 40px);
}

/* Header */
.site-header {
    background: rgba(15, 15, 15, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid rgba(0, 90, 240, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    gap: 12px;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.2s, background 0.2s;
}

.header-icon-btn:hover {
    transform: scale(1.1);
    background: #004bb5;
}

.site-logo .logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.site-logo img {
    height: auto;
    max-height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-main);
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-list a {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-list a:hover {
    color: var(--text-main);
}

/* Hero Section - Full Width Slider */
.hero-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    margin-bottom: 60px;
    overflow: hidden;
}

.hero-slider {
    position: relative;
    height: 100%;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    z-index: 1;
}

/* Background Image Element - Blurred */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;

    /* Image Quality Fix: Blur & Scale */
    filter: blur(4px);
    transform: scale(1.05);
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Gradient Overlay - Bottom to Top */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg,
            rgba(10, 10, 12, 0.98) 0%,
            rgba(10, 10, 12, 0.7) 25%,
            rgba(10, 10, 12, 0.2) 50%,
            transparent 70%);
    z-index: 1;
}

/* ============================================
   SPLIT LAYOUT HERO SLIDER - SYSTEM
   ============================================ */

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    height: 100%;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    /* In RTL: First child (Info) is Right, Second (Poster) is Left */
}

/* 1. Hero Info (Right Side) */
.hero-info {
    flex: 1;
    text-align: right;
    max-width: 60%;

    /* Remove old box confinement to let it breathe in split layout */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 20px 0;
}

.hero-title {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.5);
}

.hero-meta {
    justify-content: flex-start;
    /* Right aligned in RTL */
    margin-bottom: 25px;
}

.hero-story-snippet {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 25px;
    padding-top: 20px;
    max-width: 90%;
}

.hero-story-snippet p {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.hero-actions {
    margin-top: 30px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 90, 240, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 90, 240, 0.6);
    background: #fff;
    color: var(--primary-color);
}

/* 2. Hero Poster (Left Side - "Black Side") */
.hero-poster {
    flex-shrink: 0;
    width: 300px;
    z-index: 10;
    position: relative;
}

/* The "Black Side" Effect - A card with strong shadow */
.poster-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: -20px 20px 60px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    /* Subtle white border */
    transform: perspective(1000px) rotateY(5deg);
    transition: transform 0.4s ease;
    background: #000;
    /* Fallback */
}

.poster-card:hover {
    transform: perspective(1000px) rotateY(0deg) scale(1.02);
}

.poster-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
}

/* Meta Section - Rating Badges */
.hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 12px;
}

.mal-badge {
    background: #2E51A2;
    color: #fff;
}

.imdb-badge {
    background: #F5C518;
    color: #000;
}

.rating-badge .badge-label {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.9;
}

.rating-badge .badge-score {
    font-size: 14px;
    font-weight: 700;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.meta-item .dashicons {
    font-size: 16px;
    opacity: 0.8;
}

/* Story Snippet */
.hero-story-snippet {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.hero-story-snippet p {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    margin: 0;
    max-height: 90px;
    overflow: hidden;
    position: relative;

    /* Fade out effect at the end */
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* Genre Tags - Hidden in this design */
.hero-genres {
    display: none;
}

.genre-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.genre-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Slider Controls */
.slider-controls {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.slider-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.slider-btn .dashicons {
    font-size: 20px;
}

/* Layout — RTL: sidebar on RIGHT, content on LEFT */
.main-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(20px, 2.5vw, 40px);
    padding-top: 1%;
}

/* Content takes all remaining space */
.main-layout .content-area {
    flex: 1;
    min-width: 0;
    order: 2;
    /* appears visually after sidebar in RTL */
}

/* Sidebar pinned to the right (start in RTL) */
.main-layout .sidebar {
    width: clamp(280px, 22vw, 360px);
    flex-shrink: 0;
    order: 2;
    /* appears on the right in RTL */
}

@media (max-width: 1100px) {
    .main-layout {
        flex-direction: column;
    }

    .main-layout .content-area,
    .main-layout .sidebar {
        order: unset;
        width: 100%;
    }
}

/* Episodes Grid */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.episode-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.card-thumb {
    position: relative;
    aspect-ratio: 16/9;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
}

.ep-number {
    background: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Ongoing Section - Modern Glassmorphic Design */
.modern-ongoing-section {
    margin-top: 80px;
    margin-bottom: 60px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    min-height: 550px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modern-ongoing-bg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center;
    filter: blur(25px);
    transition: background-image 0.5s ease-in-out, opacity 0.5s ease-in-out;
    z-index: 1;
}

.modern-ongoing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.9) 0%, rgba(15, 15, 15, 0.65) 50%, rgba(15, 15, 15, 0.95) 100%);
    z-index: 2;
}

.modern-ongoing-container {
    position: relative;
    z-index: 3;
    padding: 40px;
    height: 100%;
}

.modern-ongoing-content {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    align-items: stretch;
}

.ongoing-interactive-list {
    flex: 1.2;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.focused-preview {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.focused-poster-wrapper {
    position: relative;
    width: 220px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s ease;
}

.focused-poster-wrapper:hover {
    transform: translateY(-5px);
}

.focused-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.focused-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 30px rgba(0, 90, 240, 0.4);
    pointer-events: none;
}

.focused-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.focused-desc {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 25px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.btn-sm {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
}

/* Tabs */
.modern-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: none;
}

.modern-tabs .tab-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.modern-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.modern-tabs .tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 90, 240, 0.3);
}

/* List Items */
.list-scroll-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.modern-list-item:hover,
.modern-list-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(-5px);
    /* Right shift in RTL */
}

.modern-list-item.active {
    box-shadow: -4px 0 0 var(--primary-color);
}

.modern-list-item .item-thumb {
    width: 60px;
    flex-shrink: 0;
}

.modern-list-item .item-thumb img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.modern-list-item .item-text {
    flex: 1;
    overflow: hidden;
}

.modern-list-item h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-status {
    font-size: 12px;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 90, 240, 0.1);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .modern-ongoing-content {
        flex-direction: column;
    }

    .focused-preview {
        margin-bottom: 30px;
    }

    .modern-list-item:hover,
    .modern-list-item.active {
        transform: translateY(-3px);
    }

    .modern-list-item.active {
        box-shadow: 0 -4px 0 var(--primary-color);
    }
}

@media (max-width: 480px) {
    .modern-ongoing-container {
        padding: 20px;
    }

    .focused-title {
        font-size: 20px;
    }
}

/* Sidebar */
.widget {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.widget-title {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

/* Single Anime Page Redesign */
.anime-single-container {
    position: relative;
    padding: 100px 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

.anime-page-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(15px);
    background: rgba(0, 0, 0, 0.75);
    z-index: 1;
}

.anime-main-wrapper {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    /* Increased width */
}

.anime-header-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
}

.header-top-flex {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.poster-sidebar {
    width: 250px;
    /* Bigger poster */
    flex-shrink: 0;
}

.poster-sidebar img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.content-main-side {
    flex-grow: 1;
}

.header-inner-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.rating-badges-top {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45px;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s;
}

.badge-item:hover {
    transform: translateY(-3px);
}

.badge-item.mal .b-label {
    background: #2e51a2;
    color: #fff;
}

.badge-item.imdb .b-label {
    background: #f5c518;
    color: #000;
}

.b-label {
    font-size: 10px;
    font-weight: 800;
    width: 100%;
    text-align: center;
    padding: 2px 0;
}

.b-value {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 0;
}

.title-centering {
    text-align: right;
}

.anime-h-title {
    font-size: 38px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 10px;
}

.anime-h-subtitle {
    font-size: 18px;
    color: #bbb;
}

.anime-meta-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.meta-card-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.m-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.m-label {
    color: #888;
    font-weight: 600;
}

.m-val {
    color: #333;
    font-weight: 700;
}

.anime-story-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    color: #fff;
}

.story-h2 {
    font-size: 24px;
    color: var(--accent-yellow);
    margin-bottom: 25px;
    text-align: right;
}

.story-txt {
    line-height: 1.8;
    color: #ccc;
    font-size: 16px;
    text-align: justify;
}

@media (max-width: 1100px) {
    .header-top-flex {
        flex-direction: column;
        align-items: center;
    }

    .poster-sidebar {
        margin: 0 0 30px 0;
    }

    .title-centering {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .anime-meta-dual-grid {
        grid-template-columns: 1fr;
    }
}

/* Archive & Taxonomy Pages */
.archive-container {
    padding: 60px 0;
}

.archive-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.archive-title {
    font-size: 28px;
    color: var(--text-main);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.anime-card .card-thumb {
    aspect-ratio: 2/3;
    /* Traditional anime poster ratio */
}

.rating-tag {
    background: var(--accent-yellow) !important;
    color: #000;
    font-weight: bold;
}

.anime-meta-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination .page-numbers {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--primary-color);
}

/* Footer */
.site-footer {
    margin-top: 50px;
    padding: 30px 0 20px;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 90, 240, 0.2);
    position: relative;
    clear: both;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-brand-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-container img {
    height: auto;
    max-height: 60px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.footer-brand-name {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary-color), #4d90f4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.copyright-text {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.footer-links-column {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links-column a {
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 10px;
}

.footer-links-column a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-links-column a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.footer-links-column a:hover::after {
    width: 80%;
}

.footer-social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.footer-social-links a {
    width: 40px;
    height: 40px;
    background: rgba(0, 90, 240, 0.1);
    border: 1px solid rgba(0, 90, 240, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.footer-social-links a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 90, 240, 0.4);
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #004bb5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 90, 240, 0.3);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 90, 240, 0.5);
}

.scroll-to-top .dashicons {
    font-size: 24px;
}

/* Responsive Design for Hero Slider (Split Layout) */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-content-wrapper {
        padding: 0 30px;
        gap: 40px;
    }

    .hero-poster {
        width: 240px;
    }
}

@media (max-width: 992px) {
    .hero-section {
        height: auto;
        min-height: 550px;
        padding: 40px 0;
    }

    .hero-content-wrapper {
        flex-direction: column-reverse;
        /* Poster Top (2), Info Bottom (1) */
        justify-content: center;
        text-align: center;
    }

    .hero-info {
        max-width: 100%;
        text-align: center;
        padding: 0;
    }

    .hero-meta {
        justify-content: center;
    }

    .hero-poster {
        width: 200px;
        /* Smaller poster on tablet */
        margin-bottom: 20px;
    }

    .hero-story-snippet {
        margin: 20px auto 0;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-poster {
        width: 180px;
    }

    .hero-story-snippet p {
        font-size: 14px;
        max-height: 80px;
    }

    .slider-controls {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
    }
}

.slider-btn {
    width: 36px;
    height: 36px;
}

.slider-btn .dashicons {
    font-size: 18px;
}


@media (max-width: 768px) {
    .ep-hero-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ep-thumbnail-container {
        max-width: 300px;
        margin: 0 auto;
    }

    .ep-content-columns {
        flex-direction: column-reverse;
        /* Cover below info on mobile, or keep flex-direction: column if you prefer cover on top */
    }

    .ep-anime-cover-col {
        flex: 1 1 100% !important;
        max-width: 200px;
        margin: 0 auto;
    }

    .ep-info-col {
        flex: 1 1 100% !important;
        width: 100%;
    }

    .ep-anime-title {
        font-size: 2rem;
    }

    .ep-sub-title {
        font-size: 1.2rem;
    }

    .dl-tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 400px;
    }

    .hero-info {
        max-width: 95%;
        padding: 20px 25px 25px 25px;
        margin: 0 10px;
        border-radius: 12px;
    }

    .hero-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .hero-meta {
        gap: 8px;
    }

    /* Hide story snippet on very small screens to reduce clutter */
    .hero-story-snippet {
        display: none;
    }

    .slider-controls {
        bottom: 20px;
        left: 20px;
        gap: 6px;
    }

    .slider-btn {
        width: 32px;
        height: 32px;
    }

    .slider-btn .dashicons {
        font-size: 16px;
    }
}

/* ============================================
   ANIME SINGLE EPISODES LIST
   ============================================ */
.anime-episodes-section {
    margin-top: 50px;
    background: rgba(25, 25, 30, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.episodes-h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 25px;
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ep-list-header {
    display: grid;
    grid-template-columns: 80px 1fr 100px 150px;
    gap: 15px;
    padding: 0 20px 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}

.ep-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 150px;
    gap: 15px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-main);
}

.ep-row:hover {
    background: rgba(0, 90, 240, 0.15);
    border-color: rgba(0, 90, 240, 0.3);
    transform: translateX(-5px);
}

.ep-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
}

.ep-title {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-type {
    font-size: 13px;
    color: var(--accent-yellow);
    font-weight: 600;
}

.ep-date {
    font-size: 13px;
    color: var(--text-muted);
}

.ep-btn-view {
    justify-self: end;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ep-row:hover .ep-btn-view {
    background: var(--primary-color);
    color: #fff;
}

@media (max-width: 768px) {
    .ep-list-header {
        display: none;
    }

    .ep-row {
        grid-template-columns: 60px 1fr;
    }

    .ep-type,
    .ep-date {
        display: none;
    }
}

/* ============================================
   EPISODE NAVIGATION (NEXT/PREV)
   ============================================ */
.ep-navigation-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.ep-nav-item {
    flex: 1;
    min-width: 0;
    /* Prevent flex overflow */
}

.ep-nav-link {
    display: flex;
    align-items: center;
    background: rgba(25, 25, 30, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    height: 100%;
}

.ep-nav-link:not(.disabled):hover {
    background: rgba(0, 90, 240, 0.15);
    border-color: rgba(0, 90, 240, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 90, 240, 0.2);
}

.ep-nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
}

.ep-nav-link.prev {
    justify-content: flex-start;
}

.ep-nav-link.next {
    justify-content: flex-end;
}

.ep-nav-link .nav-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ep-nav-link.prev .nav-icon {
    margin-left: 15px;
    /* RTL space */
}

.ep-nav-link.next .nav-icon {
    margin-right: 15px;
    /* RTL space */
}

.nav-text-block {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-text-block.text-left {
    text-align: left;
}

.nav-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.nav-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .ep-navigation-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .ep-nav-link {
        justify-content: center;
        text-align: center;
    }

    .ep-nav-link.prev .nav-icon,
    .ep-nav-link.next .nav-icon {
        display: none;
        /* Hide icons on very small screens if they crowd the text */
    }

    .nav-text-block.text-left {
        text-align: center;
    }
}

/* ============================================
   LATEST EPISODES MODERN GRID
   ============================================ */
.episodes-modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.ep-modern-card {
    background: rgba(20, 20, 25, 0.7);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ep-modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.ep-modern-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ep-modern-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.ep-modern-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
    transition: background 0.3s ease;
}

.ep-modern-card:hover .ep-modern-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.6) 100%);
}

/* Base: shared positioning/reset for all number badges */
.ep-modern-number {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(-4deg);
    font-family: 'Cairo', sans-serif;
    z-index: 2;
    pointer-events: none;
}

/* ── Normal episode number badge ─────────────────── */
.ep-modern-number.ep-num-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    background: linear-gradient(145deg, rgba(15,15,30,0.82), rgba(30,30,60,0.88));
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    padding: 5px 12px 7px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.05);
    text-shadow: none;
    color: #fff;
}
.ep-num-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(180, 200, 255, 0.75);
    text-transform: uppercase;
    margin-bottom: 2px;
}
.ep-num-range {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    line-height: 1;
}


/* ── Pack episode badge ──────────────────────────── */
.ep-modern-number.ep-pack-badge {
    right: auto;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-3deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    background: linear-gradient(135deg, rgba(130, 40, 220, 0.85), rgba(80, 0, 160, 0.9));
    border: 1px solid rgba(210, 160, 255, 0.35);
    border-radius: 12px;
    padding: 6px 14px 8px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 20px rgba(100, 0, 200, 0.5), 0 0 0 1px rgba(255,255,255,0.08);
    text-shadow: none;
    font-size: 1rem;
}
.ep-pack-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: rgba(220, 180, 255, 0.9);
    text-transform: uppercase;
    margin-bottom: 3px;
}
.ep-pack-range {
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
}


/* ── Episode list: pack row & badges ───────────────── */
.ep-row-pack {
    background: rgba(130, 40, 220, 0.04);
}
.ep-row-pack:hover {
    background: rgba(130, 40, 220, 0.09) !important;
}
.ep-pack-num-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 700;
    font-size: 0.82rem;
    color: #c8a0ff;
}
.epn-from, .epn-to {
    font-size: 0.9rem;
    color: #d4b4ff;
}
.epn-sep {
    font-size: 0.7rem;
    color: rgba(180, 130, 255, 0.55);
    padding: 0 1px;
}
.ep-pack-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #c8a0ff;
    background: rgba(130, 40, 220, 0.15);
    border: 1px solid rgba(180, 100, 255, 0.3);
    border-radius: 20px;
    padding: 2px 7px;
    white-space: nowrap;
    vertical-align: middle;
    transition: background 0.2s, border-color 0.2s;
}
.ep-pack-tag:hover {
    background: rgba(130, 40, 220, 0.28);
    border-color: rgba(180, 100, 255, 0.55);
}

.ep-modern-version {

    position: absolute;
    left: 0;
    bottom: 0px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    z-index: 2;
    border-top-right-radius: 6px;
    box-shadow: 2px -2px 10px rgba(0, 0, 0, 0.5);
}

.badge-web {
    background: #ff4757;
}

.badge-bd {
    background: #1e90ff;
}

.badge-default {
    background: #2ed573;
}

.ep-modern-info {
    padding: 18px 15px;
    background: rgba(30, 30, 35, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.ep-modern-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.ep-modern-card:hover .ep-modern-title {
    color: var(--primary-color);
}


/* ==========================================================================
   2. Fonts & Variables
   ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=The+Year+of+Handicrafts&display=swap');

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-red: #dc3545;
    --accent-green: #28a745;
    --accent-yellow: #ffc107;
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --bg-dark: #212529;
    --bg-medium: #343a40;
    --bg-light: #495057;
    --border-color: rgba(255, 255, 255, 0.1);
    --font-tajawal: 'Tajawal', sans-serif;
    --font-handicrafts: 'The Year of Handicrafts', cursive;
}

/* ============================================
   SINGLE EPISODE DISPLAY
   ============================================ */
.episode-single-container {
    position: relative;
    padding: 100px 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

.ep-page-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: rgba(15, 15, 18, 0.85);
    z-index: 1;
}

.ep-main-wrapper {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.ep-context-header {
    text-align: center;
    margin-bottom: 50px;
}

.ep-content-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 1rem;
    align-items: flex-start;
}

.ep-context-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.ep-context-badges .badge {
    background: #333;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.ep-context-badges .badge.imdb {
    background: #F5C518;
    color: #000;
}

.ep-context-badges .badge.mal {
    background: #2E51A2;
    color: #fff;
}

.ep-h-title {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ep-h-subtitle {
    font-size: 16px;
    color: var(--text-muted);
}

.ep-section-h2 {
    text-align: right;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 40px 0 20px 0;
}

.ep-box-card {
    background: rgba(40, 40, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    color: #eee;
}

/* Episode Info Table */
.ep-table-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ep-table-row:last-child {
    border-bottom: none;
}

.ep-table-row.th-row {
    background: rgba(255, 255, 255, 0.1);
    justify-content: center;
    font-weight: 700;
    color: #fff;
    padding: 20px;
}

.ep-table-row .col-label {
    text-align: right;
    font-weight: 600;
    flex: 1;
}

.ep-table-row .col-val {
    text-align: center;
    flex: 2;
}

/* Staff Table */
.staff-box {
    background: transparent;
    border: none;
}

.staff-box .styled-row {
    background: rgba(40, 40, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 10px;
}

/* Download Box */
.download-box {
    padding: 0;
}

.dl-tabs-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
}

.dl-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #aaa;
    padding: 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.dl-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.03);
}

.dl-tabs-container {
    padding: 30px;
}

.dl-tab-content {
    display: none;
}

.dl-tab-content.active {
    display: block;
    animation: fadeIn 0.4s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dl-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    text-align: center;
}

.dl-link-item {
    font-size: 14px;
    font-weight: 700;
    color: #eee;
    text-transform: uppercase;
    transition: color 0.3s;
}

.dl-link-item:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.dl-file-details {
    text-align: center;
    padding: 0 30px 30px 30px;
    color: #999;
}

.dl-file-details .file-name {
    font-size: 12px;
    margin-bottom: 10px;
}

.dl-file-details .file-size {
    font-size: 13px;
    font-weight: 700;
}


/* ==========================================================================
   Anime List V2 (Premium Redesign)
   ========================================================================== */

/* Hero Section */
.anime-hero {
    position: relative;
    width: 100%;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: -60px;
    /* Pulls content up to overlap the hero */
}

.anime-hero-bg {
    position: absolute;
    inset: 0;
    /* Atmospheric glowing background with a subtle pattern */
    background: radial-gradient(circle at center, rgba(33, 150, 243, 0.15) 0%, var(--bg-dark) 80%), url('data:image/svg+xml;charset=UTF-8,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M54.627 0l.83.83v58.34l-.83.83H5.373l-.83-.83V.83l.83-.83h49.254zM53.796 2.5H6.204v55h47.592v-55zM27 15h6v30h-6V15zm-10 8h6v14h-6V23zm20 0h6v14h-6V23z" fill="rgba(255,255,255,0.02)" fill-rule="evenodd"/%3E%3C/svg%3E');
    background-size: cover;
    z-index: 1;
}

.anime-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    margin-top: 60px;
    /* Offset for header */
}

.anime-hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-family: 'Cairo', sans-serif;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 10px 30px rgba(0, 90, 240, 0.4);
    letter-spacing: 2px;
}

.anime-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Floating Filter Console */
.anime-list-container {
    max-width: 96%;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.floating-filter-wrapper {
    background: rgba(20, 20, 25, 0.65);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 25px 35px;
    margin: 0 auto 50px auto;
    max-width: 1100px;
}

.anime-filter-form {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.filter-group label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.filter-group label .dashicons {
    color: var(--primary-color);
}

.glass-select {
    width: 100%;
    background: rgba(10, 10, 15, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 20px center;
    /* RTL adjustment */
    background-size: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.glass-select:focus,
.glass-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 90, 240, 0.25);
    background-color: rgba(20, 20, 30, 0.8);
    outline: none;
}

.glass-select option {
    background: var(--bg-card);
    color: #fff;
    padding: 15px;
}

/* Anime Grid */
.anime-list-grid {
    display: grid;
    gap: 30px;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 40vh;
    align-content: start;
}

@media (min-width: 600px) {
    .anime-list-grid {
        grid-template-columns: repeat(2, 1fr);
        padding-top: 2%;
    }

}

@media (min-width: 900px) {
    .anime-list-grid {
        grid-template-columns: repeat(3, 1fr);
        padding-top: 2%;
    }
}

@media (min-width: 1400px) {
    .anime-list-grid {
        grid-template-columns: repeat(4, 1fr);
        padding-top: 2%;
    }
}

@media (min-width: 1900px) {
    .anime-list-grid {
        grid-template-columns: repeat(5, 1fr);
        padding-top: 2%;
    }
}

@media (min-width: 2500px) {
    .anime-list-grid {
        grid-template-columns: repeat(6, 1fr);
        padding-top: 2%;
    }
}

/* Modern Card Layout */
.anime-list-card {
    height: auto;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.anime-list-card .ep-modern-thumb {
    aspect-ratio: 2/3;
    border-radius: 12px 12px 0 0;
}

.anime-card-score,
.anime-card-type,
.anime-card-status {
    position: absolute;
    z-index: 2;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.anime-card-score {
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.anime-card-type {
    top: 15px;
    left: 15px;
    background: rgba(33, 150, 243, 0.9);
}

/* Specific styling for Anime List card title box */
.anime-list-card .ep-modern-info {
    border-radius: 0 0 12px 12px;
    background: rgba(25, 25, 30, 0.9);
    padding: 20px 15px;
}

.anime-list-card .ep-modern-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
}

/* Loader */
.anime-list-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: absolute;
    inset: 0;
    backdrop-filter: blur(8px);
    z-index: 20;
    border-radius: 12px;
}

.anime-list-loader .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .floating-filter-wrapper {
        padding: 20px;
        margin-top: 20px;
        border-radius: 16px;
    }

    .anime-filter-form {
        flex-direction: column;
        gap: 20px;
    }

    .filter-group {
        width: 100%;
    }
}

.container.main-layout.clear-layout {
    padding-top: 1%;
}

/* ==========================================================
   SIDEBAR — Popular Episodes Widget
   ========================================================== */

.sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Wrapper produced by register_sidebar / dynamic_sidebar */
.sidebar-widget {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    animation: fadeUp 0.5s ease both;
}

/* Widget title bar */
.sidebar-widget .widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    margin: 0;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(0, 90, 240, 0.25) 0%, rgba(33, 150, 243, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-widget .widget-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent-blue), var(--primary-color));
}

/* The ordered list */
.popular-episodes-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

/* Each episode row */
.popular-ep-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.25s;
}

.popular-ep-item:last-child {
    border-bottom: none;
}

.popular-ep-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.25s, transform 0.2s;
}

.popular-ep-link:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(-3px);
    /* RTL nudge */
}

/* Rank number */
.popular-ep-rank {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Cairo', sans-serif;
    min-width: 36px;
    text-align: center;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

/* Top 3 get bolder rank styling */
.popular-ep-item:nth-child(1) .popular-ep-rank {
    font-size: 1.8rem;
}

.popular-ep-item:nth-child(2) .popular-ep-rank {
    font-size: 1.65rem;
}

/* Thumbnail */
.popular-ep-thumb-wrap {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.popular-ep-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.popular-ep-link:hover .popular-ep-thumb-wrap img {
    transform: scale(1.08);
}

.popular-ep-no-thumb {
    color: rgba(255, 255, 255, 0.25);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Text block */
.popular-ep-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.popular-ep-title {
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.popular-ep-anime {
    font-size: 0.75rem;
    color: var(--accent-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.popular-ep-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.popular-ep-meta time {
    font-size: 0.70rem;
    color: var(--text-muted);
}

.ep-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    background: rgba(0, 90, 240, 0.25);
    color: #7ec8ff;
    border: 1px solid rgba(0, 90, 240, 0.35);
    white-space: nowrap;
}

/* No-results text */
.sidebar-widget .no-data {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive: sidebar stacks below content on small screens */
@media (max-width: 1024px) {
    .sidebar {
        width: 100%;
    }
}