/* FactVideo AI - Modern Styles */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --bg-card: #1e1e3f;
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --border-color: #2d2d4a;
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-dark: linear-gradient(180deg, #0f0f23 0%, #1a1a2e 100%);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --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, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated Background */
.app-container {
    min-height: 100vh;
    position: relative;
}

.app-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 1.75rem;
    -webkit-text-fill-color: #6366f1;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* Main Content */
.main-content {
    padding-top: 90px;
    padding-bottom: 4rem;
    position: relative;
    z-index: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Creator Panel */
.creator-panel {
    max-width: 900px;
    margin: 0 auto 4rem;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.step-indicator.active {
    color: var(--text-primary);
}

.step-indicator.completed .step-number {
    background: var(--success);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
}

.step-indicator.active .step-number {
    background: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    border-radius: 1px;
}

/* Panel Content */
.panel-content {
    padding: 2rem;
}

.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.input-group label i {
    color: var(--primary-light);
}

.url-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.url-input-wrapper input {
    flex: 1;
}

.btn-paste {
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-paste:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Video Preview */
.video-preview {
    aspect-ratio: 9/16;
    max-height: 400px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 2px dashed var(--border-color);
}

.preview-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.preview-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.preview-placeholder p {
    font-size: 0.875rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-generate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.btn-generate {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.125rem;
    background: var(--gradient-primary);
    color: white;
    position: relative;
    overflow: hidden;
    margin-top: 1.5rem;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

.btn-generate:hover .btn-shine {
    left: 100%;
}

/* Voice Categories */
.voice-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.category-btn:hover,
.category-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Search Voice */
.search-voice {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-voice i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-voice input {
    padding-left: 2.5rem;
}

/* Voices Grid */
.voices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1.5rem;
}

.voices-grid::-webkit-scrollbar {
    width: 6px;
}

.voices-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.voices-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.voice-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.voice-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.voice-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.voice-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.voice-info {
    flex: 1;
    min-width: 0;
}

.voice-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-info p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.voice-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.voice-tag.popular {
    background: var(--secondary);
    color: white;
}

.btn-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-play:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.selected-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Summary Card */
.summary-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.summary-card h3 i {
    color: var(--primary-light);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    color: var(--text-secondary);
}

.summary-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Fact Input */
.fact-input {
    margin-bottom: 1.5rem;
    position: relative;
}

.fact-input textarea {
    resize: vertical;
    min-height: 120px;
}

.char-count {
    position: absolute;
    bottom: 0.75rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Generation Options */
.generation-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.option-label:hover {
    color: var(--text-primary);
}

.option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Progress Section */
.progress-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.p-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.p-step.active {
    color: var(--primary-light);
}

.p-step.completed {
    color: var(--success);
}

.p-step i {
    font-size: 0.875rem;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
}

.result-video {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
}

.result-video video {
    width: 100%;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.video-overlay:hover {
    background: rgba(0, 0, 0, 0.3);
}

.video-overlay i {
    font-size: 4rem;
    color: white;
    opacity: 0.9;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.result-actions button {
    flex: 1;
    min-width: 150px;
}

/* Features Section */
.features {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

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

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-close:hover {
    background: var(--error);
    color: white;
}

.modal-body {
    padding: 2rem;
}

.preview-player {
    text-align: center;
}

.voice-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 60px;
    margin-bottom: 1.5rem;
}

.voice-wave .bar {
    width: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.voice-wave .bar:nth-child(1) { height: 20%; animation-delay: 0s; }
.voice-wave .bar:nth-child(2) { height: 40%; animation-delay: 0.1s; }
.voice-wave .bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.voice-wave .bar:nth-child(4) { height: 80%; animation-delay: 0.3s; }
.voice-wave .bar:nth-child(5) { height: 60%; animation-delay: 0.4s; }
.voice-wave .bar:nth-child(6) { height: 40%; animation-delay: 0.5s; }
.voice-wave .bar:nth-child(7) { height: 60%; animation-delay: 0.6s; }
.voice-wave .bar:nth-child(8) { height: 30%; animation-delay: 0.7s; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

.preview-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1rem;
    }
    
    .panel-header {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .step-line {
        width: 30px;
    }
    
    .panel-content {
        padding: 1.5rem;
    }
    
    .voices-grid {
        grid-template-columns: 1fr;
    }
    
    .features h2 {
        font-size: 1.75rem;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions button {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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