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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1em;
}

main {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.upload-box {
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-box:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

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

.upload-box h2 {
    margin-bottom: 10px;
    color: #ffffff;
}

.upload-hint {
    color: #a0a0a0;
    margin-bottom: 20px;
}

.file-info {
    margin-top: 15px;
    color: #667eea;
    font-weight: 500;
}

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

.palette-section,
.resolution-section,
.framerate-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.palette-section label {
    font-weight: 500;
    color: #ffffff;
}

.palette-select {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.palette-select:hover {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(102, 126, 234, 0.15);
}

.palette-select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.browse-btn, .generate-btn, .download-btn, .new-video-btn, .retry-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.generate-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    width: 100%;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

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

.download-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    width: 100%;
    margin-bottom: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
}

.new-video-btn, .retry-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 100%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.new-video-btn:hover, .retry-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.progress-section {
    text-align: center;
}

.progress-section h2 {
    margin-bottom: 30px;
    color: #ffffff;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    color: #a0a0a0;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result-section, .error-section {
    text-align: center;
}

.result-section h2, .error-section h2 {
    margin-bottom: 20px;
}

.success-message {
    color: #a0a0a0;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.video-preview-container {
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.video-preview {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    background: #000;
}

.video-preview::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.7);
}

.error-message {
    color: #f5576c;
    margin-bottom: 30px;
    font-size: 1.1em;
    padding: 15px;
    background: rgba(245, 87, 108, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(245, 87, 108, 0.3);
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #a0a0a0;
    font-size: 0.9em;
}

footer p {
    margin: 5px 0;
}

/* Responsive design */
@media (max-width: 600px) {
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-box {
        padding: 40px 15px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

