:root {
    --bg-color: #0f1115;
    --card-bg: #1a1d24;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-color: #6366f1;
    /* Indigo-500 */
    --accent-hover: #4f46e5;
    /* Indigo-600 */
    --border-color: #27272a;
    --success-color: #10b981;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-header {
    margin-bottom: 2rem;
    text-align: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-align: center;
}

.app-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
}

.app-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

.app-footer a:hover {
    text-decoration: underline;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upload-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent-color);
    background-color: rgba(99, 102, 241, 0.05);
}

.icon-container {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.icon-container svg {
    width: 36px;
    height: 36px;
}

.browse-text {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 56px;
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Result Card Styles */
.result-card {
    max-width: 800px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.result-header h2 {
    font-size: 1.5rem;
}

.score-badge {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.score-badge .label {
    font-size: 0.75rem;
    color: var(--success-color);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.score-badge .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success-color);
}

.video-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    border-radius: 16px;
    overflow: hidden;
    background-color: black;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 600px;
}

.secondary-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background-color: var(--border-color);
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .app-header {
        margin-bottom: 1.5rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .upload-card h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .upload-area {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .settings-section {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .settings-title {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .setting-item {
        margin-bottom: 0.6rem;
    }

    .setting-label {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .setting-help {
        font-size: 0.65rem;
    }

    .primary-btn {
        height: 48px;
        font-size: 0.9rem;
    }

    .video-wrapper {
        max-width: 100%;
    }

    video {
        max-height: 400px;
    }
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 8px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 8px;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.supported-formats {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Settings Section */
.settings-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.settings-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.setting-item {
    margin-bottom: 0.75rem;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.setting-value {
    font-weight: 600;
    color: var(--accent-color);
}

.setting-help {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 0.2rem;
    line-height: 1.3;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: var(--accent-hover);
}

/* Demo Section */
.demo-section {
    margin: 1rem 0;
}

.demo-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 0.75rem;
}

.demo-divider::before,
.demo-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.demo-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.demo-videos {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.demo-video-btn {
    flex: 1;
    max-width: 130px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.demo-video-btn:hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.demo-video-btn:active {
    transform: translateY(0);
}

.demo-thumb {
    width: 100px;
    height: 75px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.demo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

.demo-video-btn:hover .play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.demo-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .demo-section {
        margin: 0.75rem 0;
    }

    .demo-videos {
        gap: 0.6rem;
    }

    .demo-video-btn {
        max-width: 110px;
        padding: 0.6rem 0.4rem;
    }

    .demo-thumb {
        width: 90px;
        height: 68px;
    }

    .play-overlay svg {
        width: 24px;
        height: 24px;
    }

    .demo-label {
        font-size: 0.75rem;
    }

    .demo-divider {
        margin-bottom: 0.6rem;
    }

    .demo-divider span {
        font-size: 0.7rem;
        padding: 0 0.6rem;
    }
}