/**
 * Episode Frontend Styles
 *
 * Styles for single episode page
 *
 * @package AnimeHub
 */

/* ==========================================================================
   Player Section
   ========================================================================== */

/* Support both prefixed and non-prefixed class names */
.episode-player-section,
.animehub-episode-player-section {
    max-width: var(--animehub-container, 1400px);
    margin: 0 auto 20px;
    padding: 0 var(--animehub-gap, 24px);
    width: 100%;
}

.episode-player-container,
.animehub-player-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.episode-player-wrapper,
.animehub-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

.episode-player-wrapper video,
.episode-player-wrapper iframe,
.animehub-player-wrapper video,
.animehub-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Player container inner */
.animehub-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.animehub-player video,
.animehub-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Player Controls
   ========================================================================== */

.episode-controls,
.animehub-episode-controls {
    background: #232323;
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    border-top: 1px solid #3a3a3a;
    border-bottom: 1px solid #3a3a3a;
}

.episode-control-item,
.control-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-inline label {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

.episode-control-label {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

/* Server Switcher */
.episode-server-switcher,
.animehub-server-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.server-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.episode-server-btn,
.server-btn {
    padding: 6px 14px;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.episode-server-btn:hover,
.server-btn:hover {
    background: #3a3a3a;
    border-color: #ff6b35;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.episode-server-btn.active,
.server-btn.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.5);
}

.episode-server-btn small,
.server-btn small {
    display: inline;
    font-size: 10px;
    opacity: 0.8;
    margin-left: 4px;
}

/* Version Selector */
.episode-version-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.episode-version-btn {
    padding: 5px 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.episode-version-btn:hover {
    background: #3a3a3a;
}

.episode-version-btn.active {
    background: #4a9eff;
    border-color: #4a9eff;
    color: #fff;
}

.episode-version-btn--pv { background: #9b59b6; border-color: #9b59b6; color: #fff; }
.episode-version-btn--raw { background: #e74c3c; border-color: #e74c3c; color: #fff; }
.episode-version-btn--en { background: #3498db; border-color: #3498db; color: #fff; }
.episode-version-btn--vi { background: #27ae60; border-color: #27ae60; color: #fff; }
.episode-version-btn--es { background: #e67e22; border-color: #e67e22; color: #fff; }

/* Episode Selector */
.episode-selector-dropdown,
.episode-dropdown {
    padding: 6px 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
    min-width: 150px;
}

.episode-selector-dropdown:hover,
.episode-dropdown:hover {
    border-color: #ff6b35;
}

/* Episode Navigation */
.episode-nav-controls,
.episode-navigation-controls {
    display: flex;
    gap: 10px;
}

.episode-quick-nav {
    display: flex;
    gap: 10px;
}

.episode-nav-btn,
.quick-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 20px;
    transition: all 0.2s;
}

.episode-nav-btn:hover:not(.disabled),
.quick-nav-btn:hover:not(.disabled) {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
}

.episode-nav-btn.disabled,
.quick-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    display: block;
    line-height: 1;
}

/* Enhanced Controls */
.episode-enhanced-controls,
.player-enhanced-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.animehub-player-controls-enhanced {
    display: flex;
    gap: 8px;
    align-items: center;
}

.episode-control-btn,
.player-control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.episode-control-btn:hover,
.player-control-btn:hover {
    background: #ff6b35;
    border-color: #ff6b35;
    color: #fff;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
}

.control-icon {
    display: block;
    line-height: 1;
}

/* Player Overlays */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    z-index: 10;
}

.player-loading {
    gap: 15px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.player-error {
    gap: 15px;
}

.error-icon {
    font-size: 48px;
    line-height: 1;
}

.error-message {
    font-size: 16px;
    color: #fff;
}

.error-retry-btn {
    padding: 10px 20px;
    background: #ff6b35;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.error-retry-btn:hover {
    background: #e55a2b;
}

/* Quality and Speed Controls */
.player-quality-control,
.player-speed-control {
    position: relative;
}

.quality-dropdown,
.speed-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 120px;
    display: none;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.quality-dropdown.active,
.speed-dropdown.active {
    display: flex;
}

.quality-dropdown button,
.speed-dropdown button {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.quality-dropdown button:hover,
.speed-dropdown button:hover {
    background: #2a2a2a;
}

.quality-dropdown button.active,
.speed-dropdown button.active {
    background: #ff6b35;
    color: #fff;
}

.quality-label,
.speed-label {
    display: block;
    font-size: 13px;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

/* Page Layout Wrapper */
.animehub-page-with-sidebar {
    max-width: var(--animehub-container, 1400px);
    margin: 0 auto;
    padding: 0 var(--animehub-gap, 24px);
    width: 100%;
    box-sizing: border-box;
}

.animehub-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.animehub-main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.episode-page-content,
.animehub-episode-page .animehub-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

/* Episode Header */
.episode-header,
.entry-header.episode-header {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 20px;
}

.episode-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.episode-title-content {
    flex: 1;
}

.episode-title-content .entry-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.episode-subtitle-badge {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
}

/* Hardcoded badge colors removed - now using dynamic CSS from subtitle-settings.php */
/* 
.episode-subtitle-badge--pv { background: #9b59b6; }
.episode-subtitle-badge--raw { background: #e74c3c; }
.episode-subtitle-badge--en { background: #3498db; }
.episode-subtitle-badge--vi { background: #27ae60; }
.episode-subtitle-badge--es { background: #e67e22; }
.episode-subtitle-badge--id { background: #f39c12; }
.episode-subtitle-badge--pt { background: #1abc9c; }
.episode-subtitle-badge--ar { background: #34495e; }
*/

.episode-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

/* Episode Content */
.entry-content.episode-content {
    background: transparent;
}

/* Episode Info Section */
.episode-info-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.episode-content-top {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.episode-poster-section {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.episode-poster-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
    display: block;
}

.episode-poster-placeholder {
    width: 100%;
    padding-top: 140%; /* 5:7 aspect ratio */
    background: #2a2a2a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.episode-poster-placeholder span {
    position: absolute;
}

.episode-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.episode-share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border-radius: 50%;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
}

.episode-share-btn:hover {
    background: #ff6b35;
    color: #fff;
}

/* Share Below Poster */
.episode-share-below-poster {
    margin-top: 15px;
}

.animehub-social-share {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border-radius: 50%;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #ff6b35;
    color: #fff;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Episode Info List */
.episode-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.episode-info-label {
    font-size: 13px;
    color: #999;
    min-width: 100px;
    flex-shrink: 0;
}

.episode-info-value {
    font-size: 15px;
    color: #fff;
    flex: 1;
}

.episode-info-value a {
    color: #ff6b35;
    text-decoration: none;
}

.episode-info-value a:hover {
    text-decoration: underline;
}

.episode-main-title {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a2a2a;
}

.episode-title-primary {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.episode-title-native {
    font-size: 14px;
    color: #999;
}

.episode-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.episode-tag {
    padding: 4px 10px;
    background: #2a2a2a;
    border-radius: 4px;
    font-size: 12px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s;
}

.episode-tag:hover {
    background: #ff6b35;
    color: #fff;
}

.episode-tag--filler {
    background: #e74c3c;
    color: #fff;
}

.episode-tag--recap {
    background: #9b59b6;
    color: #fff;
}

/* Description Section */
.episode-description-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.episode-section-title,
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    display: inline-block;
    border-bottom: 2px solid #ff6b35;
}

.episode-description-content {
    font-size: 15px;
    line-height: 1.8;
    color: #ccc;
}

/* Screenshots Section */
.episode-screenshots-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.episode-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.episode-screenshot-item,
.screenshot-item {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
    text-decoration: none;
}

.episode-screenshot-item:hover,
.screenshot-item:hover {
    transform: scale(1.05);
}

.episode-screenshot-item img,
.screenshot-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Related Episodes */
.episode-related-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.episode-related-grid,
.related-episodes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.episode-related-card,
.related-episode-card {
    display: flex;
    gap: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.episode-related-card:hover,
.related-episode-card:hover {
    border-color: #ff6b35;
    transform: translateY(-3px);
}

.episode-related-thumb,
.episode-card-thumb {
    position: relative;
    width: 100px;
    min-width: 100px;
    height: 140px;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
}

.episode-related-thumb img,
.episode-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-related-badge,
.episode-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.episode-related-info,
.episode-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.episode-nav-label,
.nav-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.episode-related-title,
.episode-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.no-thumb {
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

/* Related Series - Now using cards-grid--anime from base.css */
/* Legacy styles kept for backward compatibility if needed */
.related-section {
    margin-bottom: 30px;
}

/* Ensure anime card badges are visible in episode page related section */
.related-section .anime-card__meta {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.related-section .anime-card__badge {
    display: inline-flex !important;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    white-space: nowrap;
}

.related-section .anime-card__status-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.related-section .anime-card__status-badge--airing,
.related-section .anime-card__status-badge--ongoing,
.related-section .anime-card__status-badge--releasing {
    background: rgba(0, 200, 83, 0.2) !important;
    color: #00c853 !important;
    border: 1px solid rgba(0, 200, 83, 0.3) !important;
}

.related-section .anime-card__status-badge--completed,
.related-section .anime-card__status-badge--finished,
.related-section .anime-card__status-badge--finished-2 {
    background: rgba(52, 152, 219, 0.2) !important;
    color: #3498db !important;
    border: 1px solid rgba(52, 152, 219, 0.3) !important;
}

.related-section .anime-card__status-badge--upcoming,
.related-section .anime-card__status-badge--not-yet-aired {
    background: rgba(155, 89, 182, 0.2) !important;
    color: #9b59b6 !important;
    border: 1px solid rgba(155, 89, 182, 0.3) !important;
}

.related-section .anime-card__type-badge {
    background: rgba(255, 107, 53, 0.15) !important;
    color: var(--animehub-primary) !important;
    border: 1px solid rgba(255, 107, 53, 0.3) !important;
}

.related-section .anime-card__link .anime-card__badge {
    color: inherit !important;
    text-decoration: none !important;
}

/* Comments Section */
.episode-comments-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

/* Episode Info Title */
.episode-info-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 5px 0;
}

.episode-native-title {
    font-size: 14px;
    color: #999;
    display: block;
    margin-top: 5px;
}

/* Badge */
.animehub-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    display: inline-block;
}

/* Keyboard Shortcuts Modal */
.animehub-shortcuts-modal,
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.animehub-shortcuts-modal[style*="display: block"],
.shortcuts-modal.active {
    display: flex;
}

.shortcuts-modal-content,
.shortcuts-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.shortcuts-modal-content h3,
.shortcuts-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #ff6b35;
}

.shortcuts-modal-close,
.shortcuts-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.shortcuts-modal-close:hover,
.shortcuts-close:hover {
    background: #ff6b35;
    color: #fff;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    display: inline-block;
    padding: 4px 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    font-family: 'SF Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #ff6b35;
    min-width: 50px;
    text-align: center;
}

.shortcut-item span {
    font-size: 14px;
    color: #ccc;
    flex: 1;
    margin-left: 15px;
}

/* Sidebar */
.episode-sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.episode-sidebar-widget {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.episode-widget-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b35;
}

/* Widget Anime Item */
.episode-widget-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}

.episode-widget-item:last-child {
    border-bottom: none;
}

.episode-widget-thumb {
    width: 60px;
    min-width: 60px;
    height: 84px;
    border-radius: 6px;
    overflow: hidden;
    background: #2a2a2a;
}

.episode-widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-widget-info {
    flex: 1;
}

.episode-widget-title-link {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-widget-title-link a {
    color: #fff;
    text-decoration: none;
}

.episode-widget-title-link a:hover {
    color: #ff6b35;
}

.episode-widget-meta {
    font-size: 12px;
    color: #999;
}

/* Ad Placeholders */
.episode-ad-placeholder {
    background: #1a1a1a;
    padding: 15px 0;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
}

.episode-ad-content {
    background: #2a2a2a;
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* ==========================================================================
   Episode Card (for archive/list views)
   ========================================================================== */

.episode-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
}

.episode-card__poster {
    position: relative;
    aspect-ratio: 5 / 7;
    overflow: hidden;
    background: #2a2a2a;
}

.episode-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.episode-card:hover .episode-card__image {
    transform: scale(1.08);
}

.episode-card__version {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    z-index: 2;
}

.episode-card__views {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.episode-card__views svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Hover Overlay */
.episode-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.episode-card:hover .episode-card__overlay {
    opacity: 1;
}

.episode-card__play {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff6b35;
    border-radius: 50%;
    color: #fff;
    transform: scale(0.8);
    transition: transform 0.2s ease;
}

.episode-card:hover .episode-card__play {
    transform: scale(1);
}

.episode-card__info {
    padding: 12px;
}

.episode-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.episode-card__anime {
    font-size: 12px;
    color: #999;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1200px) {
    .episode-page-content,
    .animehub-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .episode-sidebar {
        display: none;
    }
}

@media (max-width: 1024px) {
    .animehub-page-with-sidebar {
        padding: 0 var(--animehub-gap, 16px);
        width: 100%;
    }
    
    .animehub-content-wrapper,
    .episode-page-content,
    .animehub-episode-page .animehub-content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
    }
    
    .animehub-sidebar,
    .episode-sidebar {
        display: none;
    }
    
    .episode-controls,
    .animehub-episode-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .episode-enhanced-controls,
    .player-enhanced-controls {
        margin-left: 0;
        justify-content: center;
    }
    
    .episode-content-top {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .episode-poster-section {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        width: 100%;
    }
    
    .episode-poster-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .episode-share-buttons {
        align-self: center;
    }
    
    .episode-header {
        padding: 20px;
    }
    
    .episode-page-title {
        font-size: 24px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

@media (max-width: 768px) {
    .animehub-page-with-sidebar {
        padding: 0 var(--animehub-gap, 16px);
        width: 100%;
    }
    
    .animehub-content-wrapper,
    .episode-page-content,
    .animehub-episode-page .animehub-content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
    }
    
    .animehub-episode-player-section,
    .episode-player-section {
        padding: 0 var(--animehub-gap, 16px);
        width: 100%;
    }
    
    .episode-controls,
    .animehub-episode-controls {
        padding: 12px 15px;
        gap: 12px;
    }
    
    .episode-control-item,
    .control-item {
        width: 100%;
    }
    
    .episode-server-switcher,
    .animehub-server-switcher {
        width: 100%;
    }
    
    .episode-server-btn,
    .server-btn {
        flex: 1;
        min-width: 80px;
        min-height: 44px;
    }
    
    .episode-selector-dropdown,
    .episode-dropdown {
        width: 100%;
    }
    
    .episode-header {
        padding: 20px;
    }
    
    .episode-content-top {
        padding: 20px;
        gap: 20px;
    }
    
    .episode-poster-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .episode-poster-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .episode-page-title {
        font-size: 20px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .episode-title-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .episode-info-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .episode-info-label {
        min-width: auto;
    }
    
    .episode-related-grid {
        grid-template-columns: 1fr;
    }
    
    .episode-screenshots-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .animehub-page-with-sidebar {
        padding: 0 15px;
        width: 100%;
    }
    
    .animehub-episode-player-section,
    .episode-player-section {
        padding: 0 15px;
        width: 100%;
    }
    
    .animehub-player-container,
    .episode-player-container {
        border-radius: 8px;
    }
    
    .episode-controls,
    .animehub-episode-controls {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .episode-header {
        padding: 15px;
        border-radius: 8px;
    }
    
    .episode-page-title {
        font-size: 18px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .episode-content-top {
        padding: 15px;
        gap: 15px;
        border-radius: 8px;
    }
    
    .episode-poster-section {
        gap: 15px;
    }
    
    .episode-poster-image {
        max-width: 180px;
    }
    
    .episode-info-section,
    .episode-description-section,
    .episode-screenshots-section,
    .episode-related-section {
        padding: 15px;
        border-radius: 8px;
    }
    
    .episode-title-primary {
        font-size: 16px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .episode-title-wrapper {
        gap: 10px;
    }
    
    .episode-info-item {
        gap: 6px;
    }
    
    .episode-screenshots-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .episode-related-grid {
        gap: 15px;
    }
}
