/* ============================================================
   ADEL Formation — styles
   Hérite des couleurs/fonts du thème actif.
   Ce fichier gère uniquement la structure et la mise en page.
   ============================================================ */

/* ---- Layout pleine largeur sur les pages adel ---- */
body.adel-page aside,
body.adel-page header.entry-header {
    display: none !important;
}

body.adel-page .x-main {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* ============================================================
   Boutons flottants (FAB)
   ============================================================ */

.adel-fab-nav {
    position: fixed;
    right: 0;
    top: 160px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.adel-fab {
    display: flex;
    align-items: center;
    height: 48px;
    border-radius: 24px 0 0 24px;
    padding: 0 14px 0 14px;
    text-decoration: none !important;
    color: #fff !important;
    overflow: hidden;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.25);
    transition: padding-left 0.3s ease;
}

.adel-fab:hover {
    padding-left: 16px;
    color: #fff !important;
    text-decoration: none !important;
}

.adel-fab .dashicons {
    flex-shrink: 0;
    font-size: 22px;
    width: 24px;
    height: 24px;
    line-height: 1;
    margin-left: 2px;
}

.adel-fab-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    margin-right: 0;
    transition: max-width 0.3s ease, opacity 0.2s ease, margin-right 0.25s ease;
}

.adel-fab:hover .adel-fab-label {
    max-width: 160px;
    opacity: 1;
    margin-right: 10px;
}

.adel-fab--liste     { background-color: #4a6cf7; }
.adel-fab--formateur { background-color: #e67e22; }
.adel-fab--eleve     { background-color: #27ae60; }

/* ---- Conteneur générique ---- */
.adel-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 0;
}

/* ---- Placeholder (dev) ---- */
.adel-placeholder {
    padding: 20px;
    background: #f0f4ff;
    border-left: 4px solid #4a6cf7;
    color: #333;
    font-style: italic;
}

/* ============================================================
   Formulaire de connexion
   ============================================================ */

.adel-login-wrap {
    max-width: 480px;
}

.adel-form-title {
    margin-bottom: 24px;
}

.adel-form-intro {
    margin-bottom: 20px;
    color: #555;
}

/* ---- Groupes de champs ---- */
.adel-form-group {
    margin-bottom: 20px;
}

.adel-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.adel-form-group input[type="email"],
.adel-form-group input[type="password"],
.adel-form-group input[type="text"],
.adel-form-group input[type="number"],
.adel-form-group input[type="tel"],
.adel-form-group input[type="datetime-local"],
.adel-form-group textarea,
.adel-form-group select {
    width: 100%;
    box-sizing: border-box;
}

.adel-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    color: #777;
}

.adel-field-error {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    color: #c0392b;
}

.adel-required {
    color: #c0392b;
}

/* ---- Actions ---- */
.adel-form-actions {
    margin-top: 28px;
}

.adel-btn {
    display: inline-block;
    padding: 10px 24px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.adel-btn:hover {
    opacity: 0.85;
}

.adel-btn-primary {
    background: #4a6cf7;
    color: #fff;
}

.adel-btn-secondary {
    background: #e5e7eb;
    color: #111;
}

.adel-btn-danger {
    background: #e74c3c;
    color: #fff;
}

.adel-btn-sm {
    padding: 6px 14px;
    font-size: 0.875em;
}

/* ---- Footer formulaire ---- */
.adel-login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
}

/* ============================================================
   Messages d'alerte
   ============================================================ */

.adel-alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.adel-alert-error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.adel-alert-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

.adel-alert-info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.adel-alert-warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

/* ============================================================
   Utilitaires
   ============================================================ */

.adel-hidden {
    display: none !important;
}

.adel-mt-20 { margin-top: 20px; }
.adel-mb-20 { margin-bottom: 20px; }
.adel-text-center { text-align: center; }

/* ============================================================
   Dashboard formateur
   ============================================================ */

.adel-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.adel-dashboard-title {
    margin: 4px 0 0;
}

.adel-dashboard-user {
    font-size: 0.9em;
    color: #666;
}

.adel-back-link {
    display: inline-block;
    font-size: 0.9em;
    margin-bottom: 4px;
    text-decoration: none;
    opacity: 0.7;
}

.adel-back-link:hover { opacity: 1; }

/* ---- Stats ---- */
.adel-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.adel-stat-card {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.adel-stat-card--alert {
    border-color: #fcd34d;
    background: #fffbeb;
}

.adel-stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}

.adel-stat-label {
    display: block;
    font-size: 0.8em;
    color: #666;
}

/* ---- Section header ---- */
.adel-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.adel-section-header h3 {
    margin: 0;
}

/* ============================================================
   Tables
   ============================================================ */

.adel-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.adel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.adel-table th,
.adel-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.adel-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    white-space: nowrap;
}

.adel-table tbody tr:hover {
    background: #f8f9fa;
}

.adel-td-titre { min-width: 180px; }
.adel-td-nowrap { white-space: nowrap; }
.adel-td-center { text-align: center; }

.adel-td-actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.adel-muted { color: #aaa; }

/* ---- Bouton dans les cellules ---- */
.adel-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Badges de statut
   ============================================================ */

.adel-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}

.adel-badge-success  { background: #dcfce7; color: #166534; }
.adel-badge-neutral  { background: #e9ecef; color: #555; }
.adel-badge-danger   { background: #fee2e2; color: #991b1b; }
.adel-badge-warning  { background: #fef9c3; color: #854d0e; }
.adel-badge-info     { background: #dbeafe; color: #1e40af; }

/* ============================================================
   Formulaire formation (création / édition)
   ============================================================ */

.adel-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.adel-col-4 { flex: 0 0 calc(33.333% - 14px); min-width: 160px; }
.adel-col-8 { flex: 1; min-width: 200px; }

/* ---- Image upload ---- */
.adel-image-upload-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adel-image-preview {
    max-width: 320px;
    max-height: 200px;
    border-radius: 4px;
    border: 1px solid #ddd;
    object-fit: cover;
    display: block;
}

.adel-image-actions {
    display: flex;
    gap: 8px;
}

/* ---- Boutons supplémentaires ---- */
.adel-btn-warning { background: #f59e0b; color: #fff; }
.adel-btn-success { background: #16a34a; color: #fff; }

/* ---- Onglets de langue (formation-edit) ---- */
.adel-lang-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
    margin-top: 28px;
}

.adel-lang-tab {
    padding: 10px 22px;
    background: none;
    border: none;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    color: #555;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s;
    line-height: 1.4;
}

.adel-lang-tab:hover { color: #4a6cf7; }

.adel-lang-tab--active {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
}

.adel-lang-optional {
    font-weight: 400;
    font-size: 0.85em;
    color: #888;
}

.adel-lang-carousel {
    overflow: hidden;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 6px 6px;
    /* pas de padding ici — géré par .adel-lang-panel */
}

.adel-lang-panels {
    display: grid;
    grid-template-columns: 100% 100%;
    transition: transform 0.25s ease;
}

.adel-lang-panel {
    box-sizing: border-box;
    min-width: 0;
    padding: 24px;
}

.adel-lang-notice {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: #eff6ff;
    border-left: 4px solid #4a6cf7;
    border-radius: 0 4px 4px 0;
    color: #1e40af;
    font-size: 0.9em;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .adel-form-row { flex-direction: column; }
    .adel-col-4, .adel-col-8 { flex: 1 1 100%; }
    .adel-stats-row { flex-direction: column; }
    .adel-td-actions { flex-wrap: wrap; }
}

/* ============================================================
   Page liste des formations (cartes)
   ============================================================ */

.adel-formations-list { padding: 20px 0; }

.adel-cards {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
    gap: 28px;
}

.adel-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.adel-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.adel-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.adel-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.adel-card-date {
    font-size: 0.82em;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.adel-card-title {
    margin: 0 0 12px;
    font-size: 1.1em;
    line-height: 1.3;
}

.adel-card-desc {
    flex: 1;
    color: #555;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.6;
}

.adel-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.adel-card-prix {
    font-size: 1.2em;
    font-weight: 700;
}

/* ============================================================
   Page détail d'une formation
   ============================================================ */

.adel-formation-detail { padding: 20px 0; }

.adel-formation-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 8px;
    margin: 16px 0 28px;
    display: block;
}

.adel-formation-titre {
    margin-bottom: 16px;
}

.adel-formation-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.adel-formation-prix {
    font-size: 1.6em;
    font-weight: 700;
}

.adel-formation-date {
    color: #555;
    font-size: 1em;
}

.adel-formation-body {
    margin-bottom: 32px;
}

.adel-formation-body h2 {
    margin-bottom: 16px;
}

.adel-separator {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 40px 0 32px;
}

/* ---- Deux formulaires côte à côte ---- */
.adel-forms-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.adel-form-col h3 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #4a6cf7;
}

/* ---- Statut d'inscription ---- */
.adel-inscription-status {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.adel-badge-lg {
    font-size: 1em;
    padding: 6px 16px;
}

/* ---- Colonnes 50/50 dans formulaires ---- */
.adel-col-6 { flex: 1; min-width: 120px; }

@media (max-width: 768px) {
    .adel-forms-row {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ============================================================
   Espace élève
   ============================================================ */

/* ---- Bloc formation courante ---- */
.adel-eleve-section {
    margin-bottom: 32px;
}

.adel-eleve-section h3 {
    margin-bottom: 16px;
}

.adel-formation-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: 0;
}

.adel-formation-card-img {
    width: 160px;
    min-height: 120px;
    object-fit: cover;
    flex-shrink: 0;
}

.adel-formation-card-body {
    padding: 20px 24px;
    flex: 1;
}

.adel-formation-card-meta {
    font-size: 0.82em;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.adel-formation-card-titre {
    margin: 0 0 16px;
    font-size: 1.1em;
}

.adel-inscription-statut-bloc {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.adel-statut-hint {
    margin: 4px 0 0;
    color: #555;
    font-size: 0.9em;
}

.adel-statut-success {
    color: #166534;
    font-weight: 600;
}

/* ---- Actions rapides ---- */
.adel-eleve-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.adel-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 28px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9em;
    font-weight: 600;
    transition: box-shadow 0.2s, border-color 0.2s;
    min-width: 130px;
    text-align: center;
}

.adel-action-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 2px 8px rgba(74,108,247,0.12);
    color: #4a6cf7;
    text-decoration: none;
}

.adel-action-icon {
    font-size: 1.6em;
}

/* ---- Zone de danger ---- */
.adel-danger-zone {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.adel-danger-summary {
    cursor: pointer;
    color: #c0392b;
    font-size: 0.9em;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.adel-danger-summary::-webkit-details-marker { display: none; }
.adel-danger-summary::before { content: '▶ '; font-size: 0.75em; }
details[open] .adel-danger-summary::before { content: '▼ '; }

.adel-danger-body {
    margin-top: 16px;
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    max-width: 480px;
}

.adel-danger-body p {
    margin: 0 0 16px;
    font-size: 0.9em;
    color: #7f1d1d;
}

/* ---- Profil ---- */
.adel-profil-form { max-width: 640px; }
.adel-form-container { max-width: 580px; }
.adel-section-label { margin: 0 0 16px; font-size: 0.95em; color: #555; }
.adel-input-disabled { opacity: 0.6; cursor: not-allowed; background: #f8f9fa; }

@media (max-width: 640px) {
    .adel-formation-card { flex-direction: column; }
    .adel-formation-card-img { width: 100%; height: 160px; }
    .adel-eleve-actions { flex-direction: column; }
    .adel-action-card { flex-direction: row; justify-content: flex-start; min-width: 0; }
}

/* ============================================================
   Page de configuration
   ============================================================ */

/* ---- Setup initial ---- */
.adel-setup-wrap { max-width: 580px; }
.adel-setup-header { margin-bottom: 28px; }
.adel-setup-intro { color: #555; margin: 6px 0 0; }

/* ---- Onglets ---- */
.adel-config-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 28px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0;
}

.adel-config-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
    font-size: 0.9em;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.adel-config-tab:hover { color: #4a6cf7; }

.adel-config-tab--active {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
    background: #fff;
}

/* ---- Corps ---- */
.adel-config-body { max-width: 680px; }
.adel-config-form { max-width: 640px; }

/* ---- Champ lecture seule / copier ---- */
.adel-input-readonly {
    background: #f8f9fa;
    cursor: text;
    flex: 1;
    font-family: monospace;
    font-size: 0.85em;
}

.adel-copy-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* ---- Radio mode ---- */
.adel-radio-group {
    display: flex;
    gap: 24px;
}

.adel-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.adel-radio-label input[type="radio"] { cursor: pointer; }

/* ---- Actions en ligne ---- */
.adel-form-actions--row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---- Résultat test Stripe ---- */
.adel-test-result {
    font-size: 0.9em;
    font-weight: 500;
    padding: 4px 0;
}

.adel-test-result--ok    { color: #166534; }
.adel-test-result--error { color: #991b1b; }

/* ---- Message bienvenue page connexion ---- */
.adel-welcome-message {
    background: #eff6ff;
    border-left: 4px solid #4a6cf7;
    border-radius: 0 4px 4px 0;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #1e40af;
    font-size: 0.95em;
    line-height: 1.6;
}

/* ---- Code inline ---- */
code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    font-family: monospace;
}

@media (max-width: 640px) {
    .adel-config-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .adel-config-tab  { white-space: nowrap; }
    .adel-radio-group { flex-direction: column; gap: 10px; }
}
