/**
 * DramaDiziİzle - Video Player CSS (Faz 4)
 */

/* =============================================
   WATCH PAGE LAYOUT
   ============================================= */
.watch-page {
    padding-top: 20px;
    padding-bottom: 0;
}

.watch-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =============================================
   PLAYER WRAPPER
   ============================================= */
.player-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.player-wrapper.no-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
}

/* Embed Player */
.embed-player {
    position: relative;
}

.player-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Custom Player */
.custom-player {
    cursor: pointer;
    user-select: none;
}

.player-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* =============================================
   BIG PLAY BUTTON
   ============================================= */
.player-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(124, 58, 237, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.player-big-play i {
    font-size: 2rem;
    color: #fff;
    margin-left: 4px;
}

.player-big-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(124, 58, 237, 1);
}

.player-big-play.hidden {
    display: none;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    display: none;
}

.player-loading.active {
    display: block;
}

.player-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: player-spin 0.8s linear infinite;
}

@keyframes player-spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   DOUBLE TAP OVERLAYS (Mobile)
   ============================================= */
.player-tap-left,
.player-tap-right {
    position: absolute;
    top: 0;
    width: 30%;
    height: 100%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.player-tap-left {
    left: 0;
}

.player-tap-right {
    right: 0;
}

.tap-indicator {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.tap-indicator.show {
    opacity: 1;
    transform: scale(1);
}

/* =============================================
   PLAYER CONTROLS
   ============================================= */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 40px 16px 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-player:hover .player-controls,
.custom-player.controls-visible .player-controls {
    opacity: 1;
}

.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.player-controls-left,
.player-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.player-progress-bar {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: height 0.15s ease;
}

.player-progress-bar:hover {
    height: 6px;
}

.player-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    pointer-events: none;
}

.player-progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    pointer-events: none;
}

.player-progress-handle {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
    z-index: 2;
    pointer-events: none;
}

.player-progress-bar:hover .player-progress-handle {
    transform: translate(-50%, -50%) scale(1);
}

.player-progress-tooltip {
    position: absolute;
    bottom: 18px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.player-progress-bar:hover .player-progress-tooltip {
    opacity: 1;
}

/* =============================================
   PLAYER BUTTONS
   ============================================= */
.player-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s ease;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.player-speed-label,
.player-quality-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.player-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
    white-space: nowrap;
}

/* =============================================
   VOLUME SLIDER
   ============================================= */
.player-volume {
    display: flex;
    align-items: center;
    gap: 0;
}

.player-volume-slider {
    width: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.2s ease;
}

.player-volume:hover .player-volume-slider {
    width: 80px;
}

.player-volume-level {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 100%;
    pointer-events: none;
}

/* =============================================
   PLAYER MENUS (Speed, Quality, Subtitle)
   ============================================= */
.player-menu-wrapper {
    position: relative;
}

.player-menu {
    position: absolute;
    bottom: 48px;
    right: 0;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 0;
    min-width: 160px;
    display: none;
    z-index: 20;
    backdrop-filter: blur(10px);
}

.player-menu.active {
    display: block;
}

.player-menu-title {
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.player-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-menu-item.active {
    color: var(--accent);
}

.player-menu-item.active::before {
    content: '✓ ';
}

/* =============================================
   WATCH INFO
   ============================================= */
.watch-info {
    padding: 20px 0;
}

.watch-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.watch-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.watch-episode-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    margin-left: 8px;
}

.watch-episode-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.watch-nav {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.watch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.watch-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.watch-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

/* =============================================
   SIDEBAR
   ============================================= */
.watch-sidebar {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
}

.watch-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
}

.watch-sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Öneri listesi */
.watch-recommend-list {
    overflow-y: auto;
    flex: 1;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
}

.watch-recommend-list::-webkit-scrollbar {
    width: 4px;
}

.watch-recommend-list::-webkit-scrollbar-track {
    background: transparent;
}

.watch-recommend-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.watch-rec-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.watch-rec-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.watch-rec-thumb {
    position: relative;
    flex: 0 0 68px;
    width: 68px;
    height: 92px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.watch-rec-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.watch-rec-item:hover .watch-rec-thumb img {
    transform: scale(1.06);
}

.watch-rec-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 1rem;
    color: #fff;
}

.watch-rec-item:hover .watch-rec-play {
    opacity: 1;
}

.watch-rec-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding-top: 2px;
}

.watch-rec-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.watch-rec-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.watch-season-select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
}

.watch-season-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.watch-episode-list {
    overflow-y: auto;
    flex: 1;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
}

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

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

.watch-episode-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* Episode Item */
.watch-episode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

.watch-episode-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.watch-episode-item.active {
    background: rgba(124, 58, 237, 0.1);
    border-left: 3px solid var(--accent);
}

.watch-ep-thumb {
    position: relative;
    width: 100px;
    min-width: 100px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.watch-ep-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.watch-ep-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.watch-ep-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

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

.watch-ep-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.watch-ep-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.watch-ep-views {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.watch-ep-playing {
    color: var(--accent);
    font-size: 0.9rem;
    flex-shrink: 0;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 1024px) {
    .watch-layout {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .watch-sidebar {
        position: static;
        max-height: none;
    }

    .watch-episode-list {
        max-height: 400px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .watch-page {
        padding-top: 0;
    }

    .watch-layout {
        padding: 0;
        gap: 0;
    }

    .player-wrapper {
        border-radius: 0;
    }

    .watch-info {
        padding: 16px;
    }

    .watch-info-header {
        flex-direction: column;
        gap: 12px;
    }

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

    .watch-episode-label {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }

    .watch-nav {
        width: 100%;
    }

    .watch-nav .btn {
        flex: 1;
        justify-content: center;
    }

    .watch-sidebar-header {
        border-radius: 0;
    }

    .watch-episode-list {
        border-radius: 0;
        max-height: 350px;
    }

    .watch-ep-thumb {
        width: 80px;
        min-width: 80px;
    }

    /* Player controls mobile adjustments */
    .player-volume-slider {
        display: none;
    }

    .player-time {
        font-size: 0.7rem;
    }

    .player-controls-row {
        gap: 2px;
    }

    .player-btn {
        padding: 6px;
        font-size: 0.9rem;
    }

    .player-big-play {
        width: 60px;
        height: 60px;
    }

    .player-big-play i {
        font-size: 1.5rem;
    }

    /* Double tap areas enabled on mobile */
    .player-tap-left,
    .player-tap-right {
        pointer-events: auto;
    }
}

@media (max-width: 480px) {
    .watch-meta {
        gap: 10px;
        font-size: 0.8rem;
    }

    .watch-ep-thumb {
        width: 70px;
        min-width: 70px;
    }

    .player-controls {
        padding: 30px 10px 8px;
    }

    #skipBackBtn,
    #skipForwardBtn {
        display: none;
    }
}

/* =============================================
   COMMENTS (Faz 6)
   ============================================= */
.watch-comments {
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.comments-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.comments-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 4px;
}

.comment-form {
    margin-bottom: 24px;
}

.comment-form-input textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.2s ease;
}

.comment-form-input textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.comment-login-prompt {
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.comment-login-prompt a {
    color: var(--accent);
    font-weight: 600;
}

/* Comment Item */
.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-avatar i {
    color: var(--text-muted);
    font-size: 1rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

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

.comment-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.comment-spoiler {
    filter: blur(5px);
    cursor: pointer;
    transition: filter 0.3s ease;
    user-select: none;
}

.comment-spoiler.revealed {
    filter: none;
}

.comment-spoiler-label {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 4px;
    cursor: pointer;
}

.comment-actions {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-actions button:hover {
    color: var(--accent);
}

/* Reply */
.comment-replies {
    margin-left: 46px;
    border-left: 2px solid var(--border-color);
    padding-left: 16px;
}

.comment-replies .comment-item {
    padding: 12px 0;
}

.comment-replies .comment-avatar {
    width: 28px;
    height: 28px;
}

/* Reply form */
.reply-form {
    margin: 8px 0 8px 46px;
    display: flex;
    gap: 8px;
}

.reply-form input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.85rem;
}

.reply-form input:focus {
    outline: none;
    border-color: var(--accent);
}
