
:root {
  --bg-main: #c3e2d8;
  --bg-gradient-top: #ffd6c2;
  --bg-card: #ffffff;
  --accent-mint: #7fd8be;
  --accent-peach: #ff9f80;
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --transition-fast: 150ms ease-out;
  --transition-med: 220ms ease-out;
}

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, var(--bg-gradient-top) 0, transparent 55%),
    radial-gradient(circle at bottom, #cde3f7 0, transparent 55%),
    var(--bg-main);
  min-height: 100vh;
}

/* Shell & layout */

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.1rem 2rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(255,255,255,0.96), rgba(255,255,255,0.85));
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffffff, #fed7aa);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(248, 113, 113, 0.4);
  font-size: 1rem;
}

.logo-text span:first-child {
  display: block;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}

.logo-text span:last-child {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 0.9rem;
  font-size: 0.85rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-links a:hover {
  background: rgba(255,255,255,0.9);
  color: #111827;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-toggle {
  display: inline-flex;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.lang-btn {
  background: none;
  border: none;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-muted);
}

.lang-btn.active {
  background: #111827;
  color: #f9fafb;
}

.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
  padding: 0.2rem 0.7rem;
  background: rgba(15,23,42,0.9);
  color: #f9fafb;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Hero */

.hero {
  padding: 1.2rem 0 1rem;
}

.hero-title {
  font-family: "Playfair Display", ui-serif, serif;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.2rem;
}

.hero-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Lang sections */

.lang-section {
  display: none;
  margin-top: 1rem;
}

.lang-section.active {
  display: block;
}

/* Citation du jour */

.qod-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: flex-start;
}

.qod-card {
  border-radius: 18px;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.16), rgba(251, 191, 36, 0.18));
  box-shadow: 0 18px 40px rgba(15,23,42,0.11);
  border: 1px solid rgba(148,163,184,0.35);
}

.qod-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.qod-text {
  font-family: "Playfair Display", ui-serif, serif;
  font-size: 1.1rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.qod-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qod-theme-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.1rem 0.6rem;
}

/* Fortune cookie */

.fortune-cookie {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.fortune-cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: var(--accent-peach);
  color: #1f2933;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(248,113,113,0.35);
  transform-origin: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.fortune-cookie-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(248,113,113,0.45);
}

.fortune-cookie-btn .cookie-emoji {
  font-size: 1.1rem;
}

@keyframes cookie-wiggle {
  0% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

.fortune-cookie-btn.shake {
  animation: cookie-wiggle 0.6s ease;
}

.fortune-cookie-strip {
  min-height: 1.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #fffdf7;
  border: 1px dashed rgba(148,163,184,0.7);
  font-size: 0.8rem;
  color: #374151;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 100%;
}

.fortune-cookie-strip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Thèmes */

.theme-cards {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.theme-card {
  border-radius: 16px;
  padding: 0.9rem 0.95rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 238, 0.96));
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 180px;
  max-width: 210px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-decoration: none;
  color: inherit;
}

.theme-card .theme-icon {
  font-size: 1.3rem;
}

.theme-card .theme-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.theme-card .theme-description {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Grille de citations */

.theme-block {
  margin-top: 1.4rem;
}

.theme-block-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.05rem;
  margin: 0 0 0.7rem;
}

.theme-block-title .icon {
  font-size: 1.1rem;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(240px,1fr));
  gap: 0.7rem;
}

.quote-card {
  background: rgba(255,255,255,0.98);
  border-radius: 16px;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(148,163,184,0.3);
  box-shadow: var(--shadow-soft);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quote-main {
  font-weight: 500;
}

.quote-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.quote-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.quote-meta-left {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.fav-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(148, 163, 184, 0.9);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.fav-btn span {
  color: #9ca3af; /* gris neutre quand non favori */
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.fav-btn:hover span {
  transform: translateY(-1px) scale(1.05);
}

.fav-btn.active span {
  color: #f97373; /* rouge doux quand favori */
}




.chip {
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.45);
  padding: 0.05rem 0.5rem;
}

/* Recherche */

.search-block {
  margin-top: 1.4rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  font-size: 0.85rem;
}

.search-meta {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Dark mode */

body.dark-mode {
  background: radial-gradient(circle at top, #020617, #020617);
  color: #e5e7eb;
}

body.dark-mode header {
  background: linear-gradient(to bottom, rgba(15,23,42,0.96), rgba(15,23,42,0.88));
  border-color: rgba(30,64,175,0.7);
}

body.dark-mode .theme-card,
body.dark-mode .quote-card,
body.dark-mode .qod-card {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.55);
  box-shadow: 0 18px 40px rgba(0,0,0,0.7);
}

body.dark-mode .hero-sub,
body.dark-mode .quote-sub,
body.dark-mode .search-meta,
body.dark-mode .qod-meta,
body.dark-mode .theme-card .theme-description {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* QOD lisible en mode nuit */

body.dark-mode .qod-card {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(251, 191, 36, 0.18));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

body.dark-mode .qod-label {
  color: rgba(249, 250, 251, 0.85);
}

body.dark-mode .qod-text {
  color: #f9fafb;
}

body.dark-mode .qod-meta {
  color: #e5e7eb;
}

body.dark-mode .qod-theme-chip {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.9);
}

/* Dark fortune cookie */

body.dark-mode .fortune-cookie-btn {
  background: #fbbf77;
  color: #111827;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.8);
}

body.dark-mode .fortune-cookie-strip {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148,163,184,0.9);
  color: #e5e7eb;
}

/* Responsive */

@media (max-width: 768px) {
  .shell {
    padding-inline: 0.9rem;
  }
  .top-bar {
    flex-wrap: wrap;
  }
  .qod-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }
  .theme-cards {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
}


.theme-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(127, 216, 190, 0.25), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}


.theme-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
  background: linear-gradient(135deg, rgba(127, 216, 190, 0.18), rgba(255, 184, 158, 0.18));
}


.fav-btn.active {
  color: #f97373;
  transform: scale(1.05);
  animation: fav-pop 0.22s ease-out;
}

.fav-btn span {
  pointer-events: none;
}

@keyframes fav-pop {
  0% {
    transform: scale(0.9);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}


.hero-subtitle-weekly {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}


.hero-text-en { display: none; }
body[data-lang="en"] .hero-text-fr { display: none; }
body[data-lang="en"] .hero-text-en { display: inline; }

.nav-en { display: none; }
body[data-lang="en"] .nav-fr { display: none; }
body[data-lang="en"] .nav-en { display: inline; }
