/* ===== RESET & BASE STYLES ===== */
:root {
  /* Palette néon/sombre */
  --main-bg: #0a0a12;
  --panel-bg: #161622;
  --accent: #6e44ff;
  --accent-hover: #8d6aff;
  --text-main: #f0f0ff;
  --text-secondary: #b0b0cc;
  --border: #2a2a3a;
  --success: #44ffaa;
  --warning: #ffbd44;
  --danger: #ff4477;
  --bg-blur: 8px;

  /* Tailles fluides */
  --font-scale: 1;
  --base-font-size: calc(14px * var(--font-scale));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, sans-serif;
}

html {
  font-size: var(--base-font-size);
  height: 100%;
}

body {
  background: var(--main-bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(110, 68, 255, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(255, 68, 119, 0.1) 0%, transparent 30%);
}

/* ===== LAYOUT MOBILE FIRST ===== */
.app-container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  height: 100vh;
  position: relative;
}

.app-header {
  grid-column: 1 / -1;
  background: rgba(10, 10, 18, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  z-index: 100;
}

.sidebar {
  background: rgba(22, 22, 34, 0.9);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 85%;
  z-index: 900;
    padding-bottom:100px;
}

.sidebar.active {
  transform: translateX(0);
}

.content-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  overflow: hidden;
}

/* ===== COMPONENTS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.input-control {
  width: 100%;
  padding: 0.8rem;
  background: rgba(30, 30, 45, 0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 1rem;
}

.verse-result {
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: rgba(30, 30, 45, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.verse-result.active {
  background: rgba(110, 68, 255, 0.25);
  border-left: 3px solid var(--success);
}

/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
  display: block;
  position: fixed;
  top: 40rem;
  right: 1rem;
  z-index: 1000;
  background: var(--accent);
  border: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.5rem;
}

/* ===== MEDIA QUERIES ===== */
/* Tablettes (≥768px) */
@media (min-width: 768px) {
  :root {
    --font-scale: 1.1;
  }

  .app-container {
    grid-template-columns: 300px 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    transform: none;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .content-area {
    grid-template-columns: 1fr 1fr;
  }
}

/* Desktop (≥1200px) */
@media (min-width: 1200px) {
  :root {
    --font-scale: 1.2;
  }

  .app-container {
    grid-template-columns: 380px 1fr;
  }
}

/* Mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .verse-detail {
    height: 100vh !important;
  }
}

/* ===== THEMES ===== */
.light-mode {
  --main-bg: #f5f7ff;
  --panel-bg: #ffffff;
  --text-main: #1a1a2e;
  --text-secondary: #4a4a6e;
  --border: #d6deff;
  background-image: 
    radial-gradient(circle at 20% 30%, #f0ebff 0%, #fafafa 30%);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== UTILITIES ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.no-selection {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar, .mobile-menu-toggle {
    display: none !important;
  }

  .content-area {
    grid-template-columns: 1fr !important;
  }
}


.toggle-detail {
    display:none;}

/* Mode Mobile Portrait */
@media (max-width: 767px) and (orientation: portrait) {
  .detail-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px; /* Hauteur minimale */
    background: var(--panel-bg);
    border-top: 2px solid var(--accent);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
  }
.app-title {
    font-size: 1.2rem;}
    
  .detail-panel.expanded {
    height: 70vh; /* Hauteur quand ouvert */
  }

  .verse-detail {
    height: calc(100% - 40px);
    overflow-y: auto;
    padding: 1rem;
  }

  .toggle-detail {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(20%);
    width: 80px;
    height: 40px;
    background: var(--accent);
    border: none;
    border-radius: 8px 8px 0 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .toggle-detail i {
    transition: transform 0.3s ease;
  }

  .detail-panel.expanded .toggle-detail i {
    transform: rotate(180deg);
  }

  /* Ajustement de la hauteur des résultats */
  .verse-results {
    max-height: calc(100vh - 40px) !important;
    margin-bottom: 0;
  }
}
.toggle-detail:active {
  transform: translate(20%, 3px);
}
.detail-panel {
  box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
}