﻿/* ========== ÉTUDE BIBLIQUE PANEL - ORIBIBLE DESIGN SYSTEM ========== */
/* Couleur principale: #3a38b2 (Indigo spirituel) */
/* Élégant, épuré, divin et professionnel */

/* === VARIABLES CSS ORIBIBLE === */
:root {
  --ori-primary: #3a38b2;
  --ori-primary-light: #4f4dc7;
  --ori-primary-dark: #2d2b8f;
  --ori-primary-soft: rgba(58, 56, 178, 0.08);
  --ori-bg-purple: #f8f8ff;
  --ori-bg-cream: #fffbf0;
  --ori-bg-white: #ffffff;
  --ori-text-primary: #1a1a2e;
  --ori-text-secondary: #5a5a7a;
  --ori-text-muted: #8a8aa3;
  --ori-border-soft: #e8e8f0;
  --ori-shadow-md: 0 4px 20px rgba(58, 56, 178, 0.08);
  --ori-shadow-lg: 0 20px 60px rgba(58, 56, 178, 0.15);
}

/* === OVERLAY === */
#etudes-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
}

#etudes-overlay[hidden] {
  display: none;
}

/* === MAIN PANEL - CENTERED, DIVINE === */
#etudes-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 580px;
  height: 80vh;
  max-height: 800px;
  background: var(--ori-bg-white);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 10001;
  overflow: hidden;
  box-shadow: var(--ori-shadow-lg), 0 4px 12px rgba(58, 56, 178, 0.1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'DM Sans', 'Roboto', sans-serif;
  color: var(--ori-text-primary);
}

#etudes-panel[hidden] {
  display: none;
}

/* === HEADER - CLEAN & ELEGANT === */
.note-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--ori-border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, var(--ori-bg-white) 0%, var(--ori-bg-purple) 100%);
  flex-shrink: 0;
}

.note-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--ori-text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.note-title .fa,
.note-title .fas,
.note-title i {
  color: var(--ori-primary);
  font-size: 18px;
}

/* === CLOSE BUTTON - REFINED === */
.ba-close-x {
  background: none;
  border: none;
  color: var(--ori-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ba-close-x:hover {
  background: var(--ori-primary-soft);
  color: var(--ori-primary);
  transform: scale(1.05);
}

.ba-close-x:active {
  transform: scale(0.98);
}

/* === CONTENT AREA - CLEAN & SPACIOUS === */
.note-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px;
  color: var(--ori-text-primary);
  background: linear-gradient(180deg, var(--ori-bg-purple) 0%, var(--ori-bg-cream) 100%);
  font-family: 'Inter', 'DM Sans', Roboto, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  font-weight: 400 !important;
}

/* === SCROLLBAR - ELEGANT === */
.note-body::-webkit-scrollbar {
  width: 6px;
}

.note-body::-webkit-scrollbar-track {
  background: var(--ori-bg-purple);
}

.note-body::-webkit-scrollbar-thumb {
  background: rgba(58, 56, 178, 0.2);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.note-body::-webkit-scrollbar-thumb:hover {
  background: rgba(58, 56, 178, 0.35);
}

/* === BUTTONS - REFINED ORIBIBLE STYLE === */
.ba-btn {
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', 'DM Sans', Roboto, sans-serif !important;
}

.ba-btn-primary {
  background: linear-gradient(135deg, var(--ori-primary) 0%, var(--ori-primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(58, 56, 178, 0.25);
}

.ba-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(58, 56, 178, 0.35);
}

.ba-btn-primary:active {
  transform: translateY(0);
}

/* === TEXT STYLES === */
h1, h2, h3, h4, h5, h6 {
  color: var(--ori-text-primary);
  margin: 0 0 12px 0;
  font-weight: 600;
  line-height: 1.4;
}

p {
  color: var(--ori-text-secondary);
  line-height: 1.65;
  margin: 0 0 16px 0;
}

/* === EMPÊCHER SCROLL HORIZONTAL QUAND PANEL OUVERT === */
body.etudes-panel-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

/* === RESPONSIVE DESIGN === */

/* LAPTOPS et TABLETTES (601px - 1366px) - POPUP CENTRÉ */
@media (min-width: 601px) and (max-width: 1366px) {
  #etudes-panel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 600px !important;
    height: 85vh !important;
    max-height: 85vh !important;
    border-radius: 16px !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Conteneur scrollable */
  #etudes-panel .note-body {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Overlay caché par défaut */
  #etudes-overlay {
    display: none !important;
  }
  /* Afficher l'overlay seulement quand actif */
  #etudes-overlay.active {
    display: flex !important;
  }
  /* Panel caché par défaut */
  #etudes-panel {
    display: none !important;
  }
  #etudes-panel.active {
    display: flex !important;
  }
}

/* MOBILE UNIQUEMENT (jusqu'à 600px) - FULLSCREEN */
@media (max-width: 600px) {
  #etudes-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  #etudes-overlay {
    display: none !important;
  }
  .note-body {
    -webkit-overflow-scrolling: touch;
  }
  .note-head {
    padding: 18px 20px;
  }
  .note-title {
    font-size: 17px;
  }
  .note-body {
    padding: 24px 20px;
  }
}

/* Tablettes moyennes (jusqu'à 768px) */
@media (max-width: 768px) {
  .note-head {
    padding: 16px;
  }
  .note-body {
    padding: 20px 16px;
  }
  .note-title {
    font-size: 16px;
  }
}

/* Smartphones (jusqu'à 480px) */
@media (max-width: 480px) {
  .note-head {
    padding: 14px;
  }
  .note-body {
    padding: 18px 14px;
  }
  .note-title {
    font-size: 15px;
  }
  .ba-close-x {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

/* Très petits écrans (jusqu'à 360px) */
@media (max-width: 360px) {
  .note-head {
    padding: 12px;
  }
  .note-body {
    padding: 16px 12px;
  }
  .note-title {
    font-size: 14px;
  }
}

/* === FOOTER WITH RADIO === */
.etudes-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--ori-border-soft);
  background: var(--ori-bg-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.etudes-footer-copyright {
  color: var(--ori-text-muted);
  font-size: 10px;
}
.etudes-footer a {
  color: var(--ori-text-muted);
  text-decoration: none;
}
.etudes-footer a:hover {
  color: var(--ori-primary);
}

/* === AMBIENT RADIO CONTROL - ORIBIBLE STYLE === */
.etudes-ambient-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--ori-primary-soft);
  border: 1px solid rgba(58, 56, 178, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.etudes-ambient-control:hover {
  background: rgba(58, 56, 178, 0.12);
  border-color: var(--ori-primary);
}
.etudes-ambient-control.playing {
  background: linear-gradient(135deg, var(--ori-primary) 0%, var(--ori-primary-light) 100%);
  border-color: var(--ori-primary);
}
.etudes-ambient-control.playing .etudes-ambient-title,
.etudes-ambient-control.playing .etudes-ambient-station {
  color: white;
}
.etudes-ambient-control.playing .etudes-ambient-btn {
  background: white;
  color: var(--ori-primary);
}
.etudes-ambient-control.playing .etudes-ambient-waves span {
  background: white;
}
.etudes-ambient-waves {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.etudes-ambient-waves span {
  width: 2px;
  background: var(--ori-primary);
  border-radius: 1px;
  animation: none;
}
.etudes-ambient-waves span:nth-child(1) { height: 4px; }
.etudes-ambient-waves span:nth-child(2) { height: 8px; }
.etudes-ambient-waves span:nth-child(3) { height: 12px; }
.etudes-ambient-waves span:nth-child(4) { height: 6px; }
.etudes-ambient-waves span:nth-child(5) { height: 10px; }
.etudes-ambient-control.playing .etudes-ambient-waves span {
  animation: etudesWave 0.8s ease-in-out infinite;
}
.etudes-ambient-control.playing .etudes-ambient-waves span:nth-child(1) { animation-delay: 0s; }
.etudes-ambient-control.playing .etudes-ambient-waves span:nth-child(2) { animation-delay: 0.1s; }
.etudes-ambient-control.playing .etudes-ambient-waves span:nth-child(3) { animation-delay: 0.2s; }
.etudes-ambient-control.playing .etudes-ambient-waves span:nth-child(4) { animation-delay: 0.3s; }
.etudes-ambient-control.playing .etudes-ambient-waves span:nth-child(5) { animation-delay: 0.4s; }
@keyframes etudesWave {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}
.etudes-ambient-label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.etudes-ambient-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--ori-text-primary);
}
.etudes-ambient-station {
  font-size: 9px;
  color: var(--ori-primary);
  font-weight: 500;
}
.etudes-ambient-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--ori-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.etudes-ambient-btn:hover {
  transform: scale(1.1);
}
.etudes-ambient-btn .etudes-icon-pause {
  display: none;
}
.etudes-ambient-control.playing .etudes-ambient-btn .etudes-icon-play {
  display: none;
}
.etudes-ambient-control.playing .etudes-ambient-btn .etudes-icon-pause {
  display: block;
}
