/* ===================================
   VORTEX FACTORY - STYLES
   Design moderne et professionnel
   =================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --text-dark: #111827;
    --text-medium: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

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

/* ===================================
   HEADER
   =================================== */

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 48px;
    animation: pulse 2s infinite;
}

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

.header h1 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
}

.tagline {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

/* ===================================
   SECTIONS
   =================================== */

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* ===================================
   CARD
   =================================== */

.card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px var(--shadow-lg);
}

.card h2 {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.description {
    color: var(--text-medium);
    margin-bottom: 30px;
    font-size: 15px;
}

/* ===================================
   TEXTAREA & INPUT
   =================================== */

#query-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s;
    line-height: 1.6;
}

#query-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.estimate {
    color: var(--text-medium);
    font-size: 14px;
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border);
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-text {
    background: none;
    border: none;
    color: var(--text-medium);
    padding: 10px 0;
    font-size: 15px;
    cursor: pointer;
    margin-top: 20px;
    transition: color 0.3s;
}

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

/* ===================================
   EXAMPLES
   =================================== */

.examples {
    margin-top: 40px;
}

.examples h3 {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 20px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.example-card {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.example-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow-lg);
    background: white;
}

.example-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.example-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ===================================
   PROCESSING SECTION
   =================================== */

.processing-card {
    text-align: center;
}

.loader-container {
    margin: 0 auto 30px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.processing-status {
    font-size: 16px;
    color: var(--text-medium);
    margin-bottom: 30px;
}

.progress-container {
    margin: 30px 0;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
}

.llm-status {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.llm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
    transition: all 0.3s;
}

.llm-item.active {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid var(--primary);
}

.llm-item.completed {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
}

.llm-icon {
    font-size: 24px;
}

.llm-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.time-remaining {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-medium);
}

/* ===================================
   RESULT SECTION
   =================================== */

.result-card {
    text-align: center;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.decision-info,
.justification-info {
    text-align: left;
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
}

.decision-info h3,
.justification-info h3,
.solution-container h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.decision-text,
.justification-text {
    font-size: 15px;
    color: var(--text-medium);
    line-height: 1.6;
}

.solution-container {
    text-align: left;
    margin: 30px 0;
}

.solution-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
    max-height: 400px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

/* ===================================
   ERROR SECTION
   =================================== */

.error-card {
    text-align: center;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-message {
    color: var(--error);
    font-size: 15px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
}

.footer p {
    margin: 5px 0;
    opacity: 0.9;
}

.footer-subtext {
    font-size: 14px;
    opacity: 0.7;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 32px;
    }
    
    .card {
        padding: 25px;
    }
    
    .llm-status {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .example-grid {
        grid-template-columns: 1fr;
    }
}
