/* ===========================
   CSS Variables & Dark Theme
   =========================== */
:root {
    /* Dark Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --bg-card: #1f1f2e;
    --bg-hover: #252535;

    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Vibrant Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-blue: #6366f1;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #ec4899 100%);
    --accent-gradient-2: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);

    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    --border-color: #27273a;
    --border-radius: 20px;
    --border-radius-sm: 14px;

    /* Shadows */
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow-purple: 0 0 60px rgba(139, 92, 246, 0.4);
    --shadow-glow-blue: 0 0 60px rgba(99, 102, 241, 0.4);
    --shadow-glow-pink: 0 0 60px rgba(236, 72, 153, 0.4);

    /* Transitions */
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   Reset & 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: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(5%, 5%) rotate(5deg); }
}

.app {
    position: relative;
    z-index: 1;
}

/* ===========================
   Layout
   =========================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    margin-bottom: 80px;
}

/* ===========================
   Header
   =========================== */
.header {
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.logo {
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 5s ease infinite;
    background-size: 200% 200%;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.3));
}

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 500;
}

/* ===========================
   Hero Section
   =========================== */
.hero-section {
    text-align: center;
    margin-bottom: 80px;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 60px;
}

/* ===========================
   Tiles Grid
   =========================== */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 48px;
}

.tile {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 48px 40px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: hidden;
    min-height: 450px;
}

.tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.tile:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.tile:hover::before {
    opacity: 0.12;
}

.tile-image:hover {
    box-shadow: var(--shadow-glow-purple);
}

.tile-video:hover {
    box-shadow: var(--shadow-glow-pink);
}

.tile > * {
    position: relative;
    z-index: 1;
}

.tile-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border-radius: 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.tile:hover .tile-icon {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
    transform: scale(1.1) rotate(5deg);
}

.tile-icon svg {
    color: var(--accent-purple);
    transition: var(--transition);
}

.tile-video .tile-icon svg {
    color: var(--accent-pink);
}

.tile:hover .tile-icon svg {
    filter: drop-shadow(0 0 20px currentColor);
}

.tile-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tile-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.tile-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 32px;
}

.feature-badge {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.tile:hover .feature-badge {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.tile-arrow {
    margin-top: auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tile:hover .tile-arrow {
    transform: translateX(8px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

.tile-arrow svg {
    color: white;
}

/* ===========================
   Features Section
   =========================== */
.features-section {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 48px;
    text-align: center;
    color: var(--text-primary);
}

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

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

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-md);
    background: var(--bg-hover);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: grayscale(0.3);
    transition: var(--transition-fast);
}

.feature-card:hover .feature-icon {
    filter: grayscale(0);
    transform: scale(1.2);
}

.feature-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===========================
   Footer
   =========================== */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 100px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===========================
   Form Styles (for image/video pages)
   =========================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

.form-label-description {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

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

/* ===========================
   Buttons
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: white;
}

.btn-primary {
    background: var(--accent-gradient);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow-purple);
}

.btn-primary:active {
    transform: translateY(-1px);
}

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

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

.btn-generate {
    width: 100%;
    font-size: 18px;
    padding: 20px 40px;
    margin-top: 24px;
}

/* ===========================
   Progress & Spinner
   =========================== */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
    margin: 24px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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%); }
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1024px) {
    .tiles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 48px;
    }

    .hero-title {
        font-size: 32px;
    }

    .tile {
        min-height: auto;
    }

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

    .section-title {
        font-size: 28px;
    }
}

/* ===========================
   Modal Styles
   =========================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===========================
   Utility Classes
   =========================== */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
