/* style.css - Plateforme Tutorat TEACHING */
/* Simple, sûr, stable — comme Scribblar, mais en mieux */
/* Conçu pour être fluide, accessible et multilingue */

/* ============================================
   RÉINITIALISATION & BASE
============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: #2c7be5;
    margin-top: 0;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: #2c7be5;
    transition: color 0.2s ease;
}

a:hover {
    color: #1a68d1;
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
    width: 270px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #1a2332;
    color: #fff;
    padding: 25px 20px;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar .logo {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}

.sidebar .logo h4 {
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    margin: 0;
}

.sidebar .logo span {
    font-size: 13px;
    opacity: 0.6;
    color: #adb5bd;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar .nav-link.active {
    background: #2c7be5;
    color: #fff;
}

.sidebar .nav-link i {
    width: 22px;
    text-align: center;
    font-size: 16px;
}

.sidebar .nav-link .badge {
    margin-left: auto;
}

.sidebar .nav-link.text-danger:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

.sidebar .nav-link.text-danger {
    color: #ff6b6b;
}

.sidebar hr {
    border-color: rgba(255,255,255,0.08);
    margin: 15px 0;
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    margin-left: 270px;
    padding: 30px 35px;
    min-height: 100vh;
}

/* ============================================
   CARDS STATISTIQUES
============================================ */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #2c7be5;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .label {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
}

.stat-card .icon {
    font-size: 28px;
    opacity: 0.6;
}

/* Couleurs des cartes */
.stat-card.primary { border-left-color: #2c7be5; }
.stat-card.success { border-left-color: #28a745; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.danger { border-left-color: #dc3545; }
.stat-card.info { border-left-color: #17a2b8; }
.stat-card.purple { border-left-color: #6f42c1; }
.stat-card.pink { border-left-color: #e83e8c; }   /* ROSE pour en attente */
.stat-card.teal { border-left-color: #20c997; }    /* TURQUOISE pour confirmés */
.stat-card.orange { border-left-color: #fd7e14; }

.stat-card .number.primary { color: #2c7be5; }
.stat-card .number.success { color: #28a745; }
.stat-card .number.warning { color: #e6a800; }
.stat-card .number.danger { color: #dc3545; }
.stat-card .number.info { color: #17a2b8; }
.stat-card .number.purple { color: #6f42c1; }
.stat-card .number.pink { color: #e83e8c; }
.stat-card .number.teal { color: #20c997; }
.stat-card .number.orange { color: #fd7e14; }

/* ============================================
   TABLEAUX
============================================ */
.table-container {
    background: #fff;
    border-radius: 16px;
    padding: 20px 0 0 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 14px 16px;
    background-color: #f8f9fa;
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 14px;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    opacity: 0.9;
}

/* ============================================
   LIGNES COLORÉES DU DASHBOARD
============================================ */
/* ROSE pour les comptes en attente */
.row-en-attente {
    background-color: #fff0f5 !important;
    border-left: 4px solid #e83e8c !important;
}

.row-en-attente:hover {
    background-color: #ffd9e6 !important;
}

/* TURQUOISE pour les comptes confirmés (actifs) */
.row-confirme {
    background-color: #f0fffa !important;
    border-left: 4px solid #20c997 !important;
}

.row-confirme:hover {
    background-color: #d4f5e8 !important;
}

/* ROUGE pour les comptes bloqués */
.row-bloque {
    background-color: #fff0f0 !important;
    border-left: 4px solid #dc3545 !important;
}

.row-bloque:hover {
    background-color: #ffe0e0 !important;
}

/* ============================================
   BADGES
============================================ */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

.badge-status.actif {
    background: #d4edda;
    color: #155724;
}

.badge-status.en_attente {
    background: #f8d7da;
    color: #721c24;
}

.badge-status.bloque {
    background: #f8d7da;
    color: #721c24;
}

.badge-status.expire {
    background: #e2e3e5;
    color: #383d41;
}

.badge-type {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-type.normal {
    background: #cce5ff;
    color: #004085;
}

.badge-type.demo {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   EXPIRATION BADGE
============================================ */
.expiration-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    white-space: nowrap;
}

.expiration-badge.soon {
    background: #fff3cd;
    color: #856404;
}

.expiration-badge.expired {
    background: #f8d7da;
    color: #721c24;
}

.expiration-badge.ok {
    background: #d4edda;
    color: #155724;
}

/* ============================================
   BOUTONS
============================================ */
.btn {
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: #2c7be5;
    border: none;
    color: white;
    padding: 10px 20px;
}

.btn-primary:hover {
    background-color: #1a68d1;
    color: white;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}

.btn-sm-action {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 8px;
    margin: 0 2px;
}

.btn-sm-action i {
    margin-right: 3px;
}

.btn-confirmer {
    background-color: #28a745;
    color: white;
    border: none;
}

.btn-confirmer:hover {
    background-color: #218838;
    color: white;
}

.btn-supprimer {
    background-color: #dc3545;
    color: white;
    border: none;
}

.btn-supprimer:hover {
    background-color: #c82333;
    color: white;
}

/* ============================================
   WHATSAPP LINK
============================================ */
.whatsapp-link {
    color: #25d366;
    text-decoration: none;
    font-weight: 600;
}

.whatsapp-link:hover {
    color: #128C7E;
    text-decoration: underline;
}

/* ============================================
   PAGINATION
============================================ */
.pagination-custom .page-link {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 0 3px;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-custom .page-link:hover {
    background: #e9ecef;
    color: #2c7be5;
}

.pagination-custom .active .page-link {
    background: #2c7be5;
    color: #fff;
}

.pagination-custom .disabled .page-link {
    color: #adb5bd;
    cursor: not-allowed;
}

/* ============================================
   ALERTES
============================================ */
.alert {
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-custom {
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================
   FORMULAIRES
============================================ */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #2c7be5;
    box-shadow: 0 0 0 0.2rem rgba(44, 123, 229, 0.25);
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

/* ============================================
   CARTES GÉNÉRIQUES
============================================ */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    background: white;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    background: #2c7be5;
    color: white;
    border-radius: 16px 16px 0 0 !important;
    padding: 18px 25px;
    font-weight: 600;
}

.card-header a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
}

.card-header a:hover {
    color: white;
    opacity: 1;
}

/* ============================================
   AVATAR PREVIEW
============================================ */
.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
        padding: 15px;
    }
    .main-content {
        margin-left: 220px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 10px;
    }
    .sidebar .logo h4,
    .sidebar .logo span,
    .sidebar .nav-link span,
    .sidebar .nav-link .badge {
        display: none;
    }
    .sidebar .nav-link {
        justify-content: center;
        padding: 12px;
    }
    .sidebar .nav-link i {
        font-size: 20px;
        width: auto;
    }
    .main-content {
        margin-left: 60px;
        padding: 15px;
    }
    .stat-card .number {
        font-size: 24px;
    }
    .table-responsive .btn-sm-action {
        font-size: 10px;
        padding: 2px 6px;
    }
    .table-responsive .btn-sm-action i {
        margin-right: 0;
    }
    .table-responsive .btn-sm-action .btn-text {
        display: none;
    }
    .container {
        padding: 0 10px;
    }
    h1, h2, h3 {
        font-size: 1.5rem;
    }
    .card-body {
        padding: 1rem;
    }
}

/* ============================================
   SUPPORT RTL (ARABE)
============================================ */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, 'Helvetica Neue', sans-serif;
}

[dir="rtl"] body {
    font-feature-settings: 'rtla' on;
}

[dir="rtl"] .text-center {
    text-align: center !important;
}

[dir="rtl"] .btn {
    direction: rtl;
    text-align: center;
}

[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
}

[dir="rtl"] .main-content {
    margin-left: auto;
    margin-right: 270px;
}

[dir="rtl"] .nav-link {
    text-align: right;
    padding-right: 15px;
    padding-left: 8px;
}

[dir="rtl"] .nav-link .badge {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .form-control {
    text-align: right;
    padding-right: 14px;
    padding-left: 8px;
}

[dir="rtl"] .stat-card {
    border-left: none;
    border-right: 4px solid #2c7be5;
}

[dir="rtl"] .stat-card.primary { border-right-color: #2c7be5; }
[dir="rtl"] .stat-card.success { border-right-color: #28a745; }
[dir="rtl"] .stat-card.warning { border-right-color: #ffc107; }
[dir="rtl"] .stat-card.danger { border-right-color: #dc3545; }
[dir="rtl"] .stat-card.info { border-right-color: #17a2b8; }
[dir="rtl"] .stat-card.purple { border-right-color: #6f42c1; }
[dir="rtl"] .stat-card.pink { border-right-color: #e83e8c; }
[dir="rtl"] .stat-card.teal { border-right-color: #20c997; }
[dir="rtl"] .stat-card.orange { border-right-color: #fd7e14; }

[dir="rtl"] .row-en-attente {
    border-left: none !important;
    border-right: 4px solid #e83e8c !important;
}

[dir="rtl"] .row-confirme {
    border-left: none !important;
    border-right: 4px solid #20c997 !important;
}

[dir="rtl"] .row-bloque {
    border-left: none !important;
    border-right: 4px solid #dc3545 !important;
}

@media (max-width: 768px) {
    [dir="rtl"] .main-content {
        margin-right: 60px;
        margin-left: auto;
    }
}

/* ============================================
   UTILITAIRES
============================================ */
.text-pink { color: #e83e8c; }
.text-teal { color: #20c997; }
.text-danger { color: #dc3545; }
.text-muted { color: #6c757d !important; }

.bg-pink { background-color: #e83e8c; }
.bg-teal { background-color: #20c997; }
.bg-danger { background-color: #dc3545; }

.bg-white { background-color: white !important; }
.bg-light { background-color: #f8f9fa !important; }

.shadow { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1) !important; }
.rounded-10 { border-radius: 10px; }
.rounded-16 { border-radius: 16px; }

.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.pb-5 { padding-bottom: 3rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-5 { margin-top: 3rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Code inline */
.code-inline {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #1a68d1;
}

/* Fin du fichier CSS — Simple, sûr, stable, comme Scribblar... mais en mieux. */