/* Styles CSS pour TOPOS - Reproduction exacte du design Tailwind */
:root {
    /* Couleurs primaires (dérivées du logo) */
    --primary-50: #E9F6F4;
    /* Nuances complémentaires pour compatibilité utilitaires */
    --primary-100: #DDF3EF;
    --primary-200: #CBEDE8;
    --primary-700: #1F5B56;
    --primary-800: #1B4E4A;
    --primary-900: #153F3C;
    
    /* Couleurs d'accent (beige/doré adouci) */
    --accent-200: #F4E6C3;
    --accent-600: #C99A3D;
    
    /* Couleurs slate standards */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* Couleurs additionnelles (feedback/alertes) */
    --green-500: #22c55e;
    --yellow-50: #fffbeb;
    --yellow-200: #fde68a;
    --yellow-800: #92400e;
    --amber-600: #d97706;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    line-height: 1.5;
    color: var(--slate-900);
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utilitaires de base */
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-4xl { max-width: 56rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.p-8 { padding: 2rem; }
.p-6 { padding: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }

/* Flexbox */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Texte */
.text-center { text-align: center; }
.text-left { text-left: left; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }

/* Couleurs de texte */
.text-slate-900 { color: var(--slate-900); }
.text-slate-800 { color: var(--slate-800); }
.text-slate-700 { color: var(--slate-700); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-400 { color: var(--slate-400); }
.text-white { color: #ffffff; }
.text-primary-700 { color: var(--primary-700); }
.text-primary-800 { color: var(--primary-800); }
.text-primary-900 { color: var(--primary-900); }
.text-accent-600 { color: var(--accent-600); }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.text-yellow-800 { color: var(--yellow-800); }
.text-amber-600 { color: var(--amber-600); }

/* Poids de police */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* Backgrounds */
.bg-white { background-color: #ffffff; }
.bg-primary-50 { background-color: var(--primary-50); }
.bg-primary-100 { background-color: var(--primary-100); }
.bg-primary-200 { background-color: var(--primary-200); }
.bg-primary-700 { background-color: var(--primary-700); }
.bg-primary-800 { background-color: var(--primary-800); }
.bg-primary-900 { background-color: var(--primary-900); }
.bg-accent-200 { background-color: var(--accent-200); }
.bg-slate-50 { background-color: var(--slate-50); }
.bg-slate-100 { background-color: var(--slate-100); }
.bg-slate-200 { background-color: var(--slate-200); }
.bg-red-600 { background-color: #dc2626; }
.bg-red-700 { background-color: #b91c1c; }
.bg-slate-800 { background-color: var(--slate-800); }
.bg-slate-900 { background-color: var(--slate-900); }
.bg-green-500 { background-color: var(--green-500); }
.bg-yellow-50 { background-color: var(--yellow-50); }

/* Backgrounds avec gradient */
.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--from), var(--to));
}
.from-primary-50 { --from: var(--primary-50); }
.to-white { --to: #ffffff; }

/* Borders */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }
.border-slate-100 { border-color: var(--slate-100); }
.border-slate-200 { border-color: var(--slate-200); }
.border-slate-300 { border-color: var(--slate-300); }
.border-primary-200 { border-color: var(--primary-200); }
.border-primary-700 { border-color: var(--primary-700); }
.border-primary-800 { border-color: var(--primary-800); }
.border-yellow-200 { border-color: var(--yellow-200); }
.border-t-transparent { border-top-color: transparent; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-r { border-right-width: 1px; }
.border-l { border-left-width: 1px; }

/* Border radius */
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }

/* Shadow */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

/* Tailles */
.h-24 { height: 6rem; }
.w-24 { width: 6rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
.h-16 { height: 4rem; }
.w-16 { width: 4rem; }
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }
.h-3 { height: 0.75rem; }
.w-3 { width: 0.75rem; }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02);
}

.btn-primary {
    background-color: var(--primary-800);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-900);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(21, 63, 60, 0.18);
}

.btn-secondary {
    background-color: #fff;
    color: var(--primary-800);
    border: 1px solid var(--primary-200);
}

.btn-secondary:hover {
    background-color: var(--primary-50);
    border-color: var(--primary-200);
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

/* Bouton succès */
.btn-success {
    background-color: #16a34a; /* green-600 */
    color: #ffffff;
}

.btn-success:hover {
    background-color: #15803d; /* green-700 */
    box-shadow: 0 6px 12px rgba(21, 128, 61, 0.18);
}

/* Bouton fantôme (ghost) */
.btn-ghost {
    background-color: transparent;
    color: var(--primary-800);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background-color: var(--primary-50);
    border-color: var(--primary-200);
}

/* Bouton outline */
.btn-outline {
    background-color: #ffffff;
    color: var(--primary-800);
    border: 1px solid var(--primary-800);
}

.btn-outline:hover {
    background-color: var(--primary-50);
}

/* Transitions */
.transition-all { transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-colors { transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-transform { transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1); }

/* Hover states */
.hover\:bg-primary-50:hover { background-color: var(--primary-50); }
.hover\:bg-primary-200:hover { background-color: var(--primary-200); }
.hover\:bg-primary-700:hover { background-color: var(--primary-700); }
.hover\:bg-primary-900:hover { background-color: var(--primary-900); }
.hover\:bg-primary-50\/80:hover { background-color: rgba(236, 248, 246, 0.8); }
.hover\:bg-accent-200\/80:hover { background-color: rgba(254, 234, 161, 0.8); }
.hover\:bg-slate-50:hover { background-color: var(--slate-50); }
.hover\:bg-slate-100:hover { background-color: var(--slate-100); }
.hover\:bg-slate-300:hover { background-color: var(--slate-300); }
.hover\:text-primary-700:hover { color: var(--primary-700); }
.hover\:text-primary-900:hover { color: var(--primary-900); }
.hover\:text-slate-600:hover { color: var(--slate-600); }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:translate-x-1:hover { transform: translateX(0.25rem); }

/* Focus states */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 3px rgba(27, 78, 74, 0.15); }

/* Disabled states */
.cursor-not-allowed { cursor: not-allowed; }
.opacity-50 { opacity: 0.5; }

/* Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* Utilitaires personnalisés */
.leading-relaxed { line-height: 1.625; }
.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }
.leading-loose { line-height: 2; }

/* Z-index */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Object fit */
.object-contain { object-fit: contain; }
.object-cover { object-fit: cover; }
.object-fill { object-fit: fill; }
.object-none { object-fit: none; }
.object-scale-down { object-fit: scale-down; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-auto { overflow: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.static { position: static; }

/* Top, right, bottom, left */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-4 { top: 1rem; }
.right-0 { right: 0; }
.right-4 { right: 1rem; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Responsive */
@media (min-width: 768px) {
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .md\:p-12 { padding: 3rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Formulaires */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--slate-300);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-800);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--slate-700);
}

/* Navigation tabs */
.nav-tabs {
    display: flex;
    gap: 0.25rem;
    background: white;
    padding: 0.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    color: var(--slate-600);
}

.nav-tab:hover {
    background-color: var(--slate-100);
    text-decoration: none;
}

.nav-tab.active {
    background-color: var(--primary-800);
    color: white;
}

/* Accessibilité: focus visible sur onglets */
.nav-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 78, 74, 0.15);
    border-radius: 0.75rem;
}

/* Messages d'alerte */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: var(--primary-50);
    color: var(--primary-900);
    border: 1px solid var(--primary-200);
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: var(--slate-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-800);
    transition: width 0.3s ease-in-out;
}

/* Chat styles */
.chat-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--slate-200);
    border-radius: 0.75rem;
    padding: 1rem;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
}

.chat-message.user {
    background-color: var(--primary-800);
    color: white;
    margin-left: 2rem;
}

.chat-message.character {
    background-color: var(--slate-100);
    color: var(--slate-900);
    margin-right: 2rem;
}

/* Quiz styles */
.quiz-option {
    padding: 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    background: white;
}

.quiz-option:hover {
    background-color: var(--slate-50);
    border-color: var(--primary-800);
}

.quiz-option.selected {
    background-color: var(--primary-50);
    border-color: var(--primary-800);
    color: var(--primary-900);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 28rem;
    width: 100%;
    padding: 1.5rem;
}

/* Utilitaires pour les icônes (simulation) */
.icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

/* Police monospace utilitaire */
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* Display utilitaire */
.hidden { display: none !important; }

/* Loading spinner */
.spinner {
    border: 4px solid var(--slate-200);
    border-top: 4px solid var(--primary-800);
    border-radius: 50%;
    width: 4rem;
    height: 4rem;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Badge/tag styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-50);
    color: var(--primary-800);
}

.badge-accent {
    background-color: var(--accent-200);
    color: var(--accent-600);
}

/* Badges complémentaires */
.badge-secondary {
    background-color: var(--slate-100);
    color: var(--slate-700);
}

.badge-success {
    background-color: #dcfce7; /* green-100 */
    color: #166534; /* green-800 */
}

.badge-danger {
    background-color: #fee2e2; /* red-100 */
    color: #991b1b; /* red-800 */
}

.badge-outline {
    background-color: transparent;
    color: var(--primary-800);
    border: 1px solid var(--primary-800);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--slate-200);
}

.table th {
    font-weight: 600;
    color: var(--slate-700);
    background-color: var(--slate-50);
}

.table-hover tbody tr:hover {
    background-color: var(--slate-50);
}