@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --accent-color: #f40606;
    /* Red Accent */
    --accent-glow: rgba(244, 6, 6, 0.4);
    --bg-darker: #0d0b15;
    /* Very dark purple - matches player */
    --bg-lighter: #171525;
    /* Player primary color */
    --glass-bg: rgba(23, 21, 37, 0.85);
    /* Matches player --cp-glass */
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #fff;
    --text-muted: #aaa;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modern-episode-page {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 3rem;
    padding-top: 10px;
    /* Added small top padding */
}

.modern-episode-grid {
    display: grid;
    grid-template-columns: 280px 1fr 360px;
    /* Widened right sidebar for maximum banner size */
    gap: 20px;
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 20px 20px;
    /* Pixel-perfect top alignment */
}

/* Glassmorphism Utility */
.modern-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

/* Player Section */
.modern-player-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Tightened gap */
    order: 2;
    min-width: 0;
    position: relative;
    /* Ensure section can hold glowing children */
}

/* Compact Breadcrumbs - Adaptive */
.modern-player-section .modern-glass:first-child {
    max-width: 650px;
    height: 32px;
    overflow: hidden !important;
    display: flex !important;
    align-items: center;
}

.modern-player-section .modern-glass:first-child nav,
.modern-player-section .modern-glass:first-child ol {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
}

.modern-player-section .modern-glass:first-child li {
    display: inline-block !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

/* First two items (Acasă, TV) - never shrink */
.modern-player-section .modern-glass:first-child li:nth-of-type(1),
.modern-player-section .modern-glass:first-child li:nth-of-type(2) {
    flex-shrink: 0;
}

/* Anime title - shrinks first, more aggressively */
.modern-player-section .modern-glass:first-child li:nth-of-type(3) {
    max-width: 150px;
    flex-shrink: 10;
}

/* Episode - ALWAYS visible, shrinks last */
.modern-player-section .modern-glass:first-child li:nth-of-type(4),
.modern-player-section .modern-glass:first-child li:last-of-type {
    max-width: 200px;
    min-width: 100px;
    flex-shrink: 1;
}

.modern-player-section .modern-glass:first-child * {
    margin-bottom: 0 !important;
    font-size: 0.72rem !important;
    line-height: 32px !important;
}

.modern-player-section .modern-glass:first-child a {
    color: var(--text-muted);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modern-player-section .modern-glass:first-child a:hover {
    color: var(--accent-color);
}

/* Smaller arrows */
.modern-player-section .modern-glass:first-child .material-icons-round {
    font-size: 14px !important;
    opacity: 0.5;
    margin: 0 2px;
    flex-shrink: 0;
}

.modern-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: transparent;
    border-radius: 12px;
    overflow: visible;
    box-shadow: var(--shadow-lg);
    /* Contain the ambilight glow */
    isolation: isolate;
}

/* Legacy Player Hidden properly if they leak */
.episode-head:not(.modern-episode-page .episode-head) {
    display: none !important;
}

/* Sidebar Styles */
.modern-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    order: 1;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.sidebar-card {
    padding: 16px;
    height: fit-content;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.episode-list-search {
    position: relative;
    margin-bottom: 15px;
}

.episode-list-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    color: #fff;
    font-size: 0.9rem;
}

.episode-list-search .material-icons-round {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
}

.modern-episode-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar Sidebar */
.modern-episode-list::-webkit-scrollbar {
    width: 4px;
}

.modern-episode-list::-webkit-scrollbar-track {
    background: transparent;
}

.modern-episode-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modern-episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.modern-episode-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.modern-episode-item.active {
    background: rgba(244, 6, 6, 0.1);
    border-color: var(--accent-color);
}

.ep-num {
    font-weight: 700;
    min-width: 30px;
    color: var(--accent-color);
}

.ep-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-muted);
}

.modern-episode-item.active .ep-title {
    color: #fff;
}

/* Controls & Tools */
.modern-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin-top: -8px;
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.control-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.modern-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.modern-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modern-btn.active {
    color: var(--accent-color);
    background: rgba(244, 6, 6, 0.1);
    border-color: rgba(244, 6, 6, 0.2);
}

.modern-btn .material-icons-round {
    font-size: 20px;
}

/* Servers Section */
.server-section {
    padding: 20px;
}

.server-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.server-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
    margin-bottom: 5px;
}

.server-btn {
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.server-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.server-btn.active {
    background: var(--accent-color);
    color: #000;
    font-weight: 600;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Anime Info Section - Modern Redesign */
.modern-anime-info {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(23, 21, 37, 0.9), rgba(10, 10, 10, 0.9));
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.modern-anime-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
}

.info-poster {
    width: 120px;
    flex-shrink: 0;
}

.info-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--glass-border);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.info-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-item {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item .material-icons-round {
    font-size: 14px;
}

.meta-item.rating {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.info-synopsis {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .modern-episode-grid {
        grid-template-columns: 1fr;
    }

    .modern-sidebar {
        order: -1;
    }

    .modern-episode-list {
        max-height: 250px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .modern-episode-grid {
        padding: 10px;
        gap: 12px;
    }

    .modern-episode-list {
        max-height: 200px;
    }

    .modern-anime-info {
        padding: 15px;
        gap: 15px;
    }

    .info-poster {
        width: 80px;
    }

    .info-title {
        font-size: 1.1rem;
    }

    .info-synopsis {
        display: none;
    }

    .modern-controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .control-group {
        gap: 8px;
    }

    .modern-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .modern-btn span:not(.material-icons-round) {
        display: none;
    }

    .modern-btn .material-icons-round {
        font-size: 18px;
    }

    .server-section {
        padding: 12px;
    }

    .server-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .sidebar-card {
        padding: 12px;
    }

    .sidebar-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .modern-anime-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .info-poster {
        width: 100px;
    }

    .info-meta {
        justify-content: center;
    }
}

/* Dimming effect for Light On */
.modern-episode-page.dimmed {
    background-color: #000;
}

.modern-episode-page.dimmed>*:not(.modern-episode-grid) {
    filter: brightness(0.2) blur(2px);
    transition: all 0.5s ease;
}

.modern-episode-page.dimmed .modern-episode-grid>*:not(.modern-player-section) {
    filter: brightness(0.2) blur(2px);
    transition: all 0.5s ease;
}

.modern-episode-page.dimmed .modern-player-section>*:not(.modern-player-wrapper) {
    filter: brightness(0.2) blur(2px);
    transition: all 0.5s ease;
}

.modern-episode-page.dimmed .modern-player-wrapper {
    box-shadow: 0 0 100px rgba(0, 0, 0, 1);
    transform: scale(1.02);
    z-index: 100;
    position: relative;
}

/* Hide Old Episode Anime Info Section */
.modern-episode-page .episode-anime-info,
.episode-head.episode-anime-info {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Compact Anime Info Card - Inline with Player */
.compact-anime-info {
    padding: 12px 16px;
}

.compact-anime-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.compact-poster {
    width: 50px;
    flex-shrink: 0;
}

.compact-poster img {
    width: 100%;
    border-radius: 6px;
}

.compact-details {
    flex: 1;
    min-width: 0;
}

.compact-title {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.compact-title:hover {
    color: var(--accent-color);
}

.compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.compact-meta span {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .compact-anime-info {
        padding: 10px 12px;
    }

    .compact-poster {
        width: 40px;
    }

    .compact-title {
        font-size: 0.9rem;
    }

    .compact-staff {
        display: none;
    }
}

/* Staff Credits in Compact Anime Info */
.compact-staff {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.staff-credit {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.staff-credit .material-icons-round {
    font-size: 14px;
    color: var(--accent-color);
}

.staff-credit a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.staff-credit a:hover {
    text-decoration: underline;
}

/* Right Sidebar - Anime Info */
.modern-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    order: 1;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.modern-right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    order: 3;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.anime-info-card {
    padding: 16px;
}

.anime-poster-section {
    margin-bottom: 20px;
}

.poster-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 85%;
    /* Slightly smaller as requested */
    margin: 0 auto;
}

.poster-link img {
    width: 100%;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.poster-link:hover img {
    transform: scale(1.05);
}

.poster-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.7) 100%);
}

.overlay-corner {
    position: absolute;
    display: flex;
    flex-direction: row;
    /* Horizontal badges */
    gap: 5px;
    padding: 8px;
}

.overlay-corner.top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.overlay-corner.top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}

.overlay-corner.bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
}

.overlay-corner.bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
}

.poster-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.poster-badge.quality {
    background: #fff;
    color: #000;
}

.poster-badge.type {
    background: var(--accent-color);
    color: #fff;
}

.poster-badge.status-badge.airing {
    background: #4ade80;
    color: #000;
}

/* Neon green for airing */
.poster-badge.status-badge.completed {
    background: #3b82f6;
    color: #fff;
}

/* Blue for completed */
.poster-badge.rating {
    background: rgba(0, 0, 0, 0.6);
}

.poster-badge.rating .material-icons-round {
    font-size: 12px;
    color: #ffd700;
}

.poster-badge.duration {
    background: rgba(0, 0, 0, 0.6);
}


.anime-title-section {
    text-align: center;
    margin-bottom: 15px;
}

.anime-title-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.1rem;
    /* Slightly smaller */
    font-weight: 600;
    display: block;
    line-height: 1.3;
    margin-bottom: 8px;
}

.anime-title-link:hover {
    color: var(--accent-color);
}

.anime-alt-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-meta-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.meta-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 3px;
}

.meta-badge.quality {
    background: #fff;
    color: #000;
}

.meta-badge.type {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent-color);
}

.meta-badge.rating {
    background: #f40606;
    color: #fff;
}

.meta-badge.rating .material-icons-round {
    font-size: 12px;
}

.anime-synopsis {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

.staff-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Perfect 3-column symmetry */
    gap: 10px;
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
    margin-top: 10px;
    width: 100%;
}

.staff-item {
    display: flex;
    flex-direction: column;
    /* Vertical within small column */
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 4px;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.staff-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: rgba(var(--accent-rgb), 0.3);
    transform: translateY(-2px);
}

.staff-item .material-icons-round {
    font-size: 18px;
    color: var(--accent-color);
}

.staff-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.staff-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.staff-item a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.staff-item.translator .material-icons-round {
    color: #4ade80;
}

.staff-item.author .material-icons-round {
    color: #3b82f6;
}

.staff-item.encoder .material-icons-round {
    color: #f472b6;
}


/* Anime Score Card */
.anime-score-card {
    padding: 12px;
}

.anime-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.anime-score-counts {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.star-icon {
    color: #ffd700;
    font-size: 18px !important;
}

.score-number {
    font-weight: 700;
    color: #fff;
}

.vote-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.vote-now-label {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
}

.anime-score-rate-this {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.anime-score-emoticons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.anime-score-emoticons>div {
    cursor: pointer;
    transition: transform 0.2s;
    opacity: 0.6;
}

.anime-score-emoticons>div:hover,
.anime-score-emoticons>div.selected {
    transform: scale(1.2);
    opacity: 1;
}

.anime-score-emoticons img {
    width: 24px;
    height: 24px;
}

/* Responsive - Reorganize right sidebar on smaller screens */
@media (max-width: 1200px) {
    .modern-episode-grid {
        grid-template-columns: 280px 1fr;
    }

    /* Show right sidebar full width below content on tablet/mobile */
    .modern-right-sidebar {
        grid-column: 1 / -1;
        order: 10;
        width: 100%;
    }
}

/* On even smaller screens, stack everything vertically */
@media (max-width: 1024px) {
    .modern-episode-grid {
        display: flex;
        flex-direction: column;
    }

    .modern-sidebar {
        order: 1;
        width: 100%;
    }

    .modern-player-section {
        order: 2;
        width: 100%;
    }

    .modern-right-sidebar {
        order: 3;
        width: 100%;
    }
}

/* ========================================
   COMMENTS SECTION - Modern Styling
   ======================================== */

.modern-episode-page #comments.comments-area {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px;
    margin-top: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.modern-episode-page #comments.comments-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(244, 6, 6, 0.05) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.modern-episode-page #comments.comments-area>* {
    position: relative;
    z-index: 1;
}

.modern-episode-page .comment-reply-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
}

.modern-episode-page .comment-form textarea#comment {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    padding: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    min-height: 120px;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modern-episode-page .comment-form textarea#comment:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.modern-episode-page .comment-extra-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    gap: 16px;
}

.modern-episode-page .comment-form-spoiler {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modern-episode-page .comment-form-spoiler input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.modern-episode-page .comment-form-spoiler input[type="checkbox"]:checked {
    background: var(--accent-color);
}

.modern-episode-page .comment-form-spoiler input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.modern-episode-page .comment-form .form-submit #submit {
    background: linear-gradient(135deg, var(--accent-color) 0%, #c40505 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 32px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.modern-episode-page .comment-form .form-submit #submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.modern-episode-page .logged-in-as {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.modern-episode-page .logged-in-as a {
    color: var(--accent-color);
    text-decoration: none;
}

.modern-episode-page .logged-in-as a:hover {
    text-decoration: underline;
}

/* ========================================
   RECOMMENDED ANIME SECTION - Modern
   ======================================== */

/* Recommendations container wrapper */
.modern-episode-page [data-component-name="recommended"],
.modern-episode-page div:has(> h2.text-accent) {
    background: rgba(23, 21, 37, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 32px;
    margin-top: 24px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Accent glow top */
.modern-episode-page [data-component-name="recommended"]::before,
.modern-episode-page div:has(> h2.text-accent)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

/* Section title */
.modern-episode-page h2.text-accent {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 0 24px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.modern-episode-page h2.text-accent::before {
    content: '' !important;
    width: 4px !important;
    height: 28px !important;
    background: var(--accent-color) !important;
    border-radius: 2px !important;
}

.modern-episode-page section:has(.grid-anime-auto) {
    margin-top: 40px;
}

.modern-episode-page section:has(.grid-anime-auto) h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modern-episode-page section:has(.grid-anime-auto) h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Anime Cards Grid */
.modern-episode-page .grid-anime-auto {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 20px !important;
}

/* Anime Card Styling */
.modern-episode-page .anime-card {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px !important;
    overflow: hidden;
    transition: all 0.25s ease !important;
}

.modern-episode-page .anime-card:hover {
    transform: translateY(-5px) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
}

.modern-episode-page .anime-card-image-container {
    margin: 10px !important;
    border-radius: 10px !important;
    overflow: hidden;
}

.modern-episode-page .anime-card-content {
    padding: 12px 14px 16px !important;
}

.modern-episode-page .anime-card-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: var(--text-main) !important;
    line-height: 1.35 !important;
}

.modern-episode-page .anime-card:hover .anime-card-title {
    color: var(--accent-color) !important;
}

.modern-episode-page .anime-card-meta {
    color: var(--text-muted) !important;
    font-size: 0.75rem !important;
    margin-top: 8px !important;
}

.modern-episode-page .anime-tag-ep {
    background: var(--accent-color) !important;
    border-radius: 6px !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
}

.modern-episode-page .anime-tag-attr {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 6px !important;
}

.modern-episode-page .anime-play-circle {
    background: var(--accent-color) !important;
    box-shadow: 0 4px 20px var(--accent-glow) !important;
}

.modern-episode-page .anime-card-status-badge {
    font-size: 0.6rem !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
}

/* Section below player container - Centered & Aligned */
.modern-episode-page.lg\\:flex {
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    display: flex;
    gap: 40px;
    background: var(--bg-darker);
}

.modern-episode-page.lg\\:flex>section {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
}

.modern-episode-page.lg\\:flex>aside {
    display: none;
    /* Hide sidebar if not needed */
}

/* Single column centered layout */
.modern-episode-page.lg\\:flex>section.flex-auto {
    max-width: 900px;
    margin: 0 auto;
}

/* Spoiler styling */
.modern-episode-page .spoiler-content {
    filter: blur(6px);
    cursor: pointer;
    transition: filter 0.3s ease;
    padding: 4px 8px;
    background: rgba(244, 6, 6, 0.1);
    border-radius: 4px;
}

.modern-episode-page .spoiler-content.revealed {
    filter: none;
    background: transparent;
}

/* Comment list styling */
.modern-episode-page .comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modern-episode-page .comment {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.modern-episode-page .comment-author {
    font-weight: 600;
    color: var(--text-main);
}

.modern-episode-page .comment-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.modern-episode-page .comment-content {
    color: var(--text-main);
    line-height: 1.6;
}

.modern-episode-page .like-dislike {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.modern-episode-page .like-button,
.modern-episode-page .dislike-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modern-episode-page .like-button:hover,
.modern-episode-page .dislike-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.modern-episode-page .like-button.text-accent-3,
.modern-episode-page .dislike-button.text-accent-3 {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ========================================
   GLOBAL FALLBACK STYLES
   For sections outside .modern-episode-page wrapper
   ======================================== */

/* Episode page body class targeting */
body.single-kiranime_episode {
    --accent-color: #f40606;
    --accent-glow: rgba(244, 6, 6, 0.4);
    --bg-darker: #0a0a0a;
    --bg-lighter: #171525;
    --glass-bg: rgba(23, 21, 37, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #fff;
    --text-muted: #aaa;
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Comments - Global */
body.single-kiranime_episode #comments.comments-area {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    padding: 28px !important;
    box-shadow: var(--shadow-lg) !important;
}

body.single-kiranime_episode .comment-form textarea#comment {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    color: var(--text-main) !important;
    font-family: 'Outfit', sans-serif !important;
}

body.single-kiranime_episode .comment-form textarea#comment:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
    outline: none !important;
}

body.single-kiranime_episode .comment-form .form-submit #submit,
body.single-kiranime_episode .custom-submit-button {
    background: linear-gradient(135deg, var(--accent-color) 0%, #c40505 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: 'Outfit', sans-serif !important;
    box-shadow: 0 4px 15px var(--accent-glow) !important;
}

/* Anime Cards - Global Override */
body.single-kiranime_episode .anime-card {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px !important;
}

body.single-kiranime_episode .anime-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.single-kiranime_episode .anime-card-title {
    font-family: 'Outfit', sans-serif !important;
    color: var(--text-main) !important;
}

body.single-kiranime_episode .anime-card:hover .anime-card-title {
    color: var(--accent-color) !important;
}

body.single-kiranime_episode .anime-tag-ep {
    background: var(--accent-color) !important;
}

/* Recommendations section container */
.modern-episode-page [data-component-name="recommended"] {
    background: rgba(23, 21, 37, 0.7) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    padding: 30px !important;
    margin-top: 30px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Recommended section title */
.modern-episode-page h2.text-accent {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 0 25px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    padding-left: 0 !important;
}

.modern-episode-page h2.text-accent::before {
    content: '';
    width: 4px;
    height: 28px;
    background: #f40606;
    border-radius: 2px;
    display: block;
}

/* Grid layout fix for recommendations */
.modern-episode-page .grid-anime-auto {
    gap: 20px !important;
}

/* Global cleanup for below-player sections */
.modern-below-player {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* DemonShop Banner styling */
.demonshop-banner-container {
    background: transparent !important;
    /* Transparent background for edge-to-edge look */
    border: none !important;
    /* Remove border to let image shine */
    border-radius: 12px !important;
    padding: 0 !important;
    /* Zero padding for maximum image size */
    margin-top: 15px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: all 0.3s ease !important;
}

.demonshop-banner-container:hover {
    transform: translateY(-5px) !important;
    border-color: rgba(244, 6, 6, 0.3) !important;
    background: rgba(23, 21, 37, 0.7) !important;
    box-shadow: 0 12px 40px rgba(244, 6, 6, 0.15) !important;
}

.demonshop-banner-image {
    width: 100% !important;
    height: auto !important;
    border-radius: 10px !important;
    display: block !important;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.demonshop-banner-container:hover .demonshop-banner-image {
    transform: scale(1.02) !important;
}

/* Specific adjustment for right sidebar banner */
.right-sidebar-banner {
    margin-top: 25px !important;
    border-radius: 20px !important;
    padding: 15px !important;
}

.demonshop-banner-link {
    width: 100% !important;
    display: block !important;
}


/* Recommended section title */
body.single-kiranime_episode section h2.text-accent {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    position: relative;
    padding-left: 16px;
}

body.single-kiranime_episode section h2.text-accent::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* Grid layout fix */
body.single-kiranime_episode .grid-anime-auto {
    gap: 20px !important;
}

/* Container styling */
body.single-kiranime_episode .lg\\:flex.gap-10 {
    background: var(--bg-darker);
}

body.single-kiranime_episode .lg\\:flex.gap-10>section {
    padding-top: 20px;
}

/* ========================================
   MOBILE LANDSCAPE OPTIMIZATION
   Reorganize layout - player full width on top,
   sidebars stacked below (scrollable)
   ======================================== */

/* Landscape on mobile devices */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Grid becomes single column - all elements stack vertically */
    .modern-episode-grid {
        display: flex !important;
        flex-direction: column !important;
        padding: 5px !important;
        gap: 10px !important;
    }

    /* Player section comes first and takes full width */
    .modern-player-section {
        width: 100% !important;
        order: 1 !important;
        flex-shrink: 0 !important;
    }

    /* Player wrapper - full width, proper aspect ratio */
    .modern-player-wrapper {
        width: 100% !important;
        height: calc(100vh - 10px) !important;
        aspect-ratio: unset !important;
        border-radius: 8px !important;
    }

    /* Make sure the player box fills the container */
    .episode-player-box {
        width: 100% !important;
        height: 100% !important;
    }

    /* Ensure iframe player fills the space */
    .episode-player-box iframe {
        width: 100% !important;
        height: 100% !important;
    }

    /* Left sidebar (episode list) - below player */
    .modern-sidebar {
        order: 2 !important;
        width: 100% !important;
    }

    /* Right sidebar (anime info) - below episode list */
    .modern-right-sidebar {
        order: 3 !important;
        width: 100% !important;
    }

    /* Compact the breadcrumbs */
    .modern-player-section .modern-glass:first-child {
        height: 24px !important;
        padding: 0 8px !important;
        margin-bottom: 5px !important;
    }

    .modern-player-section .modern-glass:first-child * {
        font-size: 0.6rem !important;
        line-height: 24px !important;
    }

    /* Compact controls bar */
    .modern-controls {
        padding: 4px 8px !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }

    /* Hide text labels in controls, show only icons */
    .modern-btn span:not(.material-icons-round) {
        display: none !important;
    }

    .modern-btn {
        padding: 4px 6px !important;
        min-width: 32px !important;
    }

    .modern-btn .material-icons-round {
        font-size: 16px !important;
    }

    /* Compact anime info */
    .compact-anime-info {
        padding: 6px 10px !important;
    }

    .compact-poster {
        width: 30px !important;
    }

    .compact-title {
        font-size: 0.8rem !important;
    }

    /* Episode list more compact */
    .modern-episode-list {
        max-height: 150px !important;
    }
}

/* Slightly larger landscape screens (tablets in landscape) */
@media screen and (max-width: 900px) and (min-height: 501px) and (orientation: landscape) {

    /* Grid becomes single column */
    .modern-episode-grid {
        grid-template-columns: 1fr !important;
        padding: 10px !important;
        gap: 10px !important;
    }

    /* Player section first */
    .modern-player-section {
        order: 1 !important;
        width: 100% !important;
    }

    /* Left sidebar below player */
    .modern-sidebar {
        order: 2 !important;
        width: 100% !important;
    }

    /* Right sidebar last */
    .modern-right-sidebar {
        order: 3 !important;
        width: 100% !important;
    }

    /* Player wrapper with good aspect ratio */
    .modern-player-wrapper {
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        max-height: 70vh !important;
    }

    /* Episode list horizontal scroll */
    .modern-episode-list {
        max-height: 200px !important;
    }

    /* Compact controls */
    .modern-controls {
        padding: 8px 12px !important;
    }

    .modern-btn span:not(.material-icons-round) {
        display: none !important;
    }
}