:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: #16162a;
    --bg-input: #1e1e35;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent: #7c3aed;
    --accent-hover: #8b5cf6;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --accent-gradient: linear-gradient(135deg, #7c3aed, #ec4899);
    --border: #2a2a40;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-effects .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.bg-effects .orb:nth-child(1) {
    width: 600px;
    height: 600px;
    background: #7c3aed;
    top: -200px;
    left: -200px;
}

.bg-effects .orb:nth-child(2) {
    width: 500px;
    height: 500px;
    background: #ec4899;
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.bg-effects .orb:nth-child(3) {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -30px); }
    50% { transform: translate(-20px, 20px); }
    75% { transform: translate(20px, 10px); }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: var(--accent);
    border-radius: 20px;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Main Content */
.main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Generator Section */
.generator {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 48px;
    box-shadow: var(--shadow);
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
}

.mode-tab {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-tab:hover {
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

/* Prompt Area */
.prompt-area {
    margin-bottom: 24px;
}

.prompt-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prompt-input {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    line-height: 1.6;
}

.prompt-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.prompt-input::placeholder {
    color: var(--text-muted);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Image Upload */
.image-upload-area {
    margin-bottom: 24px;
    display: none;
}

.image-upload-area.active {
    display: block;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-input);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.05);
}

.upload-zone .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-zone h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-muted);
}

.upload-preview {
    display: none;
    position: relative;
    margin-top: 16px;
}

.upload-preview img {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.upload-preview .remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--error);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Options */
.options-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.option-group {
    flex: 1;
    min-width: 150px;
}

.option-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.option-group select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 16px 32px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

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

.generate-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.generate-btn.loading .spinner {
    display: block;
}

.generate-btn.loading .btn-text {
    display: none;
}

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

/* Status Message */
.status-area {
    margin-top: 24px;
    display: none;
}

.status-area.active {
    display: block;
}

.status-card {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-card .status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.status-card.processing .status-icon {
    background: rgba(124, 58, 237, 0.2);
    animation: pulse 2s infinite;
}

.status-card.completed .status-icon {
    background: rgba(16, 185, 129, 0.2);
}

.status-card.failed .status-icon {
    background: rgba(239, 68, 68, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-info h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.status-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: indeterminate 2s infinite;
    width: 40%;
}

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

/* Video Result */
.video-result {
    margin-top: 24px;
    display: none;
}

.video-result.active {
    display: block;
}

.video-container {
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.video-container video {
    width: 100%;
    display: block;
    max-height: 500px;
}

.video-actions {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.video-action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.video-action-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Examples Section */
.examples-section {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.example-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.example-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.example-card .example-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.example-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.example-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* History Section */
.history-section {
    margin-bottom: 48px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.history-card:hover {
    border-color: var(--accent);
}

.history-card video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.history-card .history-info {
    padding: 16px;
}

.history-card .history-prompt {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-card .history-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-card .status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.completed { background: rgba(16,185,129,0.2); color: var(--success); }
.status-badge.processing { background: rgba(124,58,237,0.2); color: var(--accent); }
.status-badge.failed { background: rgba(239,68,68,0.2); color: var(--error); }
.status-badge.pending { background: rgba(245,158,11,0.2); color: var(--warning); }

/* Features Section */
.features-section {
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
}

.feature-card .feature-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.error { border-color: var(--error); }
.toast.success { border-color: var(--success); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 15px; }
    .generator { padding: 20px; }
    .options-row { flex-direction: column; }
    .header-inner { padding: 0; }
    .nav-links { display: none; }
    .mode-tabs { width: 100%; }
    .mode-tab { flex: 1; justify-content: center; }
    .examples-grid { grid-template-columns: 1fr; }
    .video-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 28px; }
    .main { padding: 24px 16px; }
    .generator { padding: 16px; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
