/* ============================================
   CONJUGAISON FRANÇAISE - Styles CSS
   Design moderne et responsive
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

/* Variables CSS */
:root {
    /* Couleurs principales */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    
    /* Couleurs de feedback */
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    
    /* Couleurs de difficulté */
    --difficulty-easy: #10b981;
    --difficulty-medium: #f59e0b;
    --difficulty-hard: #ef4444;
    
    /* Neutres */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-md); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 800px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--gray-800) 100%);
    color: var(--white);
    padding: var(--space-lg) 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    font-size: 2rem;
}

.nav {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.nav-link {
    color: var(--gray-300);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--gray-300);
    font-size: 0.9rem;
}

.user-name {
    color: var(--accent);
    font-weight: 600;
}

.btn-logout {
    color: var(--gray-400);
    cursor: pointer;
    transition: color var(--transition-fast);
}

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

/* Main content */
.main {
    padding: var(--space-2xl) 0;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.card-title {
    font-size: 1.25rem;
    margin: 0;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.125rem;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: var(--error);
}

.form-input.success {
    border-color: var(--success);
}

.form-help {
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--gray-500);
}

.form-error {
    color: var(--error);
}

/* Checkboxes & Radio */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-item:hover,
.radio-item:hover {
    border-color: var(--primary-light);
    background: var(--white);
}

.checkbox-item.selected,
.radio-item.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.checkbox-item input,
.radio-item input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
}

/* Grid system */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Spacing utilities */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* Difficulty badges */
.difficulty-easy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--difficulty-easy);
}

.difficulty-medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--difficulty-medium);
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.1);
    color: var(--difficulty-hard);
}

/* Progress bar */
.progress {
    height: 0.75rem;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-bar.success {
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
}

.progress-bar.warning {
    background: linear-gradient(90deg, var(--warning) 0%, var(--accent-light) 100%);
}

.progress-bar.error {
    background: linear-gradient(90deg, var(--error) 0%, #f87171 100%);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.stat-card {
    background: var(--white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-left: 4px solid var(--primary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-display);
}

.stat-label {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

/* Exercise specific styles */
.exercise-container {
    max-width: 700px;
    margin: 0 auto;
}

.question-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.question-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: var(--space-lg);
}

.question-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    opacity: 0.9;
}

.question-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.question-info-item {
    background: rgba(255, 255, 255, 0.15);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
}

.question-body {
    padding: var(--space-xl);
}

.question-prompt {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: var(--space-xl);
}

.question-verb {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary);
}

.question-tense {
    color: var(--gray-500);
    font-size: 1rem;
    display: block;
    margin-top: var(--space-sm);
}

.question-person {
    background: var(--gray-100);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    display: inline-block;
    margin-right: var(--space-md);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.answer-input {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-top: var(--space-lg);
}

.answer-input .form-input {
    flex: 1;
    font-size: 1.25rem;
    text-align: center;
}

/* Feedback */
.feedback {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-top: var(--space-lg);
    display: none;
}

.feedback.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.feedback.correct {
    background: var(--success-light);
    border: 2px solid var(--success);
}

.feedback.incorrect {
    background: var(--error-light);
    border: 2px solid var(--error);
}

.feedback-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.feedback-message {
    font-weight: 600;
    font-size: 1.125rem;
}

.feedback-expected {
    margin-top: var(--space-sm);
    font-size: 1rem;
}

/* Score display */
.score-display {
    text-align: center;
    padding: var(--space-2xl);
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.score-circle.excellent {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.score-circle.good {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.score-circle.average {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.score-circle.poor {
    background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Rules section */
.rules-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-xl);
}

.rules-header {
    background: var(--gray-50);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition-fast);
}

.rules-header:hover {
    background: var(--gray-100);
}

.rules-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.rules-toggle {
    font-size: 1.5rem;
    color: var(--gray-400);
    transition: transform var(--transition-fast);
}

.rules-section.open .rules-toggle {
    transform: rotate(180deg);
}

.rules-content {
    padding: var(--space-lg);
    display: none;
}

.rules-section.open .rules-content {
    display: block;
    animation: slideDown 0.3s ease;
}

.rule-examples {
    background: var(--gray-50);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* History table */
.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.history-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.history-table tr:hover td {
    background: var(--gray-50);
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--secondary) 0%, var(--gray-800) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: var(--space-2xl);
    text-align: center;
}

.login-header h1 {
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.login-body {
    padding: var(--space-xl);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

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

.pulse {
    animation: pulse 0.5s ease;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: var(--space-lg);
}

.tab {
    padding: var(--space-md) var(--space-lg);
    color: var(--gray-500);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: slideIn 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .question-prompt {
        font-size: 1.25rem;
    }
    
    .answer-input {
        flex-direction: column;
    }
    
    .answer-input .btn {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-table {
        display: block;
        overflow-x: auto;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    .tab {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group,
    .radio-group {
        flex-direction: column;
    }
    
    .checkbox-item,
    .radio-item {
        width: 100%;
    }
}

/* Print styles */
@media print {
    .header,
    .btn,
    .nav {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
