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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-player-container {
    width: 100%;
    max-width: 900px;
    background: #141414;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    background: #000;
    overflow: hidden;
}

.video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-container:hover .video-overlay {
    opacity: 1;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(99, 102, 241, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.video-container.paused .play-button-overlay {
    opacity: 1;
    pointer-events: auto;
}

.play-button-overlay:hover {
    background: rgba(99, 102, 241, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    width: 0;
    height: 0;
    border-left: 24px solid #ffffff;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    margin-left: 4px;
}

.controls {
    background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 10, 0.9) 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 1.5rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.video-container:hover .controls,
.controls.show {
    transform: translateY(0);
}

.progress-container {
    margin-bottom: 1rem;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

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

.progress-filled {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #ec4899 100%);
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
}

.progress-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-bar:hover .progress-thumb {
    opacity: 1;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-button {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #6366f1;
}

.control-button:active {
    transform: scale(0.95);
}

.time-display {
    font-size: 0.9rem;
    color: #ffffff;
    min-width: 100px;
    text-align: center;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    position: relative;
    transform: translateX(-100px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.volume-container:hover .volume-slider,
.volume-slider.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.volume-filled {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #ec4899 100%);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.dropdown {
    position: relative;
}

.dropdown-button {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.dropdown-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.85rem;
}

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

.dropdown-item.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.spacer {
    flex: 1;
}

/* Fullscreen styles */
.media-player-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    z-index: 9999;
}

.media-player-container.fullscreen .video-container {
    padding-bottom: 0;
    height: 100%;
}

/* Icons */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-play {
    width: 0;
    height: 0;
    border-left: 16px solid currentColor;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-radius: 2px;
    margin-left: 2px;
}

.icon-pause {
    width: 16px;
    height: 16px;
    background: currentColor;
    position: relative;
}

.icon-pause::before,
.icon-pause::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 16px;
    background: #141414;
    top: 0;
}

.icon-pause::before {
    left: 2px;
}

.icon-pause::after {
    right: 2px;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container.loading .loading-spinner {
    opacity: 1;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .controls {
        padding: 1rem;
    }

    .controls-row {
        gap: 0.5rem;
    }

    .control-button {
        width: 36px;
        height: 36px;
    }

    .volume-slider {
        width: 60px;
    }
}