/* Elegant Flower-Themed Frosted Glass Styling */

:root {
    --bg-base: #fdfafc;
    --bg-surface-glass: rgba(255, 245, 250, 0.55);
    --bg-controls-glass: rgba(255, 252, 254, 0.85);
    --border-glass: rgba(230, 200, 222, 0.45);
    
    /* Floral/Pastel Color Palette */
    --color-plum: #3e2d4f;
    --color-rose: #d6557e;
    --color-rose-glow: rgba(214, 85, 126, 0.25);
    --color-lavender: #8a57a3;
    --color-lavender-glow: rgba(138, 87, 163, 0.25);
    --color-text: #2f213d;
    --color-text-muted: #857594;
    
    /* Fonts */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-snappy: all 0.15s ease;
}

/* ==========================================
   Reset and Body Background Setup
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    background-image: url('flower_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--color-text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Translucent overlay to soften the flower background illustration */
.flower-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: rgba(255, 250, 252, 0.62);
    backdrop-filter: blur(1px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(214, 85, 126, 0.25);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-rose);
}

/* ==========================================
   Layout Containers
   ========================================== */
.player-wrapper {
    width: 100%;
    max-width: 820px;
    margin: auto;
    padding: 35px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* Minimal Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.logo-icon {
    font-size: 1.3rem;
    animation: rotateFlower 12s linear infinite;
    display: inline-block;
}

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

.logo-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--color-plum);
}

.logo-text span {
    background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================
   Frosted Video Player Frame
   ========================================== */
.video-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #090610;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
    box-shadow: 0 20px 50px rgba(62, 45, 79, 0.1), 
                0 0 20px rgba(214, 85, 126, 0.05);
    transition: var(--transition-smooth);
    user-select: none;
}

.video-player-container:hover {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 60px rgba(62, 45, 79, 0.15);
}

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

.video-player-container.fullscreen {
    border-radius: 0;
    border: none;
}

.hidden {
    display: none !important;
}

/* ==========================================
   Overlays (Loader, Buffering, Large Play)
   ========================================== */
/* Loader Overlay */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(253, 250, 252, 0.88);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.flower-spinner {
    position: relative;
    width: 50px;
    height: 50px;
}

.petal-one, .petal-two {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--color-rose);
    border-bottom-color: var(--color-lavender);
    border-radius: 50%;
    animation: spinPetal 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 4px var(--color-rose-glow));
}

.petal-two {
    animation-duration: 1.5s;
    animation-direction: reverse;
    border-top-color: transparent;
    border-left-color: rgba(214, 85, 126, 0.3);
}

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

.loader-text {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-plum);
}

/* Buffering dots */
.buffering-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-glass);
    z-index: 8;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(62, 45, 79, 0.05);
}

.buffering-dots {
    display: flex;
    gap: 6px;
}

.buffering-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-rose);
    animation: buffHop 0.6s infinite alternate;
}

.buffering-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--color-lavender); }
.buffering-dots span:nth-child(3) { animation-delay: 0.3s; opacity: 0.7; }

@keyframes buffHop {
    to { transform: translateY(-6px); }
}

/* Large Centered Play Button */
.large-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.large-play-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border: 1.5px solid var(--color-rose);
    color: var(--color-rose);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 25px rgba(214, 85, 126, 0.12);
}

.video-player-container:hover .large-play-btn,
.video-player-container.paused .large-play-btn {
    opacity: 1;
    transform: scale(1);
}

.large-play-btn:hover {
    background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-lavender) 100%);
    border-color: transparent;
    color: #fff;
    transform: scale(1.06);
    box-shadow: 0 12px 30px var(--color-rose-glow);
}

.large-play-btn i {
    width: 22px;
    height: 22px;
}

.large-play-btn .icon-play {
    margin-left: 3px;
}

/* ==========================================
   Frosted Controls Bar Styling
   ========================================== */
.custom-controls-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(253, 250, 252, 0.95) 0%, rgba(253, 250, 252, 0.5) 70%, rgba(253, 250, 252, 0) 100%);
    padding: 30px 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 6;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

.video-player-container:hover .custom-controls-wrapper,
.video-player-container.paused .custom-controls-wrapper,
.video-player-container.control-active .custom-controls-wrapper {
    transform: translateY(0);
    opacity: 1;
}

/* Floating Inner Glass Panel */
.controls-row {
    background: var(--bg-controls-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 30px rgba(62, 45, 79, 0.04);
}

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

.control-btn {
    background: transparent;
    border: none;
    color: var(--color-plum);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-snappy);
}

.control-btn:hover {
    color: var(--color-rose);
    background: rgba(214, 85, 126, 0.06);
}

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

/* Progress Slider */
.progress-container {
    position: relative;
    width: 100%;
    height: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.progress-bar-hover-zone {
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: 0;
    right: 0;
    z-index: 3;
}

.progress-timeline-bg {
    width: 100%;
    height: 4px;
    background: rgba(62, 45, 79, 0.1);
    border-radius: 2px;
    position: relative;
    transition: height 0.15s ease;
}

.progress-container:hover .progress-timeline-bg {
    height: 6px;
}

.progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(138, 87, 163, 0.12);
    border-radius: 2px;
}

.progress-current {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--color-rose) 0%, var(--color-lavender) 100%);
    border-radius: 2px;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid var(--color-rose);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 4;
    box-shadow: 0 2px 5px rgba(214, 85, 126, 0.2);
    transition: transform 0.12s ease;
}

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

.progress-tooltip {
    position: absolute;
    bottom: 22px;
    left: 0;
    transform: translateX(-50%) scale(0.9);
    opacity: 0;
    background: rgba(62, 45, 79, 0.9);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: var(--font-display);
    pointer-events: none;
    transition: opacity 0.1s ease;
}

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

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

.volume-slider-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.25s ease;
    display: flex;
    align-items: center;
}

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

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 65px;
    height: 4px;
    background: rgba(62, 45, 79, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-rose);
}

/* Time Display */
.time-display {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    display: flex;
    gap: 3px;
}

.time-current { color: var(--color-text); }
.time-separator { color: rgba(62, 45, 79, 0.25); }

/* Playback Speed Menu */
.speed-container {
    position: relative;
}

.speed-btn {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    width: auto;
    padding: 0 8px;
    border: 1px solid rgba(62, 45, 79, 0.15);
}

.speed-menu {
    position: absolute;
    bottom: 46px;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 6px 0;
    list-style: none;
    min-width: 75px;
    box-shadow: 0 6px 20px rgba(62, 45, 79, 0.06);
    z-index: 100;
}

.speed-menu li {
    font-family: var(--font-display);
    font-size: 0.65rem;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--color-text-muted);
    text-align: center;
}

.speed-menu li:hover {
    background: rgba(214, 85, 126, 0.04);
    color: var(--color-rose);
}

.speed-menu li.active {
    color: var(--color-rose);
    font-weight: 800;
}

/* Error notice fallback frame */
.stream-error-notice {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(253, 250, 252, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
    z-index: 12;
}

.error-icon {
    width: 44px;
    height: 44px;
    color: var(--color-rose);
    margin-bottom: 12px;
}

.error-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.error-description {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    max-width: 360px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.fallback-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-lavender) 100%);
    color: #fff;
    padding: 9px 18px;
    border-radius: 20px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-decoration: none;
    font-weight: 700;
}

/* ==========================================
   Dance Selectors (3 Pill Buttons directly below Video)
   ========================================== */
.dance-selectors {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

.dance-selector-btn {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--color-plum);
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(62, 45, 79, 0.02);
}

.dance-selector-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(214, 85, 126, 0.35);
    color: var(--color-rose);
}

.dance-selector-btn.active {
    background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-lavender) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px var(--color-rose-glow);
}

/* ==========================================
   Shared Action Links (Go to Drive & Download)
   ========================================== */
.action-buttons-row {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

.action-link {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.drive-link {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    color: var(--color-plum);
    box-shadow: 0 4px 15px rgba(62, 45, 79, 0.02);
}

.drive-link:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--color-lavender);
    color: var(--color-lavender);
    transform: translateY(-1.5px);
}

.download-link {
    color: #fff;
    background: linear-gradient(135deg, var(--color-rose) 0%, var(--color-lavender) 100%);
    box-shadow: 0 6px 20px var(--color-rose-glow);
    border: none;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--color-rose-glow), 0 0 10px var(--color-lavender-glow);
}

.action-link svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   Toast Notification Styling
   ========================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 25px rgba(62, 45, 79, 0.08);
    padding: 12px 18px;
    border-radius: 10px;
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(20px);
    opacity: 0;
    animation: slideIn 0.25s forwards, slideOut 0.25s 2.7s forwards;
}

@keyframes slideIn { to { transform: translateY(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateY(-20px); opacity: 0; } }

.toast-icon {
    color: var(--color-rose);
    width: 16px;
    height: 16px;
}

/* ==========================================
   Responsive Framework
   ========================================== */
@media (max-width: 768px) {
    .player-wrapper {
        padding: 20px 15px;
        gap: 20px;
    }
    
    .action-buttons-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-link {
        width: 100%;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 0.95rem;
    }
    
    .dance-selectors {
        gap: 8px;
    }
    
    .dance-selector-btn {
        width: 100%;
        border-radius: 8px;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .controls-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 8px 12px;
    }
    
    .controls-left, .controls-right {
        justify-content: space-between;
        width: 100%;
    }
    
    .volume-slider-wrapper {
        width: 60px;
    }
}
