/**
 * Chironex Custom Video Player CSS
 * Modern, Ultra Akıcı, Duyarlı Video Oynatıcı Tasarımı
 */

:root {
    --player-accent: #6366f1;
    --player-bg: rgba(15, 23, 42, 0.92);
    --player-text: #ffffff;
}

/* Oynatıcı Ana Kapsayıcısı */
.cx-player-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    background-color: #000000;
    border-radius: 1rem;
    overflow: hidden;
    user-select: none;
    outline: none;
    font-family: inherit;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    aspect-ratio: 16 / 9;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cx-player-container video {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #000000;
}

/* Şeffaf Tıklama Katmanı */
.cx-click-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: pointer;
    background: transparent;
}

/* Yükleniyor / Ara Bellek Spinner'ı */
.cx-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--player-accent);
    border-radius: 50%;
    animation: cx-spin 0.8s linear infinite;
    z-index: 12;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cx-player-container.is-buffering .cx-loading-spinner {
    opacity: 1;
}

@keyframes cx-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ortadaki Büyük Oynat Butonu */
.cx-big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--player-accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    border: none;
}

.cx-big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.12);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.85);
}

.cx-player-container.is-playing .cx-big-play-btn {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.7);
}

.cx-player-container.is-buffering .cx-big-play-btn {
    opacity: 0;
    pointer-events: none;
}

/* Marka Logosu (Player Watermark) */
.cx-player-branding {
    position: absolute;
    z-index: 15;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}
.cx-player-branding img {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.cx-player-branding.pos-top-right { top: 16px; right: 16px; }
.cx-player-branding.pos-top-left { top: 16px; left: 16px; }
.cx-player-branding.pos-bottom-right { bottom: 64px; right: 16px; }
.cx-player-branding.pos-bottom-left { bottom: 64px; left: 16px; }

/* Alt Kontrol Çubuğu */
.cx-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px 12px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.cx-player-container.is-playing.is-idle .cx-player-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

/* İlerleme Çubuğu (Seekbar) */
.cx-progress-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.cx-progress-container:hover {
    height: 10px;
}

.cx-progress-loaded {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    width: 0%;
}

.cx-progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--player-accent);
    border-radius: 999px;
    width: 0%;
    box-shadow: 0 0 10px var(--player-accent);
}

.cx-progress-thumb {
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    transition: transform 0.15s ease;
}

.cx-progress-container:hover .cx-progress-thumb {
    transform: translateY(-50%) scale(1);
}

/* İlerleme Süre İpucu (Tooltip) */
.cx-progress-tooltip {
    position: absolute;
    bottom: 14px;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.cx-progress-container:hover .cx-progress-tooltip {
    opacity: 1;
}

/* Kontrol Butonları Satırı */
.cx-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--player-text);
}

.cx-controls-left, .cx-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cx-btn {
    background: transparent;
    border: none;
    color: var(--player-text);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.cx-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--player-accent);
}

/* Ses Grubu */
.cx-volume-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cx-volume-slider {
    width: 0px;
    opacity: 0;
    overflow: hidden;
    height: 4px;
    accent-color: var(--player-accent);
    cursor: pointer;
    transition: width 0.25s ease, opacity 0.25s ease;
}

.cx-volume-group:hover .cx-volume-slider,
.cx-volume-slider:focus {
    width: 60px;
    opacity: 1;
}

/* Zaman Sayacı */
.cx-time-display {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

/* Oynatma Hızı Menüsü */
.cx-speed-menu-wrapper {
    position: relative;
}

.cx-speed-menu {
    position: absolute;
    bottom: 42px;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 90px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    z-index: 30;
}

.cx-speed-menu.is-open {
    display: flex;
}

.cx-speed-item {
    background: transparent;
    border: none;
    padding: 6px 14px;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cx-speed-item:hover, .cx-speed-item.active {
    background: rgba(99, 102, 241, 0.25);
    color: var(--player-accent);
}

/* Çift Tıklama İleri/Geri Efekti */
.cx-seek-ripple {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 25;
}
.cx-seek-ripple.ripple-left { left: 15%; }
.cx-seek-ripple.ripple-right { right: 15%; }
.cx-seek-ripple.show {
    opacity: 1;
    transform: translateY(-50%) scale(1.08);
}

/* Hata Mesajı Kutusu */
.cx-player-error {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    padding: 20px;
    z-index: 30;
    gap: 10px;
}
.cx-player-error i {
    font-size: 32px;
    color: #f43f5e;
}
.cx-player-error h5 {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}
.cx-player-error p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    max-width: 320px;
}
.cx-player-error a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #4f46e5;
    color: #ffffff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 6px;
}

/* Tam Ekran Modu */
.cx-player-container:fullscreen {
    border-radius: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    aspect-ratio: auto !important;
}
.cx-player-container:fullscreen video {
    width: 100vw;
    height: 100vh;
}
