/**
 * Styles globaux - Alpha Training 64 Atelier
 * Charte graphique AT64
 */

:root {
    --primary: #2c3e50;
    --secondary: #9b59b6;
    --accent: #e8d5f2;
    --highlight: #f39c12;
    --neutral: #f8f9fa;
    --text-dark: #333;
    --text-light: #fff;
    --text-muted: #666;
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--neutral);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

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

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== HEADER ========== */
.header {
    background: var(--primary);
    color: var(--text-light);
    padding: 20px 0;
    box-shadow: var(--shadow-soft);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}

/* ========== CARDS ========== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 25px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--neutral);
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.card-body {
    margin-bottom: 15px;
}

/* ========== STATS CARDS (Dashboard) ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.primary { background: var(--primary); }
.stat-icon.secondary { background: var(--secondary); }
.stat-icon.highlight { background: var(--highlight); }
.stat-icon.success { background: var(--success); }

.stat-content h3 {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

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

.btn-primary:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

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

.btn-success:hover {
    background: #229954;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

.btn-warning:hover {
    background: #e67e22;
}

.btn-secondary {
    background: var(--neutral);
    color: var(--text-dark);
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

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

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* ========== TABLE ========== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--neutral);
}

tr:hover {
    background: var(--neutral);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-admin {
    background: var(--accent);
    color: var(--secondary);
}

/* ========== FLASH MESSAGES ========== */
.flash-message {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--error);
}

.flash-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* ========== LOGIN PAGE ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 5px;
}

.login-logo p {
    color: var(--text-muted);
}

/* ========== RESOURCE GRID ========== */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.resource-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 25px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.resource-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.resource-card p {
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* ========== RESOURCE CONTENT ========== */
.resource-content {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    line-height: 1.8;
}

.resource-content h1 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.resource-content h2 {
    color: var(--primary);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.resource-content h3 {
    color: var(--secondary);
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.resource-content ul {
    margin: 15px 0 15px 25px;
}

.resource-content li {
    margin-bottom: 8px;
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { justify-content: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 10px;
    }
}
