* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #5666ad 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* MAIN CONTENT BOX */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.input-section {
    margin-bottom: 30px;
}

/* INPUT */
#reelUrl {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

#reelUrl:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* DOWNLOAD BUTTON */
#downloadBtn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#downloadBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* INSTRUCTION BOX */
.instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #333;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* RESULT */
.result-section {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.video-preview {
    margin-bottom: 20px;
}

#previewVideo {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* DOWNLOAD LINK BUTTON */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 16px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3);
}

/* ERROR BOX */
.error-section {
    background: #ffeaea;
    color: #d63031;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

/* LOADER */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* FOOTER */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* PROGRESS BAR */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.3s ease;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .container { padding: 10px; }
    header h1 { font-size: 1.8rem; }
    .main-content { padding: 20px; }
    #reelUrl, #downloadBtn { padding: 12px 15px; }
    .download-btn { padding: 10px 20px; font-size: 14px; }
}

/* DARK MODE */
@media (prefers-color-scheme: dark) {
    .main-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    .instructions {
        background: #4a5568;
        color: #e2e8f0;
    }
    #reelUrl {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
}

/* PRINT MODE (No buttons) */
@media print {
    #downloadBtn, .download-btn { display: none !important; }
    .main-content { background: white; box-shadow: none; }
}

/* ANIMATIONS */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
