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

body {
    font-family: 'Inter', sans-serif;
    background-color: #0f171e; /* Prime Video Dark Background */
    color: #ffffff;
    overflow: hidden;
}

.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.video-container {
    position: relative;
    width: 100%;
    flex: 1;
    background-color: #000;
    background-image: url('https://i.imgur.com/8u2uazh.jpeg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.ad-banner-container {
    width: 100%;
    height: 50px;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the entire screen without black bars */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 15%, rgba(0,0,0,0) 80%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-container.show-controls .video-overlay {
    opacity: 1;
}

/* Controls Container */
.video-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.video-container.show-controls .video-controls {
    opacity: 1;
}

/* Common Button Styles */
button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.1s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.icon-btn:active {
    transform: scale(0.95);
}

.text-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Top Controls */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title-container {
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 20px;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.video-subtitle {
    font-size: 14px;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Center Controls */
.center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 24px;
    align-items: center;
}

.big-action-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.big-action-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.big-action-btn:active {
    transform: scale(1);
}

/* Skip Buttons */
.skip-btn {
    position: relative;
}

.skip-text {
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -30%);
}

/* Bottom Controls */
.bottom-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 8px;
}

/* Progress Bar */
.progress-wrapper {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.progress-bg, .progress-buffer, .progress-current {
    position: absolute;
    height: 4px;
    border-radius: 2px;
    transition: height 0.1s ease;
}

.progress-bg {
    width: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.progress-buffer {
    width: 0%;
    background: rgba(255, 255, 255, 0.5);
}

.progress-current {
    width: 0%;
    background: #00A8E1; /* Prime Video Blue */
    z-index: 2;
}

.progress-thumb {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    left: 0%;
    transform: translateX(-50%) scale(0);
    z-index: 3;
    transition: transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.progress-wrapper:hover .progress-bg,
.progress-wrapper:hover .progress-buffer,
.progress-wrapper:hover .progress-current {
    height: 6px;
}

.progress-wrapper:hover .progress-thumb {
    transform: translateX(-50%) scale(1);
}

.progress-hover-time {
    position: absolute;
    top: -30px;
    left: 0;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
}

.progress-wrapper:hover .progress-hover-time {
    opacity: 1;
}

/* Control Actions */
.control-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.time-display {
    font-size: 14px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    margin-left: 8px;
}

.next-ep-btn {
    margin-right: 8px;
}

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

.volume-slider-wrapper {
    position: relative;
    width: 0;
    height: 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: width 0.3s ease;
    opacity: 0;
}

.volume-container:hover .volume-slider-wrapper,
.volume-slider-wrapper:focus-within {
    width: 80px;
    opacity: 1;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-progress {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 4px;
    background: #fff;
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}

/* Loading Spinner */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.loading-spinner.active {
    opacity: 1;
}

.spinner {
    animation: spin 1.5s linear infinite;
}

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

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .video-controls {
        padding: 16px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .video-title {
        font-size: 16px;
    }

    .video-subtitle {
        font-size: 12px;
    }

    .big-action-btn {
        width: 60px;
        height: 60px;
    }

    .time-display {
        font-size: 12px;
        margin-left: 4px;
    }

    .volume-container {
        display: none; /* Hide volume on mobile, usually handled by hardware keys */
    }

    .skip-btn .skip-text {
        font-size: 8px;
    }

    .text-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .progress-wrapper {
        height: 32px; /* larger touch target */
    }

    .progress-thumb {
        width: 20px;
        height: 20px;
        transform: translateX(-50%) scale(1); /* always show thumb on mobile */
    }

    .left-actions, .right-actions {
        gap: 8px;
    }
}
