:root {
    --yt-red: #dd0b4dfb;
    --yt-white: #ffffff;
    --yt-black: #0f0f0f;
    --yt-translucent-black: rgba(0, 0, 0, 0.6);
    --yt-progress-bg: rgba(255, 255, 255, 0.2);
    --yt-buffer-bg: rgba(255, 255, 255, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--yt-black);
    color: var(--yt-white);
    font-family: "Plus Jakarta Sans", sans-serif;
    overflow: hidden;
    /* Prevent scrolling if full screen */
}

.video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Controls Visibility */
.video-container.hide-controls .video-controls,
.video-container.hide-controls .controls-overlay {
    opacity: 0;
    pointer-events: none;
}

.controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 15px 10px;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* Progress Bar */
.progress-container {
    height: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: height 0.1s ease;
}

.progress-container:hover {
    height: 8px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: var(--yt-progress-bg);
}

.progress-container:hover .progress-bar {
    height: 100%;
}

.buffer-bar {
    position: absolute;
    height: 100%;
    background: var(--yt-buffer-bg);
    width: 0;
}

.current-progress {
    position: absolute;
    height: 100%;
    background: var(--yt-red);
    width: 0;
}

.scrubber {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--yt-red);
    border-radius: 50%;
    left: 0;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.progress-container:hover .scrubber {
    opacity: 1;
}

/* Main Controls */
.controls-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.control-btn {
    background: none;
    border: none;
    color: var(--yt-white);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn svg {
    width: 24px;
    height: 24px;
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    accent-color: var(--yt-white);
}

.volume-container:hover .volume-slider {
    width: 60px;
    opacity: 1;
}

.time-display {
    font-size: 14px;
    margin-left: 5px;
    user-select: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Big Play / Loading */
.big-play-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
}

.big-play-btn svg {
    width: 40px;
    height: 40px;
    fill: var(--yt-white);
}

.loading-spinner {
    position: absolute;
    z-index: 20;
    display: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--yt-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Center Feedback Animation */
.center-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
}

.center-feedback.animate {
    animation: feedbackScale 0.5s ease-out forwards;
}

.center-feedback svg {
    width: 40px;
    height: 40px;
    fill: white;
}

@keyframes feedbackScale {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* Offline Message */
.offline-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    text-align: center;
    padding: 20px;
}

.offline-message.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.offline-message svg {
    width: 80px;
    height: 80px;
    color: #888;
    margin-bottom: 20px;
}

.offline-message h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--yt-white);
}

.offline-message p {
    font-size: 16px;
    color: #aaa;
    max-width: 500px;
    line-height: 1.5;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* LIVE Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-size: 11px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.live-indicator.active {
    color: var(--yt-white);
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #606060;
    transition: background 0.2s;
}

.live-indicator.active .live-dot {
    background: var(--yt-red);
}

/* Quality Settings Popup */
.quality-popup {
    position: absolute;
    bottom: 70px;
    right: 60px;
    background: rgba(28, 28, 28, 0.98);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.quality-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-header {
    padding: 8px 16px;
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.quality-options {
    display: flex;
    flex-direction: column;
}

.quality-option {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--yt-white);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quality-option.active {
    color: var(--yt-red);
}

.quality-option .checkmark {
    width: 16px;
    height: 16px;
    opacity: 0;
}

.quality-option.active .checkmark {
    opacity: 1;
}

/* Share Popup */
.share-popup {
    position: absolute;
    bottom: 70px;
    right: 100px;
    background: rgba(28, 28, 28, 0.98);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.share-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-header {
    padding: 8px 16px;
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
}

.share-options {
    display: flex;
    flex-direction: column;
}

.share-option {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--yt-white);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.share-option svg {
    width: 18px;
    height: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .volume-slider {
        display: none;
    }

    .time-display {
        font-size: 14px;
    }

    .control-btn svg {
        width: 20px;
        height: 20px;
    }

    .controls-left,
    .controls-right {
        gap: 10px;
    }
}