/* ============================================================
   assets/css/style.css — الأنماط الرئيسية للمنصة
   ============================================================ */

/* ---- الخط والمتغيرات ---- */
:root {
    --primary:   #1a4d8c;   /* أزرق جامعي */
    --secondary: #2e7d32;   /* أخضر */
    --accent:    #f5a623;   /* ذهبي */
    --bg-light:  #f4f7fb;
    --text-dark: #1e2a3a;
    --card-shadow: 0 4px 18px rgba(26,77,140,.10);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Cairo', 'Segoe UI', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.main-navbar {
    background: linear-gradient(135deg, var(--primary) 0%, #0d2f5e 100%);
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.navbar-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.navbar-brand { color: #fff !important; }

/* ---- Hero section ---- */
.hero-section {
    background: linear-gradient(160deg, var(--primary) 0%, #1565c0 60%, var(--secondary) 100%);
    color: #fff;
    padding: 3rem 1rem 2.5rem;
    text-align: center;
}
.hero-section h1 { font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 700; }
.hero-section p  { opacity: .88; font-size: clamp(.9rem, 2.5vw, 1.1rem); }

/* ---- Carte principale ---- */
.main-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    max-width: 720px;
    margin: -2rem auto 2rem;
}
@media (max-width: 576px) {
    .main-card { padding: 1.25rem; margin-top: -1.5rem; }
}

/* ---- Étapes ---- */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}

/* ---- Cartes de réponse ---- */
.reponse-card {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.reponse-card .card-header {
    font-weight: 700;
    font-size: 1rem;
    padding: .85rem 1.2rem;
}
.reponse-card .card-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .95rem;
    line-height: 1.9;
    min-height: 80px;
}
.reponse-scientifique .card-header { background: var(--primary); color: #fff; }
.reponse-administrative .card-header { background: var(--secondary); color: #fff; }

/* ---- Fiche candidat ---- */
.candidat-badge {
    background: linear-gradient(135deg, var(--primary), #1565c0);
    color: #fff;
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* ---- Observation ---- */
.observation-section {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.char-counter { font-size: .8rem; color: #666; text-align: left; }
.char-counter.warning { color: #e65100; font-weight: 600; }

/* ---- Boutons ---- */
.btn-primary-custom {
    background: var(--primary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: .6rem 2rem;
    border-radius: 8px;
    transition: background .2s, transform .1s;
}
.btn-primary-custom:hover  { background: #163f75; color: #fff; }
.btn-primary-custom:active { transform: scale(.97); }

.btn-success-custom {
    background: var(--secondary);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: .6rem 2rem;
    border-radius: 8px;
    transition: background .2s;
}
.btn-success-custom:hover { background: #1b5e20; color: #fff; }

/* ---- Alertes ---- */
.alert { border-radius: var(--radius); font-size: .95rem; }

/* ---- Captcha ---- */
.captcha-box {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: linear-gradient(135deg, #e3f2fd, #e8f5e9);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: .5rem 1rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    user-select: none;
}

/* ---- Footer ---- */
.main-footer {
    background: #1e2a3a;
    color: #aaa;
    margin-top: auto;
}
.admin-link:hover { color: #fff !important; }

/* ---- Spinner ---- */
.btn-spinner { display: none; }
.loading .btn-spinner { display: inline-block; }
.loading .btn-text   { display: none; }

/* ---- Admin layout ---- */
.admin-sidebar {
    min-height: calc(100vh - 70px);
    background: linear-gradient(180deg, var(--primary) 0%, #0d2f5e 100%);
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.8);
    border-radius: 8px;
    margin: 2px 0;
    padding: .6rem 1rem;
    font-size: .9rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.admin-sidebar .nav-link i { margin-left: .5rem; width: 20px; }

.admin-topbar {
    background: var(--primary);
    color: #fff;
    padding: .75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.stat-card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: .9;
}

.table-responsive { border-radius: var(--radius); overflow: hidden; }
table.recours-table { font-size: .88rem; }
table.recours-table th { background: var(--primary); color: #fff; white-space: nowrap; }

/* ---- Badge état ---- */
.badge-vu     { background: #c8e6c9; color: #1b5e20; }
.badge-non-vu { background: #ffcdd2; color: #b71c1c; }
.badge-obs    { background: #fff3cd; color: #795548; }

/* ---- Utilitaires RTL ---- */
.text-start-rtl { text-align: right !important; }
pre.reponse-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Cairo', sans-serif;
    font-size: .95rem;
    line-height: 1.9;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}
