/* Watch Page Specific Styles */
.watch-page {
    background: var(--bg-primary);
}

/* Episode Header */
.episode-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 2rem 0 1rem;
}

.episode-info h1.episode-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.episode-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
}

.episode-number {
    color: var(--primary-color);
    font-weight: 600;
}

.episode-divider {
    color: var(--text-muted);
    font-weight: 300;
}

.episode-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 255, 136, 0.1);
}

.action-btn:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.action-btn.active {
    background: var(--primary-color);
    color: var(--bg-primary);
}

/* Video Container */
.video-container {
    margin-bottom: 3rem;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 136, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    background: #000;
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    outline: none;
}

/* Custom Video Controls */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

.video-wrapper:hover .custom-controls,
.video-wrapper.show-controls .custom-controls {
    opacity: 1;
}

.progress-container {
    margin-bottom: 0.75rem;
}

.progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.progress-filled {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    left: 0%;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: grab;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 0.85rem;
    font-family: 'Rajdhani', sans-serif;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left,
.controls-right,
.controls-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-center {
    flex: 1;
    justify-content: center;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.control-btn i {
    font-size: 1rem;
}

.play-pause-btn {
    width: 50px;
    height: 50px;
}

.play-pause-btn i {
    font-size: 1.2rem;
}

.speed-btn span {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

.episode-title-small {
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Volume Control */
.volume-container {
    display: flex;
    align-items: center;
    position: relative;
}

.volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    margin-left: 0.5rem;
}

.volume-container:hover .volume-slider {
    width: 80px;
}

.volume-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

.volume-filled {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    width: 100%;
    transition: width 0.1s ease;
}

.volume-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    right: 0;
    cursor: grab;
}

/* Center Play Button */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 255, 136, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
}

.center-play-btn.show {
    opacity: 1;
    pointer-events: all;
}

.center-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

/* Settings Menu */
.settings-menu {
    position: absolute;
    bottom: 60px;
    right: 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    padding: 1rem;
    min-width: 200px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 25;
}

.settings-menu.show {
    opacity: 1;
    pointer-events: all;
}

.settings-section {
    margin-bottom: 1rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    color: var(--primary-color);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.speed-options,
.quality-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.speed-option,
.quality-option {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.speed-option:hover,
.quality-option:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: var(--primary-color);
}

.speed-option.active,
.quality-option.active {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

/* Video Overlay Updates */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--primary-color);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 136, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Episode Navigation */
.episode-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 15px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.episode-selector {
    flex: 1;
    max-width: 300px;
}

.episode-select {
    width: 100%;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 15px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2300ff88' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
}

.episode-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Episode Description */
.episode-description {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    border: 1px solid rgba(0, 255, 136, 0.1);
}

.description-header h3 {
    font-family: 'Orbitron', monospace;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.description-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* HTML Description Support */
.description-content span {
    color: var(--text-secondary);
    font-family: inherit;
}

.description-content p[style*="font-family"] {
    /* Override custom fonts with our consistent styling */
    font-family: 'Rajdhani', sans-serif !important;
}

.description-content p[dir="ltr"] {
    text-align: left;
}

.description-content strong,
.description-content b {
    color: var(--primary-color);
    font-weight: 600;
}

.description-content em,
.description-content i {
    font-style: italic;
    color: var(--text-primary);
}

.description-content div {
    margin-bottom: 0.5rem;
}

.description-content br {
    line-height: 1;
}

/* Special formatting for episode credits */
.description-content span[style*="font-size"] {
    font-size: 1rem !important; /* Normalize font sizes */
}

/* Clean up any formatting issues */
.description-content * {
    max-width: 100%;
    word-wrap: break-word;
}

/* Episode List Section */
.episode-list-section {
    margin-bottom: 3rem;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.list-header h3 {
    font-family: 'Orbitron', monospace;
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
}

.list-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

/* Episode Grid */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.episode-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 136, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.episode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
    border-color: var(--primary-color);
}

.episode-card.current {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.episode-thumbnail {
    position: relative;
    width: 100%;
    height: 169px; /* 16:9 aspect ratio for 300px width */
    background: #000;
    overflow: hidden;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background: linear-gradient(45deg, #0a0a0a, #1a1a1a);
}

.episode-thumbnail img[src="data:image/png;base64"] {
    /* Custom styling for canvas-generated thumbnails */
    object-fit: contain;
    background: transparent;
}

.episode-card:hover .episode-thumbnail img {
    transform: scale(1.05);
}

.episode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), rgba(0, 255, 136, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-card:hover .episode-overlay {
    opacity: 1;
}

.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 136, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 1.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.episode-card:hover .play-icon {
    transform: scale(1);
}

.episode-card-info {
    padding: 1.5rem;
}

.episode-card-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.episode-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Rajdhani', sans-serif;
}

.episode-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
}

.status-indicator.watched {
    background: var(--primary-color);
}

.status-indicator.unwatched {
    background: var(--text-muted);
}

/* Share Modal */
.share-modal {
    max-width: 600px;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.share-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 15px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.share-option:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.share-option i {
    font-size: 1.2rem;
}

.share-option span {
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Platform-specific colors on hover */
.share-option[data-platform="twitter"]:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.share-option[data-platform="facebook"]:hover {
    background: #4267b2;
    border-color: #4267b2;
}

.share-option[data-platform="discord"]:hover {
    background: #7289da;
    border-color: #7289da;
}

.share-option[data-platform="reddit"]:hover {
    background: #ff4500;
    border-color: #ff4500;
}

.share-option[data-platform="whatsapp"]:hover {
    background: #25d366;
    border-color: #25d366;
}

.share-option[data-platform="telegram"]:hover {
    background: #0088cc;
    border-color: #0088cc;
}

.share-option[data-platform="email"]:hover {
    background: #ea4335;
    border-color: #ea4335;
}

.share-link {
    display: flex;
    gap: 0.5rem;
}

.share-url {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
}

.copy-btn {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* Theater Mode */
.theater-mode .video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

.theater-mode .video-wrapper {
    padding-bottom: 0;
    height: 100vh;
}

.theater-mode .navbar {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

/* Debug Panel Styles */
#debug-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 350px;
    max-height: 500px;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    z-index: 10000;
    font-family: 'Rajdhani', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 200px;
    max-width: 90vw;
    cursor: move;
}

.debug-header {
    background: var(--primary-color);
    color: var(--bg-primary);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    cursor: move;
    user-select: none;
}

.debug-header h4 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-header h4::before {
    content: "🐛";
    font-size: 1rem;
}

.debug-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#debug-minimize {
    background: none;
    border: none;
    color: var(--bg-primary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background 0.3s ease;
}

#debug-minimize:hover {
    background: rgba(0, 0, 0, 0.2);
}

#debug-close {
    background: none;
    border: none;
    color: var(--bg-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

#debug-close:hover {
    background: rgba(255, 0, 0, 0.3);
}

.debug-content {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

#debug-panel.minimized .debug-content {
    max-height: 0;
    padding: 0 1rem;
    overflow: hidden;
}

.debug-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    background: rgba(0, 255, 136, 0.03);
}

.debug-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.debug-section h5 {
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-section h5::before {
    content: "▶";
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.debug-section.collapsed h5::before {
    transform: rotate(0deg);
}

.debug-section h5::before {
    transform: rotate(90deg);
}

.debug-section-content {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.debug-section.collapsed .debug-section-content {
    max-height: 0;
}

.debug-section div {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem;
    background: rgba(0, 255, 136, 0.05);
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(0, 255, 136, 0.1);
    margin-bottom: 0.5rem;
    word-break: break-all;
    line-height: 1.4;
}

.debug-section button {
    margin: 0.25rem 0.5rem 0.25rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.debug-section button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.3), transparent);
    transition: left 0.6s ease;
}

.debug-section button:hover::before {
    left: 100%;
}

.debug-section button:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 255, 136, 0.3);
}

.debug-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    cursor: se-resize;
    clip-path: polygon(100% 0%, 0% 100%, 100% 100%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.debug-resize-handle:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .episode-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .episode-actions {
        justify-content: flex-end;
    }

    .episode-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .episode-selector {
        max-width: none;
    }

    .list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .list-filters {
        justify-content: center;
    }

    .episode-grid {
        grid-template-columns: 1fr;
    }

    .share-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .share-option {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .share-option span {
        font-size: 0.8rem;
    }

    #debug-panel {
        left: 10px;
        top: 10px;
        width: calc(100vw - 20px);
        max-width: 350px;
    }

    .episode-info h1.episode-title {
        font-size: 1.5rem;
    }

    .episode-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Mobile Video Player Improvements */
    .custom-controls {
        padding: 0.5rem;
    }

    .controls-row {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .controls-left,
    .controls-right {
        flex: 1;
        min-width: fit-content;
    }

    .controls-center {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .control-btn {
        width: 35px;
        height: 35px;
        padding: 0.25rem;
    }

    .control-btn i {
        font-size: 0.9rem;
    }

    .play-pause-btn {
        width: 45px;
        height: 45px;
    }

    .play-pause-btn i {
        font-size: 1.1rem;
    }

    .episode-title-small {
        font-size: 0.8rem;
        text-align: center;
    }

    .progress-container {
        margin-bottom: 0.5rem;
    }

    .progress-bar {
        height: 6px;
        margin-bottom: 0.25rem;
    }

    .progress-handle {
        width: 16px;
        height: 16px;
    }

    .progress-time {
        font-size: 0.75rem;
    }

    .volume-container:hover .volume-slider {
        width: 60px;
    }

    .settings-menu {
        bottom: 50px;
        right: 5px;
        left: 5px;
        min-width: unset;
    }

    .speed-options,
    .quality-options {
        justify-content: center;
    }

    .center-play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Mobile Touch Improvements */
    .video-wrapper {
        -webkit-tap-highlight-color: transparent;
    }

    .custom-controls {
        opacity: 1; /* Always show on mobile */
    }

    .video-wrapper.show-controls .custom-controls {
        opacity: 1;
    }

    /* Larger touch targets for mobile */
    .progress-bar {
        padding: 8px 0;
        margin: -8px 0;
    }

    .volume-bar {
        padding: 8px 0;
        margin: -8px 0;
    }

    /* Hide some controls on very small screens */
    .pip-btn,
    .quality-btn {
        display: none;
    }
}

@media (max-width: 480px) {
    .episode-header {
        padding: 1rem 0 0.5rem;
    }

    .episode-description {
        padding: 1.5rem;
    }

    .description-header h3 {
        font-size: 1.3rem;
    }

    .list-header h3 {
        font-size: 1.5rem;
    }

    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    #debug-panel {
        left: 5px;
        top: 5px;
        width: calc(100vw - 10px);
        max-width: none;
        max-height: 70vh;
    }

    /* Very small mobile optimizations */
    .controls-left,
    .controls-right {
        gap: 0.25rem;
    }

    .control-btn {
        width: 32px;
        height: 32px;
    }

    .play-pause-btn {
        width: 40px;
        height: 40px;
    }

    .episode-title-small {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hide additional controls on very small screens */
    .subtitles-btn,
    .speed-btn {
        display: none;
    }

    .controls-right {
        justify-content: flex-end;
    }

    .settings-menu {
        bottom: 45px;
    }

    .center-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .custom-controls {
        padding: 0.25rem 0.5rem;
    }

    .controls-center {
        order: unset;
        width: auto;
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        flex: 1;
    }

    .controls-row {
        flex-wrap: nowrap;
    }

    .episode-title-small {
        font-size: 0.7rem;
    }

    .progress-container {
        margin-bottom: 0.25rem;
    }

    /* Show more controls in landscape */
    .pip-btn,
    .quality-btn,
    .subtitles-btn,
    .speed-btn {
        display: flex;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .progress-bar,
    .volume-bar {
        height: 5px;
    }

    .progress-handle,
    .volume-handle {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .episode-header {
        padding: 1rem 0 0.5rem;
    }

    .episode-description {
        padding: 1.5rem;
    }

    .description-header h3 {
        font-size: 1.3rem;
    }

    .list-header h3 {
        font-size: 1.5rem;
    }

    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    #debug-panel {
        left: 10px;
        top: 10px;
        width: calc(100vw - 20px);
        max-width: 350px;
    }
}

/* CORS Notice Styles */
.cors-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: corsNoticeSlideIn 0.3s ease-out;
}

@keyframes corsNoticeSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.cors-notice-content {
    padding: 2rem;
    text-align: center;
}

.cors-notice h4 {
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cors-notice p {
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

.cors-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.cors-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cors-btn.primary {
    background: var(--primary-color);
    color: var(--bg-primary);
}

.cors-btn.primary:hover {
    background: #00e077;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.cors-btn.secondary {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.cors-btn.secondary:hover {
    background: rgba(0, 255, 136, 0.1);
    color: var(--text-primary);
}

.cors-notice small {
    color: var(--text-muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
}

/* CORS Notice Mobile Responsiveness */
@media (max-width: 480px) {
    .cors-notice .cors-actions {
        flex-direction: column;
    }
    
    .cors-notice .cors-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cors-notice .cors-notice-content {
        padding: 1.5rem;
    }
}

/* Project Completion Status Styles */
.completion-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.completion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    color: white;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.completion-badge i {
    color: #ffd700;
    font-size: 1.2rem;
}

.series-complete {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.all-episodes-badge {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Enhanced Status Indicators */
.status-indicator.complete {
    background: var(--primary-color);
    color: var(--bg-primary);
}

.status-indicator.available {
    background: rgba(0, 255, 136, 0.2);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Source Switch Button Styling */
.action-btn.source-btn {
    background: rgba(255, 165, 0, 0.1);
    border: 2px solid #ffa500;
    color: #ffa500;
}

.action-btn.source-btn:hover {
    background: #ffa500;
    color: white;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.4);
}

/* HTML5 Video Player Styling */
.video-player {
    width: 100%;
    height: 100%;
    background: #000;
    outline: none;
}

.video-player::-webkit-media-controls {
    background: transparent !important;
}

.video-player::-webkit-media-controls-panel {
    background: transparent !important;
}

.video-player::-webkit-media-controls-play-button {
    background-color: var(--primary-color);
    border-radius: 50%;
}

.video-player::-webkit-media-controls-current-time-display,
.video-player::-webkit-media-controls-time-remaining-display {
    color: var(--primary-color);
    text-shadow: none;
}

.video-player::-webkit-media-controls-timeline {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 10px;
}

.video-player::-webkit-media-controls-timeline::-webkit-slider-thumb {
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.video-player::-webkit-media-controls-volume-slider {
    background: rgba(255, 255, 255, 0.2);
}

.video-player::-webkit-media-controls-volume-slider::-webkit-slider-thumb {
    background: var(--primary-color);
    border-radius: 50%;
}

/* Loading Spinner for Video */
#loadingSpinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
    z-index: 10;
}

#loadingSpinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Video Subtitles Styling */
.video-player::cue {
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 1.4;
    padding: 0.2em 0.4em;
    border-radius: 2px;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
    backdrop-filter: blur(8px);
    font-family: 'Rajdhani', sans-serif;
}

.notification.show {
    transform: translateX(0);
}

.notification-info {
    background: rgba(59, 130, 246, 0.9);
}

.notification-success {
    background: rgba(16, 185, 129, 0.9);
}

.notification-error {
    background: rgba(239, 68, 68, 0.9);
}

.notification-warning {
    background: rgba(245, 158, 11, 0.9);
}

/* Keyboard Shortcuts Modal */
.shortcuts-modal .shortcuts-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.shortcuts-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.shortcuts-header button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.shortcuts-header button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.shortcuts-body {
    padding: 1.5rem;
}

.shortcuts-category {
    margin-bottom: 2rem;
}

.shortcuts-category:last-child {
    margin-bottom: 0;
}

.shortcuts-category h4 {
    color: var(--primary-color);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    min-width: 80px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    text-align: right;
    margin-left: 1rem;
}

/* Mobile Landscape Mode */
body.landscape-mode {
    overflow: hidden;
}

body.landscape-mode .video-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #000;
}

body.landscape-mode .video-container video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

body.landscape-mode .video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Additional Mobile Enhancements */
@media (max-width: 768px) {
    .shortcuts-modal .shortcuts-content {
        max-width: 90vw;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .shortcuts-header,
    .shortcuts-body {
        padding: 1rem;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .shortcut-item span {
        text-align: left;
        margin-left: 0;
    }
    
    #debug-panel {
        width: 90vw !important;
        max-width: none !important;
        left: 5vw !important;
        font-size: 0.85rem;
    }
    
    .debug-header h4 {
        font-size: 1rem;
    }
    
    .debug-controls button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .debug-section-content {
        font-size: 0.8rem;
    }
    
    .debug-section button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        margin: 0.2rem;
    }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
    .control-button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .progress-bar {
        height: 8px;
        cursor: pointer;
        position: relative;
    }
    
    .progress-bar::before {
        content: '';
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: 0;
        right: 0;
    }
    
    .volume-slider {
        height: 6px;
        position: relative;
    }
    
    .volume-slider::before {
        content: '';
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: 0;
        right: 0;
    }
}