﻿:root {
  --bg-dark: rgba(10,10,10,0.45);
  --card-bg: rgba(255,255,255,0.06);
  --accent: rgba(255,255,255,0.9);
  --muted: rgba(255,255,255,0.6);
  font-family: Inter, Roboto, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial;
}
html, body {
  height: 100%;
  min-height: 100vh; /* Ajout : hauteur min = fenêtre */
  margin: 0;
  overflow-y: auto;  /* Scroll seulement si besoin */
}

body {
  overflow-y: auto; /* Correction : scroll vertical global */
  background: #000;
  color: white
}
#bg {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.55) contrast(1.05);
  transition: background-image 1s ease
}
#overlay {
  min-height: 100vh;
  position: relative;
  z-index: 2;
  padding: 18px;
  display: flex;
  flex-direction: column;
  height: 100%
}
header#topRow {
  display: flex;
  gap: 18px;
  align-items: stretch;
}
.card {
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35)
}
#timeCard {
  min-width: 180px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#time {
  font-size: 48px;
  font-weight: 600
}
#date {
  font-size: 16px;
  color: var(--muted)
}
#weatherCard {
  display: flex;
  gap: 8px;
  flex: 1;
  align-items: center;
  padding: 12px;
}
.weatherBlock {
  flex: 1;
  text-align: center
}
 .weatherBlock .title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px
 }
#weatherIcon {
  font-size: 28px
}
#weatherTemp {
  font-size: 22px;
  font-weight: 600
}
main {
  flex: 1;
  display: flex;
  margin-top: 18px
}
.card.large {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto !important;
  min-height: 0;
}
.card.large .title {
  font-size: 18px;
  margin-bottom: 8px
}
#calendarContent {
  flex: 1;
  overflow: auto !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#eventsList {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: auto !important;
  flex: 1;
  min-height: 0;
}
 #eventsList li {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.03)
 }
 #eventsList li .time {
  display: block;
  color: var(--muted);
  font-size: 13px
 }
 #eventsList li .summary {
  font-size: 16px
 }
footer {
  display: none !important;
  margin-top: 12px
}
#status {
  font-size: 13px;
  color: var(--muted)
}
.muted {
  color: var(--muted)
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.view-selector {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 4px;
  gap: 2px;
}
.view-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}
 .view-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--accent);
 }
 .view-btn.active {
  background: rgba(255,255,255,0.2);
  color: var(--accent);
  font-weight: 500;
 }

/* --- Vue Semaine : 7 jours sur une ligne en mode PC --- */
.week-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 15px;
  width: 100%;
  overflow-x: auto;
}
.week-day {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  height: auto; /* Correction : hauteur dynamique */
  display: flex;
  flex-direction: column;
}
.week-day-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.week-day-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.week-day-date {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.week-events {
  overflow-y: auto;
  max-height: none; /* Correction : pas de limite de hauteur */
}
.week-event-item {
  padding: 8px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  border-left: 3px solid rgba(255,255,255,0.3);
}
.week-event-time {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.week-event-summary {
  font-size: 13px;
  color: var(--accent);
}

/* --- Vue Mois : grille de semaines, cases plus grandes et texte lisible --- */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(90px, auto);
  gap: 6px;
  width: 100%;
  overflow-y: auto;
  font-size: 13px;
}
.month-day {
  min-height: 90px;
  font-size: 13px;
  padding: 6px;
  overflow-y: auto;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}
.month-day-header {
  text-align: center;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--accent);
}
.month-day-number {
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 12px;
}
.month-events-container {
  flex: 1;
  overflow-y: auto;
  max-height: 60px;
}
.month-event-item, .month-event-summary, .month-event-time {
  font-size: 12px !important;
  white-space: normal;
}
.month-event-item {
  padding: 2px 4px;
  margin-bottom: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
.month-event-time {
  font-weight: 600;
  margin-right: 2px;
}
.month-event-more {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 1px;
}
.month-day.other-month {
  color: var(--muted);
  opacity: 0.4;
}
.month-day.today {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
}

/* Touch targets et responsive */
@media (max-width: 1200px) {
  .week-container, .month-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .month-day {
    min-height: 70px;
    font-size: 11px;
  }
}
@media (max-width:800px) {
  #time {
    font-size: 40px
  }
  header#topRow {
    flex-direction: column;
    align-items: stretch;
  }
  #timeCard {
    min-width: auto;
    width: 100%;
  }
  #weatherCard {
    flex-direction: column;
    text-align: center;
  }
  .weatherBlock {
    width: 100%;
    margin-bottom: 8px;
  }
  .calendar-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    overflow: auto;
  }
  .view-selector {
    justify-content: center;
  }
  .week-container, .month-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .month-day {
    min-height: 60px;
    font-size: 10px;
  }
}
@media (max-width: 480px) {
  .month-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  .month-day {
    min-height: 80px;
  }
}