:root {
    --bg-main: #0B0F19;
    --bg-panel: rgba(22, 28, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #14b8a6;
    --primary-hover: #0d9488;
    --primary-glow: rgba(20, 184, 166, 0.4);
    --success: #10b981;
    --success-hover: #059669;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Effects */
.background-effect {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.2;
    z-index: -1;
    border-radius: 50%;
}

.background-effect.right {
    top: auto;
    bottom: -150px;
    left: auto;
    right: -100px;
    background: #8b5cf6;
    opacity: 0.15;
}

.app-container {
    width: 100%;
    max-width: 640px;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

header {
    text-align: center;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

header h1 span {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

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

/* Glassmorphism Classes */
.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed rgba(20, 184, 166, 0.3);
    border-radius: 1.5rem;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(20, 184, 166, 0.03);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(20, 184, 166, 0.08);
}

.icon-pulse {
    width: 64px;
    height: 64px;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.drop-zone:hover .icon-pulse {
    transform: scale(1.1);
}

.upload-icon {
    width: 32px;
    height: 32px;
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.drop-subtext {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Panels */
.panel {
    padding: 2rem;
    margin-top: 1rem;
    animation: fadeInUp 0.4s ease forwards;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.video-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
}

.video-icon svg {
    width: 24px;
    height: 24px;
}

.video-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    word-break: break-all;
}

.badges {
    display: flex;
    gap: 0.5rem;
}

.badge {
    background: rgba(20, 184, 166, 0.15);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Progress */
.progress-container {
    text-align: center;
    padding: 1rem 0;
}

.progress-text {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.progress-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(20, 184, 166, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1.5rem;
}

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

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 50%; /* Animated in JS */
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.upload-fill {
    background: #8b5cf6;
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
}

.btn-text:hover {
    color: var(--text-main);
}

/* Results */
.result-panel {
    text-align: center;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon svg {
    width: 32px;
    height: 32px;
}

.result-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 1rem;
    min-width: 120px;
}

.stat-box.success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.stat-box.success .stat-value {
    color: var(--success);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-arrow {
    color: var(--text-muted);
    font-weight: bold;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Feedback */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    font-weight: 500;
}

.error-message svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Utilities */
.hidden {
    display: none !important;
}

footer {
    text-align: center;
    margin-top: auto;
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Codec selector */
.codec-selector {
    margin-bottom: 1.5rem;
    text-align: left;
}
.codec-selector label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}
.form-select:focus {
    border-color: var(--primary);
}
.form-select option {
    background: var(--bg-main);
}

