/* static/style.css */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-900: #111827;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-user {
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* Container principale */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-section h1 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gray-50);
}

.upload-area:hover {
    border-color: var(--primary);
    background: white;
}

.upload-area.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-text {
    margin-bottom: 0.5rem;
}

.upload-text .primary {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.upload-text .secondary {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.upload-hint {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Progress Bar */
.upload-progress {
    margin-top: 1.5rem;
}

.progress-bar {
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
    border-radius: 1rem;
}

.progress-status {
    margin-top: 0.5rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.95rem;
}

/* Upload Result */
.upload-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
}

.result-success {
    color: #166534;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.result-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-links input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 0.95rem;
}

.result-links button {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Videos Grid */
.videos-section h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--gray-900);
}

.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
}

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.video-status-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-processing {
    background: var(--warning);
    color: white;
}

.status-completed {
    background: var(--success);
    color: white;
}

.status-error {
    background: var(--danger);
    color: white;
}

.video-info {
    padding: 1rem;
}

.video-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.video-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-primary {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    text-decoration: none;
    text-align: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.empty-state p {
    color: var(--gray-600);
}

/* Watch Page */
.watch-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.video-player-wrapper {
    background: black;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
}

.video-share {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.share-links {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.share-links input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
}

.share-links button {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.embed-code pre {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    font-size: 0.875rem;
}

/* Processing Status */
.processing-status {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.processing-status h2 {
    margin: 1rem 0;
}

.processing-status p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Spinner */
.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.spinner.large {
    width: 3rem;
    height: 3rem;
}

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

/* Progress Indicator */
.progress-indicator {
    display: flex;
    justify-content: space-between;
    max-width: 400px;
    margin: 2rem auto 0;
}

.progress-step {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
    position: relative;
}

.progress-step::before {
    content: '';
    width: 1rem;
    height: 1rem;
    background: var(--gray-300);
    border-radius: 50%;
    display: block;
    margin: 0 auto 0.5rem;
}

.progress-step.completed::before {
    background: var(--success);
}

.progress-step.active::before {
    background: var(--primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login-form h1 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.btn-block {
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 2rem;
    }
}
