/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.nav-link {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    color: white;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: white;
    color: #667eea;
}

/* Card */
.card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #333;
}

.info {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #d1d5db;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f9fafb;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #ede9fe;
}

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

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-hint {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* File Info */
.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
    margin-bottom: 20px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 2rem;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.file-size {
    color: #666;
    font-size: 0.9rem;
}

.btn-remove {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-refresh {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f3f4f6;
    color: #333;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-refresh {
    background: #f3f4f6;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
}

.btn-refresh:hover {
    background: #e5e7eb;
}

.refresh-icon {
    font-size: 1.2rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-refresh:hover .refresh-icon {
    transform: rotate(180deg);
}

/* Success/Error Cards */
.success-card, .error-card {
    text-align: center;
}

.success-icon, .error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-icon {
    color: #10b981;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #d1fae5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.error-icon {
    color: #ef4444;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.filename-display {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: monospace;
    color: #666;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.button-group .btn-primary,
.button-group .btn-secondary {
    flex: 1;
}

/* Downloads Page */
.downloads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.downloads-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    width: 250px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Loading State */
.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Video List */
.videos-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-item {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.video-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.video-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.video-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.video-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #666;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-ready {
    background: #d1fae5;
    color: #065f46;
}

.status-processing {
    background: #fef3c7;
    color: #92400e;
}

.video-downloads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.download-option {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.download-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.download-size {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    display: block;
}

.btn-download {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-download:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Empty/Error States */
.empty-state, .error-state {
    text-align: center;
    padding: 60px 20px;
}

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

.empty-state h3, .error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p, .error-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.info-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
}

.steps {
    list-style: none;
    counter-reset: step-counter;
}

.steps li {
    counter-increment: step-counter;
    margin-bottom: 15px;
    padding-left: 40px;
    position: relative;
    line-height: 1.6;
}

.steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.info-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
}

.info-item h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
}

.info-item p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-note {
    margin-top: 20px;
    padding: 15px;
    background: #ede9fe;
    border-radius: 8px;
    color: #5b21b6;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 40px;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 24px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .downloads-header {
        flex-direction: column;
        align-items: stretch;
    }

    .downloads-actions {
        flex-direction: column;
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .btn-refresh {
        width: 100%;
        justify-content: center;
    }

    .video-downloads {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

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

.card {
    animation: fadeIn 0.5s ease;
}
