/* =============================================
   NB3BN Info - CSS Principal
   ============================================= */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #f59e0b;
  --dark: #1e293b;
  --success: #10b981;
  --danger: #ef4444;
  --gradient-main: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #1e40af 100%);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.08);
  --border-radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', 'Tajawal', sans-serif;
  color: var(--dark);
  background: #f8fafc;
}

/* ===================== NAVBAR ===================== */
#mainNav {
  background: var(--gradient-main) !important;
  padding: 12px 0;
  box-shadow: 0 2px 20px rgba(30, 64, 175, 0.4);
  z-index: 1030;
}

#mainNav .navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
}

.brand-main { color: #fff; font-weight: 900; }
.brand-sub { color: var(--secondary); font-weight: 900; }

.brand-text {
  display: flex;
  align-items: center;
  gap: 4px;
}

#mainNav .nav-link {
  color: rgba(255,255,255,0.9) !important;
  font-weight: 500;
  padding: 8px 14px !important;
  border-radius: 8px;
  transition: all 0.2s;
}

#mainNav .nav-link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff !important;
}

/* ===================== HERO ===================== */
.hero-section {
  position: relative;
  background: var(--gradient-hero);
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-overlay { display: none; }

.hero-content { position: relative; z-index: 2; padding: 80px 0 120px; }

.min-vh-hero { min-height: 75vh; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--secondary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 600px;
}

.hero-actions .btn { padding: 14px 28px; border-radius: 10px; font-weight: 600; }

.hero-stats {
  display: flex;
  gap: 30px;
  margin-top: 30px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hero Image Decorative */
.hero-image-wrapper {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: pulse-ring 3s infinite;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); }
  50% { box-shadow: 0 0 0 30px rgba(255,255,255,0); }
}

.floating-card {
  position: absolute;
  background: white;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  font-size: 0.8rem;
  font-weight: 600;
  animation: float 3s ease-in-out infinite;
}

.floating-card.card-1 { top: 30px; left: 10px; animation-delay: 0s; }
.floating-card.card-2 { top: 30px; right: 10px; animation-delay: 0.5s; }
.floating-card.card-3 { bottom: 60px; left: 50%; transform: translateX(-50%); animation-delay: 1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.floating-card.card-3 { 
  bottom: 60px; 
  animation: float3 3s ease-in-out infinite;
  animation-delay: 1s;
}
@keyframes float3 {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

.hero-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  line-height: 0;
}

.hero-waves svg {
  width: 100%;
  height: 80px;
}

/* ===================== PAGE HERO ===================== */
.page-hero {
  background: var(--gradient-main);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #f8fafc;
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* ===================== SECTIONS ===================== */
.section-badge {
  display: inline-block;
  background: rgba(30, 64, 175, 0.1);
  color: var(--primary);
  padding: 5px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--dark);
}

.section-subtitle {
  color: #64748b;
  font-size: 1.05rem;
}

/* ===================== FEATURE CARDS ===================== */
.feature-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.feature-icon {
  width: 65px;
  height: 65px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 1.6rem;
}

/* ===================== FORMATION CARDS ===================== */
.formation-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s;
  height: 100%;
  cursor: pointer;
}

.formation-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.formation-card-header {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.formation-theme-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.2);
}

.formation-card-body { padding: 20px; }

.badge-type {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 50px;
}

/* ===================== ACTUALITÉ CARDS ===================== */
.actualite-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s;
  height: 100%;
}

.actualite-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.actualite-image {
  height: 200px;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.actualite-image img { width: 100%; height: 100%; object-fit: cover; }

/* ===================== CTA CARD ===================== */
.cta-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--shadow-card);
  border-left: 5px solid var(--primary);
}

/* ===================== FOOTER ===================== */
.footer-main {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 50px 0 20px;
}

.footer-link {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 3px 0;
  transition: color 0.2s;
}

.footer-link:hover { color: var(--secondary); }

/* ===================== CONTACT ===================== */
.contact-info-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: white;
  border-radius: 10px;
  padding: 15px 20px;
  box-shadow: var(--shadow-card);
}

.contact-icon {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

/* ===================== ADMIN LAYOUT ===================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--gradient-main);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
}

.sidebar-header {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav { padding: 15px 10px; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: rgba(255,255,255,0.85) !important;
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 4px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff !important;
}

.sidebar-link i { width: 20px; text-align: center; font-size: 1rem; }

.admin-content {
  margin-left: 260px;
  flex: 1;
  background: #f8fafc;
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #e2e8f0;
}

.admin-section { min-height: calc(100vh - 60px); }

/* ===================== TEST PAGE ===================== */
.session-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--shadow-card);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  height: 100%;
}

.session-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.session-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

/* Platform green dot */
.platform-dot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 50px;
  transition: all 0.2s;
}

.platform-dot-link:hover { background: rgba(0,0,0,0.05); }

.platform-green-dot {
  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
  animation: pulse-green 2s infinite;
  display: inline-block;
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

/* Niveau Cards */
.niveau-card {
  background: white;
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.niveau-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.15);
}

/* Result Card */
.result-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 50px 30px;
  box-shadow: var(--shadow-card);
}

.result-score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-main);
  color: white;
  font-size: 2rem;
  font-weight: 800;
}

/* ===================== ADMIN PAGE - LOGIN ===================== */
.admin-logo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== PLATFORM PAGE - LOGIN ===================== */
.platform-logo-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.2);
  border: 2px solid rgba(14, 165, 233, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================== TABLE STYLES ===================== */
.table-hover tbody tr:hover { background: rgba(30, 64, 175, 0.04); }

.table thead th {
  background: #f1f5f9;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
}

/* ===================== OPTION CARDS (TEST) ===================== */
.option-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  user-select: none;
}

.option-card:hover {
  border-color: var(--primary-light);
  background: rgba(59, 130, 246, 0.05);
}

.option-card.selected {
  border-color: var(--primary);
  background: rgba(30, 64, 175, 0.08);
  color: var(--primary);
}

.option-card.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

.option-card.incorrect {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  color: #991b1b;
}

/* ===================== BADGES CATEGORY ===================== */
.badge-categorie {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 50px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.show {
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 0;
  }

  .hero-stats { gap: 20px; }
  .stat-number { font-size: 1.5rem; }

  .hero-content { padding: 60px 0 80px; }
}

/* ===================== MISC ===================== */
.spinner-border { border-width: 3px; }

.badge.bg-primary { background: var(--primary) !important; }

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.btn-primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

.btn-outline-primary {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

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

.text-primary { color: var(--primary) !important; }

.bg-primary { background: var(--primary) !important; }

/* Scroll to top */
.btn-scroll-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(30, 64, 175, 0.4);
  transition: all 0.3s;
}

.btn-scroll-top:hover { transform: translateY(-3px); }

/* Theme color gradient map */
.theme-bureautique { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.theme-developpement-web { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.theme-programmation { background: linear-gradient(135deg, #065f46, #10b981); }
.theme-intelligence-artificielle { background: linear-gradient(135deg, #92400e, #f59e0b); }
.theme-reseau-securite { background: linear-gradient(135deg, #991b1b, #f87171); }
.theme-design-graphique { background: linear-gradient(135deg, #be185d, #f472b6); }
.theme-comptabilite-informatisee { background: linear-gradient(135deg, #1e3a5f, #3b82f6); }
.theme-montage-video { background: linear-gradient(135deg, #5b21b6, #8b5cf6); }
.theme-base-de-donnees { background: linear-gradient(135deg, #0f4c75, #1b98e0); }
.theme-marketing-digital { background: linear-gradient(135deg, #7f1d1d, #ef4444); }

/* Sidebar toggle btn */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* Message cards */
.message-card {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: var(--shadow-card);
}

.message-card.unread { border-left: 4px solid var(--danger); }
.message-card.read { border-left: 4px solid #94a3b8; }
