:root {
    --bg-dark: #0a0a1a;
    --bg-panel: rgba(26, 26, 62, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-1: #00d4ff;
    --accent-2: #7b2ff7;
    --text-main: #ffffff;
    --text-muted: #a0a0c0;
    --font-family: 'Inter', sans-serif;
    --glass-blur: 20px;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Mesh Gradient */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(123, 47, 247, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(0, 212, 255, 0.15), transparent 25%);
    filter: blur(60px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.content-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    flex: 1;
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.controls-panel {
    position: sticky;
    top: 2rem;
    height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
}

.panel-top-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.panel-top-scroll::-webkit-scrollbar {
    width: 4px;
}
.panel-top-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.panel-top-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.panel-bottom-fixed {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.upload-zone:hover, .upload-zone.drag-active {
    border-color: var(--accent-1);
    background: rgba(0, 212, 255, 0.05);
}

.icon-upload {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--accent-1);
}

.upload-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.upload-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Settings */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.setting-item label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.glass-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
    appearance: none;
}

.glass-input:focus {
    border-color: var(--accent-2);
}

.glass-slider {
    width: 100%;
    accent-color: var(--accent-2);
    cursor: pointer;
}

/* Playback Controls */
.playback-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-play {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    box-shadow: 0 4px 20px rgba(123, 47, 247, 0.4);
}

.btn-play:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(123, 47, 247, 0.6);
}

.btn-play:not(:disabled):active {
    transform: scale(0.95);
}

.btn-play svg {
    width: 32px;
    height: 32px;
}

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-icon:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.hidden {
    display: none !important;
}

/* Export Button */
.btn-export {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-export:not(:disabled):hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

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

/* Visualizer */
.visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 60px;
    margin-bottom: 2rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.visualizer.active {
    opacity: 1;
}

.visualizer .bar {
    width: 6px;
    background: linear-gradient(to top, var(--accent-1), var(--accent-2));
    border-radius: 3px;
    height: 10px;
    transition: height 0.1s ease;
}

.visualizer.active .bar {
    animation: wave 1s ease-in-out infinite;
}

.visualizer.active .bar:nth-child(2) { animation-delay: -0.8s; }
.visualizer.active .bar:nth-child(3) { animation-delay: -0.6s; }
.visualizer.active .bar:nth-child(4) { animation-delay: -0.4s; }
.visualizer.active .bar:nth-child(5) { animation-delay: -0.2s; }
.visualizer.active .bar:nth-child(6) { animation-delay: -0.5s; }
.visualizer.active .bar:nth-child(7) { animation-delay: -0.9s; }
.visualizer.active .bar:nth-child(8) { animation-delay: -0.3s; }

@keyframes wave {
    0%, 100% { height: 10px; }
    50% { height: 50px; }
}

/* Progress */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    border-radius: 4px;
    transition: width 0.1s linear;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    box-shadow: 0 0 10px var(--accent-1);
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Subtitles */
.subtitles-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.subtitles-container::-webkit-scrollbar {
    width: 6px;
}
.subtitles-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.subtitles-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.empty-state {
    margin: auto;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.5;
}

.btn-export:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

.export-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.8rem;
    line-height: 1.4;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.subtitle-block {
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    transform: translateX(-10px);
    opacity: 0.5;
    animation: slideIn 0.4s forwards;
    cursor: pointer;
}

.subtitle-block:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 0.7;
    }
}

.subtitle-block.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.subtitle-time {
    font-size: 0.8rem;
    color: var(--accent-1);
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.subtitle-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-main);
}

.subtitle-block.active .subtitle-text {
    font-weight: 500;
    background: linear-gradient(90deg, #fff, #e0e0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .player-panel {
        min-height: 500px;
    }
}
