/* === PERMIS BATEAU - Global Styles === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --navy: #1a3a5c;
  --navy-light: #234b73;
  --blue: #4A90D9;
  --blue-light: #6BA5E7;
  --blue-pale: #E8F0FE;
  --white: #FFFFFF;
  --gray-50: #F5F7FA;
  --gray-100: #E8ECF1;
  --gray-200: #D1D8E0;
  --gray-300: #B0BEC5;
  --gray-400: #8696A7;
  --gray-500: #607080;
  --gray-600: #455A64;
  --green: #27AE60;
  --green-light: #E8F8F0;
  --red: #E74C3C;
  --red-light: #FDE8E8;
  --orange: #F39C12;
  --orange-light: #FEF5E7;
  --yellow: #F1C40F;
  --shadow-sm: 0 1px 3px rgba(26,58,92,0.08);
  --shadow-md: 0 4px 12px rgba(26,58,92,0.1);
  --shadow-lg: 0 8px 30px rgba(26,58,92,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.25s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--navy);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy); }

img { max-width: 100%; height: auto; }

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

.sidebar {
  width: 260px;
  background: var(--navy);
  color: var(--white);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo svg { width: 36px; height: 36px; flex-shrink: 0; }
.sidebar-logo span { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}

.sidebar-nav a:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.sidebar-nav a.active { color: var(--white); background: var(--blue); }
.sidebar-nav a svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-nav .nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  padding: 20px 16px 8px;
  font-weight: 600;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
}

.top-bar {
  background: var(--white);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
}

.top-bar-actions { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--navy);
}

.page-content { padding: 28px 32px; max-width: 1400px; }

/* === CARDS === */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--blue-pale); color: var(--blue); }
.stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.red { background: var(--red-light); color: var(--red); }

.stat-info h3 { font-size: 0.8rem; color: var(--gray-400); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.stat-info .stat-sub { font-size: 0.8rem; color: var(--gray-400); margin-top: 2px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }

/* === COURSE CARDS === */
.course-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.course-card-img {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.course-card-img .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,58,92,0.7), rgba(74,144,217,0.5));
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-card-img .overlay svg { width: 48px; height: 48px; color: white; opacity: 0.9; }

.course-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-card-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--navy); }
.course-card-body p { font-size: 0.85rem; color: var(--gray-500); flex: 1; margin-bottom: 12px; line-height: 1.5; }

.course-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.course-card-footer .badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.badge-blue { background: var(--blue-pale); color: var(--blue); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-orange { background: var(--orange-light); color: var(--orange); }

.progress-bar-mini {
  width: 80px;
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-mini .fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--navy); color: var(--white); }
.btn-secondary { background: var(--gray-50); color: var(--navy); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-success { background: var(--green); color: var(--white); }
.btn-success:hover { background: #219a52; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-lg { padding: 16px 32px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* === QUIZ === */
.quiz-container { max-width: 800px; margin: 0 auto; }

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.quiz-progress {
  width: 100%;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.quiz-question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 20px;
}

.quiz-question-number {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.quiz-question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 24px;
  line-height: 1.5;
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  background: var(--white);
}

.quiz-option:hover { border-color: var(--blue); background: var(--blue-pale); }

.quiz-option .option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray-500);
  flex-shrink: 0;
  transition: var(--transition);
}

.quiz-option:hover .option-letter { background: var(--blue); color: var(--white); }

.quiz-option.correct { border-color: var(--green); background: var(--green-light); }
.quiz-option.correct .option-letter { background: var(--green); color: var(--white); }
.quiz-option.incorrect { border-color: var(--red); background: var(--red-light); }
.quiz-option.incorrect .option-letter { background: var(--red); color: var(--white); }
.quiz-option.disabled { pointer-events: none; }

.quiz-explanation {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--blue-pale);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--blue);
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

.quiz-explanation.visible { display: block; }

.quiz-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  padding: 8px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.quiz-timer.warning { color: var(--orange); background: var(--orange-light); }
.quiz-timer.danger { color: var(--red); background: var(--red-light); animation: pulse 1s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.quiz-score-card {
  text-align: center;
  padding: 48px 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.quiz-score-card .score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 800;
  position: relative;
}

.quiz-score-card .score-circle.pass { background: var(--green-light); color: var(--green); }
.quiz-score-card .score-circle.fail { background: var(--red-light); color: var(--red); }
.quiz-score-card .score-circle small { font-size: 1rem; font-weight: 500; }

.quiz-score-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.quiz-score-card p { color: var(--gray-500); margin-bottom: 24px; }

/* === FICHE DE COURS === */
.course-content {
  max-width: 800px;
  margin: 0 auto;
}

.course-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-pale);
}

.course-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy-light);
  margin: 24px 0 12px;
}

.course-content p {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 16px;
}

.course-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.course-content li {
  font-size: 0.95rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 6px;
}

.course-content .info-box {
  padding: 20px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.info-box.tip { background: var(--blue-pale); border-left: 4px solid var(--blue); }
.info-box.warning { background: var(--orange-light); border-left: 4px solid var(--orange); }
.info-box.danger { background: var(--red-light); border-left: 4px solid var(--red); }

.course-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}

/* === PROGRESS CHART === */
.chart-container {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.chart-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--navy);
}

/* === PROFILE === */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--navy));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}

/* === FAVORITES === */
.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--gray-300);
  transition: var(--transition);
}

.favorite-btn:hover, .favorite-btn.active { color: var(--orange); }

/* === HERO SECTION === */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, var(--blue) 100%);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: rgba(74,144,217,0.15);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(74,144,217,0.1);
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.hero h1 span { color: var(--blue-light); }

.hero p {
  font-size: 1.15rem;
  opacity: 0.85;
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.hero-features .feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

.hero-features .feature svg { width: 22px; height: 22px; color: var(--blue-light); flex-shrink: 0; }

.hero-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image img {
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.hero-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease;
}

.hero-nav.scrolled { background: rgba(26,58,92,0.95); backdrop-filter: blur(10px); }

.hero-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

/* === SECTION TITLES === */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 2.4rem; }
  .hero-features { align-items: center; }
  .hero-image { display: none; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .top-bar { padding: 12px 16px; }
  .top-bar h1 { font-size: 1.1rem; }
  .page-content { padding: 20px 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .quiz-question-card { padding: 20px; }
  .quiz-option { padding: 12px 16px; }
  .hero { min-height: auto; padding: 100px 0 60px; }
  .hero h1 { font-size: 2rem; }
  .hero-content { padding: 20px; }
  .hero-nav { padding: 16px 20px; }
}

/* === OVERLAY === */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.visible { display: block; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; color: var(--navy); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 20px; }

/* === TABLES === */
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.results-table th {
  background: var(--gray-50);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-100);
}

.results-table td {
  padding: 14px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
}

.results-table tr:hover td { background: var(--gray-50); }

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.score-badge.pass { background: var(--green-light); color: var(--green); }
.score-badge.fail { background: var(--red-light); color: var(--red); }

/* === TABS === */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--gray-50);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  border-radius: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { color: var(--navy); }

/* === SVG BUOY DIAGRAMS === */
.buoy-diagram {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 24px 0;
}

.buoy-item {
  text-align: center;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  min-width: 120px;
}

.buoy-item p {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 8px;
  color: var(--navy);
}
