:root {
    --primary-color: #8b5cf6;
    --secondary-color: #ec4899;
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
}

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

body {
    font-family: 'Outfit', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    user-select: none;
}

/* Ecosystem Navigation */
.ecosystem-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    animation: fadeInDown 1s ease-out forwards;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.home-link {
    font-weight: 700;
    color: var(--text-primary);
}

/* Dynamic background */
.background-animation {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0f172a 40%, #000000 100%);
    z-index: -1;
    animation: pulse 15s ease-in-out infinite alternate;
}

.background-animation::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.05) 50%, transparent 70%);
    filter: blur(80px);
    animation: rotate 20s linear infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

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

.container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 10;
}

header {
    text-align: center;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #e0e7ff 0%, #a78bfa 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    animation: fadeInDown 1s ease-out forwards;
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeInUp 1s ease-out 0.3s forwards;
    opacity: 0;
    margin-bottom: 0.5rem;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
    letter-spacing: 1px;
}

.copyright a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.copyright a:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 8px rgba(236, 72, 153, 0.5);
}

.player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    animation: zoomIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
    opacity: 0;
    transform: scale(0.95);
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

/* Default subtitles styling */
::cue {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.5rem;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Custom Controls */
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 1.5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

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

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

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

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

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

.spacer {
    flex-grow: 1;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.time-display {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

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

.volume-slider {
    width: 80px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .controls-row {
        flex-wrap: wrap;
    }
    .spacer {
        display: none;
    }
    .volume-container {
        margin-left: auto;
    }
}
