/**
 * Générateur de Fiches Produit SEO
 * Design System - Mode Luxe
 */

/* ================================
   CSS VARIABLES
================================ */
:root {
    /* Colors - Dark Theme (Default) */
    --color-bg-primary: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-elevated: #1a1a24;
    --color-bg-hover: #22222e;
    
    --color-surface: #16161e;
    --color-surface-elevated: #1e1e28;
    --color-surface-hover: #262630;
    
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    
    --color-text-primary: #f4f4f5;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;
    
    /* Accent Colors */
    --color-accent: #8b5cf6;
    --color-accent-hover: #a78bfa;
    --color-accent-glow: rgba(139, 92, 246, 0.3);
    
    --color-gold: #d4af37;
    --color-gold-light: #f5d76e;
    
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #f97316 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f5d76e 100%);
    --gradient-surface: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg-primary) 100%);
    
    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--color-accent-glow);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-tooltip: 400;
    --z-notification: 500;
}

/* Light Theme */
[data-theme="light"] {
    --color-bg-primary: #fafafa;
    --color-bg-secondary: #f4f4f5;
    --color-bg-elevated: #ffffff;
    --color-bg-hover: #e4e4e7;
    
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-surface-hover: #f4f4f5;
    
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-hover: rgba(0, 0, 0, 0.15);
    
    --color-text-primary: #18181b;
    --color-text-secondary: #52525b;
    --color-text-muted: #a1a1aa;
    
    --color-accent: #7c3aed;
    --color-accent-hover: #6d28d9;
    --color-accent-glow: rgba(124, 58, 237, 0.2);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ================================
   BASE STYLES
================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, var(--color-accent-glow), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(217, 70, 239, 0.1), transparent);
}

.bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.bg-grid {
    position: absolute;
    inset: 0;
    opacity: 0.02;
    background-image: 
        linear-gradient(var(--color-text-primary) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-text-primary) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ================================
   APP CONTAINER
================================ */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6);
}

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

[data-theme="light"] .app-header {
    background: rgba(250, 250, 250, 0.9);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: var(--text-lg);
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

.nav-link.active {
    color: var(--color-accent);
    background: rgba(139, 92, 246, 0.1);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: var(--space-2);
}

/* ================================
   BUTTONS
================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-primary {
    color: white;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 40px var(--color-accent-glow);
}

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

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

.btn-ghost {
    color: var(--color-text-secondary);
    background: transparent;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--color-text-secondary);
    background: transparent;
    border-radius: var(--radius-lg);
}

.btn-icon:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

/* ================================
   FORMS
================================ */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-label .required {
    color: var(--color-error);
    margin-left: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-10);
}

.form-help {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.form-error {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-error);
}

/* Radio & Checkbox */
.form-radio-group {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.form-radio {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}

.form-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
}

/* ================================
   HERO SECTION
================================ */
.hero-section {
    text-align: center;
    padding: var(--space-12) 0 var(--space-8);
}

.hero-title {
    font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

.title-gradient {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-accent {
    display: block;
    color: var(--color-text-primary);
}

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

/* ================================
   GENERATOR SECTION
================================ */
.generator-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
}

/* Progress Steps */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.step-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-bg-elevated);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.step-label {
    font-size: var(--text-xs);
    white-space: nowrap;
}

.step-line {
    width: 20px;
    height: 2px;
    background: var(--color-border);
    transition: background var(--transition-base);
}

.step.completed + .step-line,
.step.completed ~ .step-line:first-of-type {
    background: var(--color-accent);
}

.step.active .step-number {
    color: white;
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.step.completed .step-number {
    color: white;
    background: var(--color-success);
    border-color: var(--color-success);
}

.step-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

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

.step-line {
    width: 60px;
    height: 2px;
    background: var(--color-border);
    margin-bottom: var(--space-6);
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.step-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.step-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.step-description {
    color: var(--color-text-secondary);
}

.step-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

/* ================================
   UPLOAD ZONE
================================ */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-12);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--color-accent);
    background: rgba(139, 92, 246, 0.05);
}

.upload-icon {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.upload-primary {
    display: block;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text-primary);
}

.upload-secondary {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.upload-hint {
    margin-top: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Uploaded Images */
.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.uploaded-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-elevated);
}

.uploaded-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploaded-image .remove-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.uploaded-image:hover .remove-btn {
    opacity: 1;
}

.uploaded-image .image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-2);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.uploaded-image:hover .image-info {
    opacity: 1;
}

.uploaded-image .image-name {
    font-size: var(--text-xs);
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.upload-success-badge {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success);
    color: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

/* ================================
   UPLOAD PROGRESS INDICATOR
================================ */
.upload-progress-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-elevated);
    border: 2px solid var(--color-accent);
    animation: pulse-border 2s infinite;
}

.upload-progress-item.error {
    border-color: var(--color-error);
    animation: none;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--color-accent);
        box-shadow: 0 0 0 0 var(--color-accent-glow);
    }
    50% {
        border-color: var(--color-accent-hover);
        box-shadow: 0 0 15px 0 var(--color-accent-glow);
    }
}

.progress-preview {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}

.progress-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.progress-ring {
    position: relative;
    width: 50px;
    height: 50px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring .progress-bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.progress-ring .progress-bar {
    stroke: var(--color-accent);
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.upload-progress-item.error .progress-ring .progress-bar {
    stroke: var(--color-error);
}

.progress-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-2);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.progress-name {
    font-size: var(--text-xs);
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-status {
    font-size: 0.65rem;
    color: var(--color-accent-hover);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upload-progress-item.error .progress-status {
    color: var(--color-error);
}

.cancel-btn {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.upload-progress-item:hover .cancel-btn {
    opacity: 1;
}

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

/* ================================
   FORM TABS
================================ */
.form-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    padding: var(--space-1);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
}

.tab-btn {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    color: var(--color-text-primary);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

/* Form Fields Grid */
.form-fields {
    display: grid;
    gap: var(--space-5);
}

.form-category {
    display: none;
}

.form-category.active {
    display: grid;
    gap: var(--space-5);
}

@media (min-width: 768px) {
    .form-category.active {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-category .form-group.full-width {
        grid-column: 1 / -1;
    }
}

/* ================================
   GENERATION LOADING
================================ */
.generation-loading {
    text-align: center;
    padding: var(--space-12);
}

.loading-animation {
    margin-bottom: var(--space-6);
}

.ai-brain {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.brain-svg {
    width: 100%;
    height: 100%;
    color: var(--color-accent);
}

.brain-pulse {
    position: absolute;
    inset: -10px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    opacity: 0.2;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.1); opacity: 0.1; }
}

.loading-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 6px;
    margin: 0 auto var(--space-4);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.loading-message {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ================================
   GENERATION RESULT
================================ */
.result-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.result-success {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-success);
    font-weight: 500;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.seo-score {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
}

.score-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.score-value {
    font-size: var(--text-lg);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-provider {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
}

/* Result Blocks */
.result-blocks {
    display: grid;
    gap: var(--space-4);
}

.result-block {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-elevated);
    border-bottom: 1px solid var(--color-border);
}

.block-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
}

.copy-btn.copied {
    color: var(--color-success);
    border-color: var(--color-success);
}

.block-content {
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.block-content.html-preview {
    font-family: var(--font-sans);
}

/* Result Actions */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

/* ================================
   MODAL
================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    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: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-body {
    padding: var(--space-6);
}

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

/* Settings */
.setting-group {
    margin-bottom: var(--space-6);
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
}

.theme-selector {
    display: flex;
    gap: var(--space-2);
}

.theme-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.theme-btn.active {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background: rgba(139, 92, 246, 0.1);
}

/* ================================
   NOTIFICATIONS
================================ */
.notifications-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: var(--z-notification);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
}

.notification {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

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

.notification.success { border-left: 3px solid var(--color-success); }
.notification.error { border-left: 3px solid var(--color-error); }
.notification.warning { border-left: 3px solid var(--color-warning); }

.notification-icon {
    flex-shrink: 0;
}

.notification.success .notification-icon { color: var(--color-success); }
.notification.error .notification-icon { color: var(--color-error); }
.notification.warning .notification-icon { color: var(--color-warning); }

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.notification-message {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ================================
   LOADING OVERLAY
================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(8px);
}

.loading-overlay[hidden] {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-4);
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--color-accent);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    inset: 6px;
    border-top-color: #d946ef;
    animation-duration: 0.8s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    inset: 12px;
    border-top-color: #f97316;
    animation-duration: 0.6s;
}

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

.loading-text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* ================================
   FOOTER
================================ */
.app-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-text {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}

.footer-logo {
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #d946ef, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-credits {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
}

.ai-badge {
    padding: var(--space-1) var(--space-2);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--space-4);
    }
    
    .logo-text {
        display: none;
    }
    
    .progress-steps {
        flex-wrap: wrap;
    }
    
    .step-line {
        display: none;
    }
    
    .generator-container {
        padding: var(--space-4);
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .step-actions .btn {
        width: 100%;
    }
    
    .form-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}

/* ================================
   UTILITIES
================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] {
    display: none !important;
}

/* ================================
   AUTHENTICATION PAGES
================================ */
.auth-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    color: white;
}

.auth-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.auth-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Google Button */
.btn-google {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-weight: 500;
}

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

.btn-google svg {
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* Auth Form */
.auth-form {
    margin-bottom: var(--space-6);
}

.auth-form .form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-link {
    font-size: var(--text-xs);
    color: var(--color-accent);
    text-decoration: none;
}

.form-link:hover {
    text-decoration: underline;
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    padding: var(--space-2);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--color-text-primary);
}

/* Checkbox */
.form-checkbox {
    margin-bottom: var(--space-6);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-accent);
}

.checkbox-label a {
    color: var(--color-accent);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Full Width Button */
.btn-full {
    width: 100%;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.auth-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--color-success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

/* Form Input Error State */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* User Menu in Header */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-fast);
}

.user-avatar:hover {
    border-color: var(--color-accent);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.user-menu:hover .user-dropdown,
.user-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.user-name {
    font-weight: 600;
    font-size: var(--text-sm);
}

.user-email {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.dropdown-menu {
    padding: var(--space-2);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

.dropdown-item.danger {
    color: var(--color-error);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* =====================================================
   SETTINGS PAGE
   ===================================================== */

.settings-page {
    padding-bottom: var(--space-12);
}

.settings-section {
    padding: var(--space-8) var(--space-4);
}

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

/* Provider Tabs */
.provider-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    padding: var(--space-1);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.provider-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.provider-tab:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

.provider-tab.active {
    color: var(--color-accent);
    background: rgba(139, 92, 246, 0.1);
}

.provider-icon {
    font-size: 1.2em;
}

.provider-status {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-text-muted);
    opacity: 0.3;
}

.provider-status.configured {
    background: var(--color-success);
    opacity: 1;
}

/* Provider Config Panels */
.provider-config {
    display: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.provider-config.active {
    display: block;
}

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

.config-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Input with Toggle */
.input-with-toggle {
    position: relative;
    display: flex;
}

.input-with-toggle .form-input {
    padding-right: var(--space-12);
}

.input-with-toggle .toggle-visibility {
    position: absolute;
    right: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--space-2);
}

.input-with-toggle .toggle-visibility:hover {
    color: var(--color-text-primary);
}

/* Range Input */
.range-input {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.range-input input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    appearance: none;
    cursor: pointer;
}

.range-input input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.range-input input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

.range-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-mono);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* General Settings */
.general-settings {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.general-settings h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

/* Display Settings */
.display-settings {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.display-settings h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.display-settings .settings-description {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
}

.toggle-settings {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.toggle-item:hover {
    border-color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.02);
}

.toggle-info {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.toggle-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.toggle-text label {
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
}

.toggle-hint {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-border);
    transition: all 0.3s ease;
    border-radius: 28px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-bottom: var(--space-6);
}

/* Security Info */
.security-info {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-lg);
}

.security-info .info-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-lg);
    color: var(--color-success);
}

.security-info .info-content h4 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-success);
    margin-bottom: var(--space-2);
}

.security-info .info-content p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Alert */
.alert {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.alert[hidden] {
    display: none;
}

.alert-icon {
    flex-shrink: 0;
}

.alert-content h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.alert-content p {
    font-size: var(--text-sm);
    opacity: 0.9;
}

/* Config Status Indicator */
.config-status {
    display: flex;
    align-items: center;
    padding: var(--space-2);
}

.config-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.config-status.configured .status-dot {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.config-status.not-configured .status-dot {
    background: var(--color-warning);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* Responsive Settings */
@media (max-width: 640px) {
    .provider-tabs {
        flex-direction: column;
    }
    
    .config-header {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .settings-actions .btn {
        width: 100%;
    }
}

/* =====================================================
   FORM GRID LAYOUT
   ===================================================== */

.form-fields-container {
    margin-bottom: var(--space-6);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   FORM SUMMARY
   ===================================================== */

.form-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-top: var(--space-6);
    margin-bottom: var(--space-4);
}

.form-summary h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-accent);
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
}

.summary-category {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.summary-category h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.summary-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.summary-value {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    word-break: break-word;
}

/* =====================================================
   RESPONSIVE PROGRESS STEPS
   ===================================================== */

@media (max-width: 768px) {
    .progress-steps {
        gap: var(--space-1);
        padding: 0 var(--space-2);
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
    
    .step-line {
        width: 10px;
    }
}

@media (max-width: 480px) {
    .progress-steps {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--space-2);
        -webkit-overflow-scrolling: touch;
    }
    
    .step-label {
        display: none;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
    }
}

/* =====================================================
   ENHANCED GENERATION ANIMATION
   ===================================================== */

.generation-loading {
    position: relative;
    text-align: center;
    padding: var(--space-8) var(--space-4);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    overflow: hidden;
}

/* Animated Particles Background */
.gen-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.gen-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    opacity: 0;
    animation: particleFloat 4s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100%) scale(0);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* Main Animation Container */
.gen-main-animation {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

/* Brain Container with Orbits */
.gen-brain-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Orbiting Rings */
.gen-orbit {
    position: absolute;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    animation: orbitRotate 8s linear infinite;
}

.gen-orbit-1 {
    width: 100%;
    height: 100%;
    border-color: rgba(139, 92, 246, 0.3);
    animation-duration: 12s;
}

.gen-orbit-2 {
    width: 130%;
    height: 130%;
    border-color: rgba(217, 70, 239, 0.2);
    animation-duration: 18s;
    animation-direction: reverse;
}

.gen-orbit-3 {
    width: 160%;
    height: 160%;
    border-color: rgba(249, 115, 22, 0.15);
    animation-duration: 24s;
}

.gen-orbit::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--color-accent-glow);
}

.gen-orbit-2::before {
    width: 6px;
    height: 6px;
    top: auto;
    bottom: -3px;
}

.gen-orbit-3::before {
    width: 5px;
    height: 5px;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes orbitRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Brain Core */
.gen-brain-core {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gen-brain-pulse {
    position: absolute;
    inset: -15px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    opacity: 0.15;
    animation: brainPulse 2s ease-in-out infinite;
}

.gen-brain-pulse.gen-pulse-2 {
    inset: -30px;
    opacity: 0.08;
    animation-delay: 0.5s;
}

@keyframes brainPulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.15; 
    }
    50% { 
        transform: scale(1.15); 
        opacity: 0.05; 
    }
}

.gen-brain-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px var(--color-accent-glow));
}

.gen-brain-wave {
    animation: brainWave 2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes brainWave {
    0%, 100% { d: path("M30 50 Q40 30 50 50 T70 50"); }
    50% { d: path("M30 50 Q40 70 50 50 T70 50"); }
}

.gen-neuron {
    animation: neuronBlink 1.5s ease-in-out infinite;
}

.gen-neuron:nth-child(2) { animation-delay: 0.2s; }
.gen-neuron:nth-child(3) { animation-delay: 0.4s; }
.gen-neuron:nth-child(4) { animation-delay: 0.6s; }
.gen-neuron:nth-child(5) { animation-delay: 0.8s; }

@keyframes neuronBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Status Message */
.gen-status {
    text-align: center;
}

.gen-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.gen-title-icon {
    animation: iconSparkle 2s ease-in-out infinite;
}

@keyframes iconSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-10deg); }
    75% { transform: scale(1.2) rotate(10deg); }
}

#gen-status-text {
    display: inline-block;
    min-width: 280px;
    text-align: left;
}

/* Progress Timeline */
.gen-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: var(--space-4) 0;
}

.gen-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.gen-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--color-bg-elevated);
    border: 2px solid var(--color-border);
    transition: all var(--transition-base);
    position: relative;
}

.gen-timeline-step.active .gen-timeline-dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 15px var(--color-accent-glow);
    animation: dotPulse 1s ease-in-out infinite;
}

.gen-timeline-step.completed .gen-timeline-dot {
    background: var(--color-success);
    border-color: var(--color-success);
}

.gen-timeline-step.completed .gen-timeline-dot::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--color-accent-glow); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

.gen-timeline-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
}

.gen-timeline-step.active .gen-timeline-label,
.gen-timeline-step.completed .gen-timeline-label {
    color: var(--color-text-primary);
}

.gen-timeline-connector {
    width: 40px;
    height: 2px;
    background: var(--color-border);
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
}

.gen-timeline-connector.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    animation: connectorFill 2s ease-in-out forwards;
}

.gen-timeline-connector.completed {
    background: var(--color-success);
}

@keyframes connectorFill {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Progress Bar */
.gen-progress-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.gen-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.gen-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.gen-progress-glow {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.gen-progress-info {
    display: flex;
    justify-content: center;
    margin-top: var(--space-2);
}

.gen-progress-percent {
    font-size: var(--text-lg);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats Counter */
.gen-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin: var(--space-4) 0;
}

.gen-stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.gen-stat-icon {
    font-size: 1.5rem;
    animation: statIconBounce 2s ease-in-out infinite;
}

@keyframes statIconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.gen-stat-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.gen-stat-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-accent);
    font-family: var(--font-mono);
    min-width: 60px;
}

.gen-stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Tips Carousel */
.gen-tips {
    width: 100%;
    max-width: 500px;
    margin: var(--space-4) auto 0;
    padding: var(--space-5);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.gen-tips::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: tipShimmer 3s ease-in-out infinite;
}

@keyframes tipShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.gen-tips-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.gen-tips-icon {
    font-size: 1.2rem;
}

.gen-tips-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gen-tips-content {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.gen-tips-content.fade-out {
    animation: tipFadeOut 0.3s ease-out forwards;
}

.gen-tips-content.fade-in {
    animation: tipFadeIn 0.3s ease-in forwards;
}

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

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

/* Responsive */
@media (max-width: 640px) {
    .gen-main-animation {
        width: 140px;
        height: 140px;
    }
    
    .gen-brain-core {
        width: 80px;
        height: 80px;
    }
    
    .gen-timeline {
        flex-wrap: wrap;
        gap: var(--space-3);
    }
    
    .gen-timeline-connector {
        display: none;
    }
    
    .gen-stats {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .gen-stat-item {
        justify-content: center;
    }
    
    #gen-status-text {
        min-width: auto;
        text-align: center;
    }
    
    .gen-title {
        flex-direction: column;
        gap: var(--space-2);
    }
}

/* =====================================================
   HISTORY PANEL
   ===================================================== */

.history-panel {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.history-panel.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.history-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.history-panel.open .history-backdrop {
    opacity: 1;
}

/* Sidebar */
.history-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.history-panel.open .history-sidebar {
    transform: translateX(0);
}

/* Header */
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
}

.history-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.history-title h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
}

.history-icon {
    font-size: 1.4rem;
}

.history-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.history-close {
    color: var(--color-text-muted);
}

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

/* Toolbar */
.history-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.history-search {
    flex: 1;
    position: relative;
}

.history-search .search-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.history-search-input {
    width: 100%;
    padding: var(--space-2) var(--space-3) var(--space-2) var(--space-10);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

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

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

.history-actions {
    display: flex;
    gap: var(--space-1);
}

.history-actions .btn-icon {
    width: 36px;
    height: 36px;
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.history-actions .btn-icon:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

.history-actions .btn-icon.danger:hover {
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
}

/* Storage indicator */
.history-storage {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-5);
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
}

.storage-bar {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.storage-fill.warning {
    background: var(--color-warning);
}

.storage-fill.danger {
    background: var(--color-error);
}

.storage-text {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* History List */
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* History Item */
.history-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    transition: all var(--transition-fast);
    cursor: default;
}

.history-item:hover {
    border-color: var(--color-border-hover);
    background: var(--color-surface-hover);
}

.history-item:last-child {
    margin-bottom: 0;
}

/* Item Thumbnail */
.history-item-thumbnail {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
}

.history-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-item-thumbnail .no-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

/* Item Content */
.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.history-item-score {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-accent);
}

.history-item-score .score-icon {
    font-size: 0.9em;
}

.history-item-provider {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    padding: 2px var(--space-2);
    background: var(--color-bg-primary);
    border-radius: var(--radius-sm);
}

.history-item-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Item Actions */
.history-item-actions {
    display: flex;
    gap: var(--space-1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-item-actions .btn-icon {
    width: 32px;
    height: 32px;
    color: var(--color-text-muted);
    background: var(--color-bg-primary);
    border-radius: var(--radius-md);
}

.history-item-actions .btn-icon:hover {
    color: var(--color-text-primary);
    background: var(--color-surface);
}

.history-item-actions .btn-icon.danger:hover {
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
}

/* Empty State */
.history-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
}

.history-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.history-empty p {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2);
}

.history-empty span {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* Header History Button */
.history-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
}

.history-btn .history-btn-icon {
    font-size: 1.1rem;
}

.history-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    background: var(--color-accent);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-badge[hidden] {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .history-sidebar {
        width: 100%;
    }
    
    .history-toolbar {
        flex-wrap: wrap;
    }
    
    .history-search {
        width: 100%;
        order: 2;
    }
    
    .history-actions {
        order: 1;
        margin-left: auto;
    }
    
    .history-item-actions {
        opacity: 1;
    }
    
    .history-item {
        flex-wrap: wrap;
    }
    
    .history-item-content {
        flex: 1 1 calc(100% - 70px);
    }
    
    .history-item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: var(--space-2);
        padding-top: var(--space-2);
        border-top: 1px solid var(--color-border);
    }
}

/* History Thumbnails in Upload Zone */
.history-thumbnail {
    position: relative;
}

.history-thumbnail-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.9);
    color: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

.history-images-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.history-images-info .info-icon {
    font-size: 1.2rem;
}

/* =====================================================
   IMAGES ANALYSIS SECTION
   ===================================================== */

.images-analysis-section {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.images-analysis-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.images-analysis-section .section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.images-analysis-section .section-title h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
}

.images-analysis-section .section-icon {
    font-size: 1.5rem;
}

.images-analysis-section .images-count {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-full);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.status-badge.success {
    color: var(--color-success);
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.images-analysis-section .section-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

.images-analysis-section .section-description strong {
    color: var(--color-accent);
}

/* Analysis Cards */
.analysis-cards {
    display: grid;
    gap: var(--space-4);
}

.image-analysis-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.analysis-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
}

.analysis-image-number {
    font-weight: 600;
    font-size: var(--text-sm);
}

.analysis-status {
    font-size: var(--text-xs);
    color: var(--color-success);
}

.analysis-card-body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.analysis-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.analysis-textarea {
    width: 100%;
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    resize: vertical;
    transition: all var(--transition-fast);
}

.analysis-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Color & Style Tags */
.color-tags,
.style-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.color-tag,
.style-tag {
    display: inline-flex;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.color-tag {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.1));
    color: var(--color-accent);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.style-tag {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.details-list {
    margin: 0;
    padding-left: var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.details-list li {
    margin-bottom: var(--space-1);
}

/* =====================================================
   EDITABLE RESULT BLOCKS
   ===================================================== */

.result-block .block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-block .block-actions {
    display: flex;
    gap: var(--space-2);
}

.result-block .edit-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.result-block .edit-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
    border-color: var(--color-border);
}

.result-block .edit-btn.active {
    color: var(--color-accent);
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--color-accent);
}

/* Edit Mode */
.block-edit {
    padding: var(--space-4);
}

.edit-input,
.edit-textarea {
    width: 100%;
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.edit-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: var(--font-mono);
}

.edit-input:focus,
.edit-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Character Counter */
.char-counter {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.char-counter.ok .char-current {
    color: var(--color-success);
}

.char-counter.warning .char-current {
    color: var(--color-warning);
}

.char-counter.danger .char-current {
    color: var(--color-error);
}

.char-help {
    margin-left: auto;
    font-style: italic;
}

/* Edit Actions */
.edit-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

/* =====================================================
   PROCEDURE LOG SECTION (HISTORY)
   ===================================================== */

.procedure-log {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-top: var(--space-4);
    overflow: hidden;
}

.procedure-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.procedure-log-header:hover {
    background: var(--color-surface-hover);
}

.procedure-log-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
}

.procedure-log-toggle {
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

.procedure-log.open .procedure-log-toggle {
    transform: rotate(180deg);
}

.procedure-log-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.procedure-log.open .procedure-log-content {
    max-height: 2000px;
}

.procedure-log-inner {
    padding: var(--space-4);
}

/* Log Steps */
.log-step {
    position: relative;
    padding-left: var(--space-8);
    padding-bottom: var(--space-4);
    border-left: 2px solid var(--color-border);
    margin-left: var(--space-3);
}

.log-step:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.log-step-icon {
    position: absolute;
    left: -13px;
    top: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 12px;
}

.log-step.success .log-step-icon {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.log-step.processing .log-step-icon {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

.log-step.error .log-step-icon {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.log-step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.log-step-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.log-step-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.log-step-details {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    background: var(--color-bg-elevated);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
}

.log-step-details pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-mono);
}

.log-step-details .log-data {
    display: grid;
    gap: var(--space-1);
}

.log-step-details .log-data-item {
    display: flex;
    gap: var(--space-2);
}

.log-step-details .log-data-label {
    color: var(--color-text-muted);
    min-width: 100px;
}

.log-step-details .log-data-value {
    color: var(--color-text-primary);
}

/* =====================================================
   PROCEDURE LOG MODAL
   ===================================================== */

.procedure-log-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.procedure-log-modal.open {
    opacity: 1;
}

.procedure-log-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.procedure-log-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
}

.procedure-log-modal.open .procedure-log-modal-content {
    transform: scale(1) translateY(0);
}

.procedure-log-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-elevated);
    border-bottom: 1px solid var(--color-border);
}

.procedure-log-modal-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 600;
}

.procedure-log-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.procedure-log-close:hover {
    color: var(--color-text-primary);
    background: var(--color-surface-hover);
}

.procedure-log-summary {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
}

.summary-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.summary-item.success {
    color: var(--color-success);
}

.summary-item.error {
    color: var(--color-error);
}

.procedure-log-steps {
    padding: var(--space-5);
    overflow-y: auto;
    max-height: calc(85vh - 150px);
}

.procedure-log-steps .log-step {
    margin-left: var(--space-3);
}

.procedure-log-steps .log-step-message {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-1);
}

/* =====================================================
   HISTORY ITEM BADGES
   ===================================================== */

.history-item-badges {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.item-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-elevated);
}

.item-badge.vision {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
}

.item-badge.log {
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-accent);
}

.item-badge.time {
    background: var(--color-surface-hover);
    color: var(--color-text-muted);
}

.thumbnail-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.history-item-thumbnail {
    position: relative;
}

/* =====================================================
   IMAGE ANALYSIS STEP - REDESIGNED FOR BETTER UX
   ===================================================== */

.images-analysis-step {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
}

/* Analysis States */
.analysis-state {
    text-align: center;
}

/* ===== PENDING STATE - CTA CARD ===== */
.analysis-cta-card {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(34, 197, 94, 0.08));
    border: 2px dashed rgba(139, 92, 246, 0.4);
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
}

.analysis-cta-card:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(34, 197, 94, 0.12));
}

.analysis-cta-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 16px;
    background: linear-gradient(135deg, #8b5cf6, #22c55e);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.badge-pulse {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: badgePulse 1.5s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.analysis-cta-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(34, 197, 94, 0.2));
    border-radius: 50%;
    color: var(--color-accent);
}

.analysis-cta-icon svg {
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.analysis-cta-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-3);
}

.analysis-cta-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--space-5);
}

.analysis-cta-description strong {
    color: var(--color-accent);
}

/* Big CTA Button */
.btn-analysis-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-family: inherit;
    font-size: var(--text-lg);
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-analysis-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

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

.btn-analysis-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.btn-analysis-arrow {
    font-size: 1.4rem;
    transition: transform var(--transition-fast);
}

.btn-analysis-start:hover .btn-analysis-arrow {
    transform: translateX(5px);
}

.analysis-cta-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.analysis-cta-note svg {
    opacity: 0.7;
}

/* ===== LOADING STATE - AI SCANNER ANIMATION ===== */
.analysis-loader-card.ai-scanner-card {
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-6);
    background: linear-gradient(180deg, rgba(15, 15, 35, 0.95) 0%, rgba(25, 25, 50, 0.9) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-2xl);
    box-shadow: 
        0 0 60px rgba(139, 92, 246, 0.15),
        0 0 100px rgba(34, 197, 94, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.ai-scanner-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Grille de fond type HUD */
.scanner-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 50%;
    opacity: 0.5;
    animation: gridPulse 3s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.95); }
    50% { opacity: 0.6; transform: scale(1); }
}

/* Cercles orbitaux */
.scanner-orbits {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid transparent;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 100%;
    height: 100%;
    border-color: rgba(139, 92, 246, 0.4);
    animation: orbitRotate 8s linear infinite;
}

.orbit-1::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #8b5cf6;
    border-radius: 50%;
    box-shadow: 0 0 10px #8b5cf6, 0 0 20px #8b5cf6;
}

.orbit-2 {
    width: 80%;
    height: 80%;
    border-color: rgba(34, 197, 94, 0.3);
    animation: orbitRotate 6s linear infinite reverse;
}

.orbit-2::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e, 0 0 16px #22c55e;
}

.orbit-3 {
    width: 120%;
    height: 120%;
    border-color: rgba(139, 92, 246, 0.2);
    border-style: dashed;
    animation: orbitRotate 12s linear infinite;
}

@keyframes orbitRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Lignes de scan */
.scanner-lines {
    position: absolute;
    width: 140%;
    height: 140%;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(34, 197, 94, 0.8), 
        transparent
    );
}

.scan-line-h {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation: scanH 2s ease-in-out infinite;
}

.scan-line-v {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    background: linear-gradient(180deg, 
        transparent, 
        rgba(139, 92, 246, 0.8), 
        transparent
    );
    animation: scanV 2.5s ease-in-out infinite;
}

@keyframes scanH {
    0%, 100% { 
        opacity: 0;
        transform: translateY(-50%) scaleX(0.3);
    }
    50% { 
        opacity: 1;
        transform: translateY(-50%) scaleX(1);
    }
}

@keyframes scanV {
    0%, 100% { 
        opacity: 0;
        transform: translateX(-50%) scaleY(0.3);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scaleY(1);
    }
}

/* Œil central IA */
.ai-eye-core {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.5));
}

.eye-svg {
    overflow: visible;
}

.eye-outline {
    animation: eyeBlink 4s ease-in-out infinite;
}

@keyframes eyeBlink {
    0%, 90%, 100% { 
        d: path("M5 30 Q30 5 55 30 Q30 55 5 30");
        opacity: 1;
    }
    95% { 
        d: path("M5 30 Q30 28 55 30 Q30 32 5 30");
        opacity: 0.8;
    }
}

.eye-iris {
    animation: irisLook 5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes irisLook {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-2px, 1px); }
    75% { transform: translate(1px, 2px); }
}

.eye-pupil {
    animation: pupilPulse 2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes pupilPulse {
    0%, 100% { r: 5; }
    50% { r: 4; }
}

.eye-scan-ring {
    animation: scanRingRotate 3s linear infinite;
    transform-origin: center;
}

@keyframes scanRingRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.eye-highlight {
    animation: highlightShimmer 2s ease-in-out infinite;
}

@keyframes highlightShimmer {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

/* Points de données flottants */
.data-points {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.data-point {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 8px;
    color: #22c55e;
    text-shadow: 0 0 10px #22c55e;
    animation: dataFloat 2s ease-in-out infinite;
    animation-delay: var(--delay);
    transform: translate(var(--x), var(--y));
}

@keyframes dataFloat {
    0%, 100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(0);
    }
    20%, 80% {
        opacity: 1;
        transform: translate(var(--x), var(--y)) scale(1);
    }
    50% {
        transform: translate(calc(var(--x) * 0.8), calc(var(--y) * 0.8)) scale(1.2);
    }
}

/* Pulse central */
.scanner-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(139, 92, 246, 0.5);
    animation: pulseExpand 2s ease-out infinite;
}

@keyframes pulseExpand {
    0% {
        width: 60px;
        height: 60px;
        opacity: 0.8;
    }
    100% {
        width: 160px;
        height: 160px;
        opacity: 0;
    }
}

/* Textes */
.scanner-text-container {
    text-align: center;
    margin-bottom: var(--space-5);
}

.scanner-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 var(--space-2);
    letter-spacing: -0.02em;
}

.scanner-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.status-dots span {
    animation: dotsWave 1.4s ease-in-out infinite;
    display: inline-block;
}

.status-dots span:nth-child(1) { animation-delay: 0s; }
.status-dots span:nth-child(2) { animation-delay: 0.2s; }
.status-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotsWave {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Barre de progression améliorée */
.scanner-progress {
    position: relative;
    width: 100%;
}

.scanner-progress-track {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.scanner-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #8b5cf6, #22c55e, #8b5cf6);
    background-size: 200% 100%;
    border-radius: var(--radius-full);
    animation: progressSlide 2s ease-in-out infinite, progressGradient 3s linear infinite;
}

@keyframes progressSlide {
    0% { left: -30%; width: 30%; }
    50% { left: 40%; width: 50%; }
    100% { left: 100%; width: 30%; }
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.scanner-progress-glow {
    position: absolute;
    top: -4px;
    left: 0;
    height: 14px;
    width: 60px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.6) 0%, transparent 70%);
    border-radius: var(--radius-full);
    animation: glowMove 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowMove {
    0% { left: -10%; }
    50% { left: 50%; }
    100% { left: 100%; }
}

.scanner-progress-particles {
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 20px;
    pointer-events: none;
}

.scanner-progress-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #22c55e;
    border-radius: 50%;
    animation: particleFloat 2s ease-out infinite;
    box-shadow: 0 0 6px #22c55e;
}

.scanner-progress-particles span:nth-child(1) { left: 10%; animation-delay: 0s; }
.scanner-progress-particles span:nth-child(2) { left: 30%; animation-delay: 0.3s; }
.scanner-progress-particles span:nth-child(3) { left: 50%; animation-delay: 0.6s; }
.scanner-progress-particles span:nth-child(4) { left: 70%; animation-delay: 0.9s; }
.scanner-progress-particles span:nth-child(5) { left: 90%; animation-delay: 1.2s; }

@keyframes particleFloat {
    0% { transform: translateY(10px); opacity: 0; }
    50% { transform: translateY(-5px); opacity: 1; }
    100% { transform: translateY(-15px); opacity: 0; }
}

/* Responsive */
@media (max-width: 480px) {
    .ai-scanner-container {
        width: 140px;
        height: 140px;
    }
    
    .scanner-title {
        font-size: var(--text-xl);
    }
}

/* ===== RESULTS STATE ===== */
.analysis-success-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.analysis-success-header .success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(34, 197, 94, 0.15);
    border-radius: 50%;
    color: var(--color-success);
}

.analysis-success-header .success-text {
    text-align: left;
}

.analysis-success-header .success-text h3 {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-success);
    margin: 0 0 2px;
}

.analysis-success-header .success-text p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.analysis-results-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    text-align: left;
    margin-bottom: var(--space-4);
}

.analysis-results-actions {
    text-align: center;
}

#reanalyze-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* ===== ERROR STATE ===== */
.analysis-error-card {
    max-width: 400px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-xl);
    text-align: center;
}

.analysis-error-card .error-icon {
    color: var(--color-error);
    opacity: 0.8;
    margin-bottom: var(--space-4);
}

.analysis-error-card h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-2);
}

.analysis-error-card .error-message {
    font-size: var(--text-sm);
    color: var(--color-error);
    margin: 0 0 var(--space-5);
}

#retry-analysis-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* Continue Button After Analysis */
.btn-continue-after-analysis {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(139, 92, 246, 0.3); }
}

/* Analysis Result Cards */
.analysis-result-card {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.analysis-result-card:hover {
    border-color: rgba(34, 197, 94, 0.4);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.analysis-card-preview {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.analysis-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.analysis-image-number {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent), var(--color-success));
    color: white;
    font-size: var(--text-sm);
    font-weight: 700;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
}

.analysis-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.analysis-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.analysis-field-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analysis-field-label .label-icon {
    font-size: 0.9rem;
}

.analysis-description-textarea {
    width: 100%;
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    resize: vertical;
    transition: all var(--transition-fast);
}

.analysis-description-textarea:focus {
    outline: none;
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.analysis-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.analysis-tag {
    display: inline-flex;
    padding: 4px 10px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.analysis-tag.color-tag {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.1));
    color: var(--color-accent);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.analysis-tag.style-tag {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.analysis-details-list {
    margin: 0;
    padding-left: var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.analysis-details-list li {
    margin-bottom: var(--space-1);
}

/* Responsive */
@media (max-width: 640px) {
    .analysis-result-card {
        flex-direction: column;
    }
    
    .analysis-card-preview {
        width: 100%;
        height: 180px;
    }
}

.image-descriptions-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.image-description-card {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

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

.image-description-preview {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.image-description-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-description-preview .image-number {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: white;
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: var(--radius-full);
}

.image-description-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.image-description-label {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.image-description-label .label-text {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.image-description-label .label-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.image-description-textarea {
    flex: 1;
    width: 100%;
    min-height: 80px;
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    resize: vertical;
    transition: all var(--transition-fast);
}

.image-description-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.image-description-textarea::placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.no-images-message {
    text-align: center;
    color: var(--color-text-muted);
    padding: var(--space-6);
}

/* Responsive */
@media (max-width: 640px) {
    .image-description-card {
        flex-direction: column;
    }
    
    .image-description-preview {
        width: 100%;
        height: 150px;
    }
}

/* ===========================================
   LANGUAGE SELECTOR
   =========================================== */

.language-selector {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.language-btn:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-hover);
}

.language-btn.active {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-glow);
}

.language-btn .lang-flag {
    font-size: 1.2em;
    line-height: 1;
}

.language-btn .lang-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.language-btn .lang-arrow {
    transition: transform var(--transition-fast);
}

.language-btn.active .lang-arrow {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.language-option:hover {
    background: var(--color-bg-tertiary);
}

.language-option.active {
    background: linear-gradient(135deg, var(--color-accent-glow), transparent);
    color: var(--color-accent);
}

.language-option .lang-flag {
    font-size: 1.4em;
    line-height: 1;
}

.language-option .lang-name {
    flex: 1;
    font-weight: 500;
}

.language-option .lang-check {
    color: var(--color-accent);
    font-weight: 700;
}

/* ===========================================
   LANGUAGE MODAL
   =========================================== */

.language-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-modal.visible {
    opacity: 1;
}

.language-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.language-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--space-8);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.language-modal.visible .language-modal-content {
    transform: scale(1);
}

.language-modal-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.language-modal-icon {
    font-size: 3rem;
    margin-bottom: var(--space-3);
    animation: globePulse 2s ease-in-out infinite;
}

@keyframes globePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.language-modal-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.language-modal-detected {
    text-align: center;
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--color-accent-glow), transparent);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-accent);
}

.detected-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-2) 0;
}

.detected-language {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

.detected-flag {
    font-size: 2rem;
}

.detected-name {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.language-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

@media (max-width: 480px) {
    .language-modal-grid {
        grid-template-columns: 1fr;
    }
}

.language-modal-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.language-modal-option:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-hover);
}

.language-modal-option.selected {
    background: linear-gradient(135deg, var(--color-accent-glow), var(--color-bg-secondary));
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.language-modal-option .modal-lang-flag {
    font-size: 1.5em;
}

.language-modal-option .modal-lang-name {
    font-weight: 600;
}

.language-modal-actions {
    display: flex;
    justify-content: center;
}

.language-modal-actions .btn {
    min-width: 200px;
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-8);
}

/* ===========================================
   RTL SUPPORT (Arabic)
   =========================================== */

html[dir="rtl"] {
    direction: rtl;
}

body.rtl .header-container,
body.rtl .main-nav,
body.rtl .header-actions {
    flex-direction: row-reverse;
}

body.rtl .logo {
    flex-direction: row-reverse;
}

body.rtl .logo-text {
    text-align: right;
}

body.rtl .nav-link {
    flex-direction: row-reverse;
}

body.rtl .language-dropdown {
    right: auto;
    left: 0;
}

body.rtl .language-option {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .form-group {
    text-align: right;
}

body.rtl .form-label {
    text-align: right;
}

body.rtl .form-input,
body.rtl .form-select,
body.rtl .form-textarea {
    text-align: right;
}

body.rtl .step-actions {
    flex-direction: row-reverse;
}

body.rtl .btn svg {
    margin-left: var(--space-2);
    margin-right: 0;
}

body.rtl .btn-prev svg {
    margin-right: var(--space-2);
    margin-left: 0;
    transform: rotate(180deg);
}

body.rtl .btn-next svg,
body.rtl .btn-primary svg:last-child {
    transform: rotate(180deg);
}

body.rtl .progress-steps {
    flex-direction: row-reverse;
}

body.rtl .result-block-header {
    flex-direction: row-reverse;
}

body.rtl .result-block-actions {
    flex-direction: row-reverse;
}

body.rtl .summary-item {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .upload-zone {
    direction: rtl;
}

body.rtl .uploaded-image .remove-image {
    left: var(--space-2);
    right: auto;
}

body.rtl .hero-content {
    text-align: right;
}

body.rtl .step-header {
    text-align: right;
}

body.rtl .analysis-cta-card {
    text-align: right;
}

body.rtl .generation-result {
    text-align: right;
}

body.rtl .result-meta {
    flex-direction: row-reverse;
}

body.rtl .history-btn {
    flex-direction: row-reverse;
}

/* Fix for icons in RTL */
body.rtl [class*="icon-arrow"],
body.rtl .lang-arrow {
    transform: rotate(180deg);
}

body.rtl .language-btn.active .lang-arrow {
    transform: rotate(0deg);
}

/* ================================
   CATEGORY SELECTOR
================================ */

.category-selector-wrapper {
    width: 100%;
}

.category-step {
    animation: categoryFadeIn 0.3s ease-out;
}

.category-step-hidden {
    display: none !important;
}

.category-step-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.category-step-number {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-sm);
    color: white;
    flex-shrink: 0;
}

.category-step-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.category-back-btn {
    width: 36px;
    height: 36px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
}

.category-back-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
}

/* Category Grid */
.category-grid {
    display: grid;
    gap: var(--space-4);
}

.category-grid-main {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.category-grid-sub {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.category-grid-items {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* Category Card */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
}

.category-card:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.category-card:active {
    transform: translateY(0);
}

.category-card-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.category-card-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.3;
}

.category-card-count {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Sub-category & Item cards */
.category-card-sub {
    padding: var(--space-4);
}

.category-card-sub .category-card-icon {
    font-size: 1.75rem;
}

.category-card-item {
    padding: var(--space-3) var(--space-4);
    flex-direction: row;
    justify-content: center;
}

.category-card-item .category-card-name {
    font-size: var(--text-sm);
}

/* Selected badge */
.category-selected-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-accent-hover);
    margin-bottom: var(--space-4);
}

.category-selected-badges {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}

.category-badge-arrow {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* Skip button */
.category-skip-btn {
    display: block;
    margin: var(--space-6) auto 0;
    padding: var(--space-3) var(--space-6);
    background: transparent;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.category-skip-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(139, 92, 246, 0.05);
}

/* Category Summary */
.category-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
}

.category-summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    color: var(--color-success);
    font-weight: 600;
}

.category-summary-header svg {
    flex-shrink: 0;
}

.category-summary-content {
    margin-bottom: var(--space-4);
}

.category-path {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.category-path-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

.category-path-main {
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-accent-hover);
}

.category-path-sub {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
}

.category-path-item-final {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.category-path-arrow {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.category-change-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.category-change-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Animations */
@keyframes categorySlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Responsive */
@media (max-width: 640px) {
    .category-grid-main {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid-sub {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-card {
        padding: var(--space-4) var(--space-3);
    }
    
    .category-card-icon {
        font-size: 2rem;
    }
    
    .category-path {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-path-arrow {
        display: none;
    }
    
    .category-selected-badges {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-badge-arrow {
        display: none;
    }
}

/* RTL Support */
body.rtl .category-step-header {
    flex-direction: row-reverse;
}

body.rtl .category-back-btn svg {
    transform: rotate(180deg);
}

body.rtl .category-path {
    flex-direction: row-reverse;
}

body.rtl .category-selected-badges {
    flex-direction: row-reverse;
}

body.rtl .category-change-btn {
    flex-direction: row-reverse;
}

/* ================================
   FIELD PREFILLED ANIMATION
   Animation pour les champs pré-remplis automatiquement par l'analyse IA
================================ */

@keyframes fieldPrefilledPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

@keyframes fieldPrefilledHighlight {
    0% {
        background-color: rgba(74, 222, 128, 0.15);
        border-color: var(--success-color);
    }
    100% {
        background-color: transparent;
        border-color: var(--border-color);
    }
}

/* Animation du groupe de champ */
.form-group.field-prefilled {
    animation: fieldPrefilledPulse 0.6s ease-out;
    position: relative;
}

.form-group.field-prefilled::after {
    content: '✓ Auto';
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.7rem;
    color: var(--success-color);
    background: rgba(74, 222, 128, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    animation: fadeOut 2.5s ease-out forwards;
}

/* Animation du champ lui-même */
.form-group.field-prefilled .form-input,
.form-group.field-prefilled .form-select,
.form-group.field-prefilled .form-textarea {
    border-color: var(--success-color) !important;
    background-color: rgba(74, 222, 128, 0.08);
    animation: fieldPrefilledHighlight 2.5s ease-out forwards;
}

/* Fallback si le parent n'est pas trouvé */
.form-input.field-prefilled,
.form-select.field-prefilled,
.form-textarea.field-prefilled {
    border-color: var(--success-color) !important;
    background-color: rgba(74, 222, 128, 0.08);
    animation: fieldPrefilledHighlight 2.5s ease-out forwards;
}

/* Animation de fade out */
@keyframes fadeOut {
    0%, 80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Notification de pré-remplissage */
.prefill-notification {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(74, 222, 128, 0.05));
    border: 1px solid var(--success-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    color: var(--success-color);
    font-size: 0.9rem;
}

.prefill-notification svg {
    flex-shrink: 0;
}

/* ================================
   CONFIRMATION MODAL
   Modale de confirmation avant passage à l'étape suivante
================================ */

.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.confirmation-modal[hidden] {
    display: none;
}

.confirmation-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.confirmation-modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirmation-modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.confirmation-modal-icon svg {
    color: var(--primary-color);
}

.confirmation-modal-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.confirmation-modal-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-5);
}

.confirmation-modal-summary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    max-height: 250px;
    overflow-y: auto;
}

.confirmation-summary-section {
    margin-bottom: var(--space-3);
}

.confirmation-summary-section:last-child {
    margin-bottom: 0;
}

.confirmation-summary-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.confirmation-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-1) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

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

.confirmation-summary-label {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: var(--space-2);
}

.confirmation-summary-value {
    color: var(--text-primary);
    text-align: right;
    word-break: break-word;
    font-weight: 500;
}

.confirmation-summary-value.empty {
    color: var(--warning-color);
    font-style: italic;
}

.confirmation-summary-value.filled {
    color: var(--success-color);
}

.confirmation-modal-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.confirmation-modal-actions .btn {
    min-width: 140px;
}

/* Animation d'entrée de la modale */
.confirmation-modal.entering .confirmation-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Animation de sortie */
.confirmation-modal.leaving .confirmation-modal-backdrop {
    animation: fadeOut 0.2s ease-out forwards;
}

.confirmation-modal.leaving .confirmation-modal-content {
    animation: modalSlideOut 0.2s ease-out forwards;
}

@keyframes modalSlideOut {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* Indicateur de champs manquants */
.confirmation-missing-warning {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid var(--warning-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    color: var(--warning-color);
    font-size: 0.85rem;
}

.confirmation-missing-warning svg {
    flex-shrink: 0;
}

/* Compteur de champs */
.confirmation-field-count {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.confirmation-count-item {
    text-align: center;
}

.confirmation-count-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.confirmation-count-number.filled {
    color: var(--success-color);
}

.confirmation-count-number.empty {
    color: var(--warning-color);
}

.confirmation-count-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* ================================
   SEO AI GENERATOR BUTTON
================================ */
.seo-ai-generator {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(217, 70, 239, 0.1) 100%);
    border: 1px dashed var(--color-accent);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    text-align: center;
}

.btn-ai-generate {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-ai-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

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

.btn-ai-generate.loading {
    pointer-events: none;
}

.btn-ai-generate.loading .btn-ai-icon {
    animation: spin 1s linear infinite;
}

.btn-ai-generate .btn-ai-icon svg {
    width: 20px;
    height: 20px;
}

.btn-ai-generate .btn-ai-sparkle {
    font-size: 1.2em;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

.seo-ai-hint {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ================================
   FIELD PRE-FILLED ANIMATION
================================ */
.field-prefilled {
    animation: fieldHighlight 2.5s ease-out;
}

.form-group.field-prefilled {
    position: relative;
}

.form-group.field-prefilled::after {
    content: '✓ Rempli automatiquement';
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.7rem;
    color: var(--color-success);
    background: rgba(34, 197, 94, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    animation: fadeInOut 2.5s ease-out forwards;
}

@keyframes fieldHighlight {
    0% { 
        box-shadow: 0 0 0 2px var(--color-success);
        background: rgba(34, 197, 94, 0.1);
    }
    100% { 
        box-shadow: none;
        background: transparent;
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-5px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ================================
   ANALYSIS RESULTS IMPROVEMENTS
================================ */
.analysis-results-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* Category suggestion card improvements */
.category-suggestion-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.suggestion-icon {
    font-size: 1.5rem;
}

.suggestion-header h3 {
    flex: 1;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.confidence-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.confidence-badge.high {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

.confidence-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.confidence-badge.low {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
}

.suggestion-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
    .suggestion-body {
        grid-template-columns: 1fr;
    }
}

.detected-category-info p {
    margin: var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.detected-category-info strong {
    color: var(--color-text-primary);
}

.suggested-attributes h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}

.suggested-attributes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggested-attributes li {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    padding: var(--space-1) 0;
}

.suggested-attributes li strong {
    color: var(--color-text-primary);
}

.suggestion-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.apply-suggestion-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.suggestion-applied {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-success);
    font-weight: 500;
    padding: var(--space-3);
    background: rgba(34, 197, 94, 0.1);
    border-radius: var(--radius-md);
}

/* ================================
   CONTINUE AFTER ANALYSIS BUTTON
================================ */
.btn-continue-after-analysis {
    background: linear-gradient(135deg, var(--color-success) 0%, #16a34a 100%);
    border: none;
    animation: pulseGlow 2s ease-in-out infinite;
}

.btn-continue-after-analysis:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: translateY(-1px);
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 20px 5px rgba(34, 197, 94, 0.2); }
}

/* Hide upload zone transition */
#upload-zone,
#uploaded-images {
    transition: opacity var(--transition-base), max-height var(--transition-slow);
}

/* Analysis state transitions */
.analysis-state {
    transition: opacity var(--transition-base);
}

/* Step separator improvements */
.form-step {
    min-height: 400px;
}

/* Form loading state */
.form-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--color-text-muted);
}

.form-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-4);
}

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