/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
}

:root {
  --max-width: 600px;
  --accent: #2f00ff;
  --accent-light: #6b4eff;
  --bg-gradient: linear-gradient(160deg, #f0f2f8 0%, #e2e6f0 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  color: #333;
  background: #e2e6f0;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-gradient);
  transition: background 2s ease;
}

/* Dynamic backgrounds based on time */
body.morning { --bg-gradient: linear-gradient(160deg, #dbeafe 0%, #eff6ff 100%); background-color: #eff6ff; }
body.noon { --bg-gradient: linear-gradient(160deg, #fef3c7 0%, #fffbeb 100%); background-color: #fffbeb; }
body.afternoon { --bg-gradient: linear-gradient(160deg, #fed7aa 0%, #fff7ed 100%); background-color: #fff7ed; }
body.evening { --bg-gradient: linear-gradient(160deg, #e0e7ff 0%, #eef2ff 100%); background-color: #eef2ff; }
body.night { --bg-gradient: linear-gradient(160deg, #1e1b4b 0%, #312e81 100%); background-color: #1e1b4b; color: #e2e8f0; }

a {
  text-decoration: none;
  color: inherit;
}

/* === MAIN CONTENT === */
.main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 1rem;
  gap: 1.5rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* === TOP BAR (Greeting + Weather) === */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.greeting {
  font-size: 1.05rem;
  font-weight: 500;
  color: #555;
  opacity: 0;
  animation: fadeIn 0.6s ease 0.3s forwards;
}

.phone-badge {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.phone-badge:hover {
  background: #bbf7d0;
  transform: scale(1.03);
}

body.night .phone-badge {
  background: rgba(74, 222, 128, 0.15);
  color: #86efac;
}

body.night .greeting { color: #c7d2fe; }

.weather {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #666;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.weather.loaded { opacity: 1; }
.weather-icon { font-size: 1.4rem; }
.weather-temp { font-weight: 600; font-size: 1rem; }
.weather-desc { font-size: 0.8rem; color: #888; display: none; }

body.night .weather { color: #a5b4fc; }

/* === HEADER === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-left {
  flex: 0 0 50px;
}

.title {
  flex: 1;
  text-align: center;
}

.header-right {
  flex: 0 0 50px;
  display: flex;
  justify-content: flex-end;
}

.info-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-toggle:hover {
  color: var(--accent);
  background: rgba(47, 0, 255, 0.06);
}

/* === ANALOG CLOCK === */
.analog-clock {
  width: 44px;
  height: 44px;
}

.clock-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: white;
  border: 2px solid #dde0e8;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 2px;
}

.hour-hand {
  width: 2.5px;
  height: 30%;
  background: #333;
  margin-left: -1.25px;
}

.minute-hand {
  width: 2px;
  height: 38%;
  background: #555;
  margin-left: -1px;
}

.second-hand {
  width: 1px;
  height: 40%;
  background: #e53e3e;
  margin-left: -0.5px;
  transition: none;
}

.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: #333;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.clock-number {
  position: absolute;
  font-size: 7px;
  font-weight: 700;
  color: #666;
}

.n12 { top: 3px; left: 50%; transform: translateX(-50%); }
.n3 { right: 4px; top: 50%; transform: translateY(-50%); }
.n6 { bottom: 3px; left: 50%; transform: translateX(-50%); }
.n9 { left: 4px; top: 50%; transform: translateY(-50%); }

/* === TITLE === */
#title {
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  letter-spacing: 2px;
  font-family: 'mortal_kombat_4regular', sans-serif;
  line-height: 1;
}

#title span {
  display: inline-block;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === SEARCH BAR === */
#formulaire_recherche {
  width: 100%;
}

.input-group {
  display: flex;
  align-items: center;
  width: 100%;
  height: 54px;
  border-radius: 27px;
  border: 1px solid #dfe1e5;
  background: white;
  padding: 0 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.input-group:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
}

.input-group:focus-within {
  box-shadow: 0 3px 14px rgba(47, 0, 255, 0.1);
  border-color: #b0b8ff;
}

#google_logo {
  margin-right: 12px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#google_logo img {
  width: 20px;
  height: 20px;
}

#text_recherche {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #333;
  background: transparent;
  font-family: inherit;
  min-width: 0;
}

#text_recherche::placeholder {
  color: #9aa0a6;
}

#loop {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}

#loop:hover {
  background: rgba(0, 0, 0, 0.04);
}

#loop img {
  width: 18px;
  height: 18px;
  opacity: 0.55;
}

/* === SLIDES / RACCOURCIS === */
.slider {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.group_of_slides {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  opacity: 0;
  animation: bounceIn 0.4s ease forwards;
}

/* Couleurs pastel par icône */
.slide[data-index="0"] .favicon { background: #dbeafe; } /* LANKAR - bleu */
.slide[data-index="1"] .favicon { background: #fee2e2; } /* Gmail - rouge clair */
.slide[data-index="2"] .favicon { background: #ffedd5; } /* Orange - orange clair */
.slide[data-index="3"] .favicon { background: #e0e7ff; } /* Outlook - indigo clair */
.slide[data-index="4"] .favicon { background: #fef9c3; } /* LaPoste - jaune clair */
.slide[data-index="5"] .favicon { background: #dbeafe; } /* Facebook - bleu clair */
.slide[data-index="6"] .favicon { background: #fee2e2; } /* YouTube - rouge clair */
.slide[data-index="7"] .favicon { background: #ffedd5; } /* LeBonCoin - orange clair */
.slide[data-index="8"] .favicon { background: #dcfce7; } /* JSL - vert clair */

/* Glow coloré au hover */
.slide[data-index="0"]:hover .favicon { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35); }
.slide[data-index="1"]:hover .favicon { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3); }
.slide[data-index="2"]:hover .favicon { box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3); }
.slide[data-index="3"]:hover .favicon { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3); }
.slide[data-index="4"]:hover .favicon { box-shadow: 0 4px 20px rgba(202, 138, 4, 0.25); }
.slide[data-index="5"]:hover .favicon { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35); }
.slide[data-index="6"]:hover .favicon { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3); }
.slide[data-index="7"]:hover .favicon { box-shadow: 0 4px 20px rgba(249, 115, 22, 0.3); }
.slide[data-index="8"]:hover .favicon { box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3); }

.slide:nth-child(1) { animation-delay: 0.05s; }
.slide:nth-child(2) { animation-delay: 0.1s; }
.slide:nth-child(3) { animation-delay: 0.15s; }

.group_of_slides:nth-child(2) .slide:nth-child(1) { animation-delay: 0.2s; }
.group_of_slides:nth-child(2) .slide:nth-child(2) { animation-delay: 0.25s; }
.group_of_slides:nth-child(2) .slide:nth-child(3) { animation-delay: 0.3s; }

.group_of_slides:nth-child(3) .slide:nth-child(1) { animation-delay: 0.35s; }
.group_of_slides:nth-child(3) .slide:nth-child(2) { animation-delay: 0.4s; }
.group_of_slides:nth-child(3) .slide:nth-child(3) { animation-delay: 0.45s; }

body.night .slide { background: transparent; box-shadow: none; }
body.night .slide p { color: #94a3b8; }
body.night .slide .favicon {
  background: rgba(255, 255, 255, 0.08) !important;
}

.slide:hover {
  transform: scale(1.08) translateY(-3px);
}

.slide:hover .favicon {
  transform: scale(1.05);
}

.slide:active {
  transform: translateY(0);
}

.slide .favicon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  padding: 12px;
  transition: all 0.25s ease;
}

.slide .favicon img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: contain;
}

.slide p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.82rem;
  color: #444;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 1;
  transform: none;
  transition: color 0.2s ease;
}

.slide:hover p {
  color: var(--accent);
}

.slide a {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === ALERT WINDOWS 10 === */
.small-alert {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 171, 0, 0.07);
  border: 1px solid rgba(255, 171, 0, 0.25);
  border-radius: 12px;
  color: #92400e;
  font-size: 0.8rem;
  width: 100%;
  text-align: center;
  animation: slideIn 0.4s ease;
}

.small-alert svg {
  flex-shrink: 0;
  color: #d97706;
}

/* === ASSISTANCE BUTTON === */
.assistance-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  border-radius: 26px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(47, 0, 255, 0.18);
}

.assistance-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(47, 0, 255, 0.3);
}

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

/* === INFO PANEL === */
.info-panel {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: white;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  transition: left 0.3s ease;
  overflow-y: auto;
  padding: 2rem 1.5rem;
}

.info-panel.open {
  left: 0;
}

.info-panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.info-panel-close:hover {
  background: #f0f0f0;
  color: #333;
}

.info-panel-content h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.info-section {
  margin-bottom: 1.1rem;
}

.info-section h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.25rem;
}

.info-section p {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.5;
}

.info-section a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.info-section a:hover {
  color: var(--accent-light);
}

.reset-btn {
  margin-top: 1.5rem;
  width: 100%;
  padding: 10px 16px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.reset-btn:hover {
  background: #059669;
}

/* === OVERLAY / FORM === */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  z-index: 2000;
}

.overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.form {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 90%;
  max-width: 340px;
  animation: scaleIn 0.2s ease;
}

.form-title {
  font-family: 'mortal_kombat_4regular', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.form label {
  font-size: 0.82rem;
  color: #666;
  align-self: flex-start;
}

.form input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form input:focus {
  border-color: var(--accent);
}

.buttons-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.25rem;
}

.cancel-btn,
.submit-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: #f1f5f9;
  color: #64748b;
}

.cancel-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

.submit-btn {
  background: var(--accent);
  color: white;
}

.submit-btn:hover {
  background: var(--accent-light);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.8) translateY(10px); }
  60% { opacity: 1; transform: scale(1.03) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* === NIGHT MODE ADAPTATIONS === */
body.night .input-group {
  background: #1e293b;
  border-color: #334155;
}
body.night #text_recherche {
  color: #e2e8f0;
}
body.night #text_recherche::placeholder {
  color: #64748b;
}
body.night #loop img {
  filter: invert(1);
  opacity: 0.9;
}
body.night .clock-face {
  background: #1e293b;
  border-color: #475569;
}
body.night .clock-number { color: #94a3b8; }
body.night .hour-hand { background: #e2e8f0; }
body.night .minute-hand { background: #94a3b8; }
body.night .clock-center { background: #e2e8f0; }
body.night .info-toggle { color: #94a3b8; }
body.night .assistance-btn {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

/* === RESPONSIVE === */

/* Tablette */
@media screen and (max-width: 768px) {
  .main-content {
    padding: 1.5rem 1rem;
    gap: 1.4rem;
  }

  .slide .favicon {
    width: 58px;
    height: 58px;
    padding: 11px;
    border-radius: 16px;
  }
}

/* Grand mobile */
@media screen and (max-width: 600px) {
  :root {
    --max-width: 100%;
  }

  .main-content {
    padding: 1.2rem 0.75rem;
    gap: 1.2rem;
  }

  .top-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .greeting {
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }

  .phone-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
  }

  .weather {
    font-size: 0.85rem;
  }

  .weather-icon { font-size: 1.2rem; }
  .weather-temp { font-size: 0.9rem; }

  #title {
    font-size: 2.8rem;
  }

  .header-left { flex: 0 0 40px; }
  .header-right { flex: 0 0 40px; }

  .analog-clock {
    width: 38px;
    height: 38px;
  }

  .clock-number { font-size: 6px; }
  .n12 { top: 2px; }
  .n3 { right: 3px; }
  .n6 { bottom: 2px; }
  .n9 { left: 3px; }

  .input-group {
    height: 48px;
    padding: 0 14px;
    border-radius: 24px;
  }

  #text_recherche {
    font-size: 0.9rem;
  }

  .group_of_slides {
    gap: 10px;
  }

  .slide .favicon {
    width: 52px;
    height: 52px;
    padding: 10px;
    border-radius: 14px;
  }

  .slide p {
    font-size: 0.72rem;
    margin-top: 4px;
  }

  .assistance-btn {
    font-size: 0.85rem;
    padding: 10px 20px;
  }

  .info-panel {
    width: 280px;
  }
}

/* Petit mobile */
@media screen and (max-width: 420px) {
  .main-content {
    padding: 1rem 0.6rem;
    gap: 1rem;
  }

  #title {
    font-size: 2.4rem;
  }

  .greeting {
    font-size: 0.85rem;
  }

  .phone-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .analog-clock {
    width: 34px;
    height: 34px;
  }

  .input-group {
    height: 44px;
    padding: 0 12px;
  }

  #text_recherche {
    font-size: 0.85rem;
  }

  .group_of_slides {
    gap: 8px;
  }

  .slide {
    padding: 6px 2px;
  }

  .slide .favicon {
    width: 46px;
    height: 46px;
    padding: 9px;
    border-radius: 13px;
  }

  .slide p {
    font-size: 0.68rem;
    margin-top: 3px;
  }

  .assistance-btn {
    font-size: 0.8rem;
    padding: 9px 16px;
  }

  .info-panel {
    width: 260px;
  }
}

/* Très petit écran */
@media screen and (max-width: 350px) {
  #title {
    font-size: 2rem;
  }

  .top-bar {
    gap: 4px;
  }

  .greeting {
    font-size: 0.78rem;
  }

  .phone-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .weather-icon { font-size: 1rem; }
  .weather-temp { font-size: 0.8rem; }

  .analog-clock {
    width: 30px;
    height: 30px;
  }

  .clock-number { font-size: 5px; }

  .input-group {
    height: 42px;
  }

  #text_recherche {
    font-size: 0.8rem;
  }

  .group_of_slides {
    gap: 6px;
  }

  .slide .favicon {
    width: 40px;
    height: 40px;
    padding: 7px;
    border-radius: 11px;
  }

  .slide p {
    font-size: 0.6rem;
  }

  .assistance-btn {
    font-size: 0.75rem;
    padding: 8px 14px;
    border-radius: 20px;
  }

  .info-panel {
    width: 240px;
    padding: 1.5rem 1rem;
  }
}

/* Mode paysage mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .main-content {
    justify-content: flex-start;
    padding-top: 0.5rem;
    gap: 0.8rem;
  }

  #title {
    font-size: 2rem;
  }

  .slide .favicon {
    width: 40px;
    height: 40px;
    padding: 7px;
  }

  .slide p {
    font-size: 0.6rem;
    margin-top: 2px;
  }
}
