@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-space: #07080f;
  --bg-space-light: #0d0f1a;
  --bg-glass: rgba(18, 22, 38, 0.55);
  --bg-glass-hover: rgba(26, 32, 54, 0.7);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-glow: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* I-DEO variables (Teal/Mint) */
  --ideo-color: #00f5a0;
  --ideo-color-rgb: 0, 245, 160;
  --ideo-gradient: linear-gradient(135deg, #00f5a0, #00d8f6);
  --ideo-glow: 0 0 15px rgba(0, 245, 160, 0.35);

  /* I-CLICK variables (Vibrant Cyan/Blue) */
  --iclick-color: #0072ff;
  --iclick-color-rgb: 0, 114, 255;
  --iclick-gradient: linear-gradient(135deg, #0072ff, #00f2fe);
  --iclick-glow: 0 0 15px rgba(0, 114, 255, 0.35);

  /* I-CLOCK variables (Coral/Sunset) */
  --iclock-color: #ff512f;
  --iclock-color-rgb: 255, 81, 47;
  --iclock-gradient: linear-gradient(135deg, #ff512f, #dd2476);
  --iclock-glow: 0 0 15px rgba(255, 81, 47, 0.35);

  /* Foot variables (Vibrant Royal Blue / Tricolore) */
  --foot-color: #0072ff;
  --foot-color-rgb: 0, 114, 255;
  --foot-gradient: linear-gradient(135deg, #0a194a, #002fbe, #ef4444);
  --foot-glow: 0 0 15px rgba(0, 114, 255, 0.35);

  /* System UI elements */
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --glow-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(at 10% 20%, rgba(13, 15, 26, 0.9) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(0, 114, 255, 0.08) 0px, transparent 40%),
    radial-gradient(at 50% 80%, rgba(0, 245, 160, 0.05) 0px, transparent 50%),
    radial-gradient(at 80% 90%, rgba(255, 81, 47, 0.06) 0px, transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism panel core utility */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--glass-shadow);
  border-radius: var(--border-radius-lg);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-glass-glow);
}

/* Header & Controls */
header {
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(7, 8, 15, 0.4);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--iclick-color), var(--ideo-color));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 114, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: rotate(45deg);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% { transform: translate(-100%, -100%) rotate(45deg); }
  100% { transform: translate(100%, 100%) rotate(45deg); }
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-weight: 300;
  color: var(--text-secondary);
  -webkit-text-fill-color: initial;
}

/* Active Calendars (Layers) */
.active-calendars {
  display: flex;
  background: rgba(18, 22, 38, 0.4);
  border: 1px solid var(--border-glass);
  padding: 5px;
  border-radius: 15px;
  gap: 6px;
}

.layer-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-bounce);
}

.layer-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  transition: var(--transition-bounce);
}

/* Active Layer States */
.layer-btn[data-layer="ideo"].active {
  background: rgba(0, 245, 160, 0.12);
  color: var(--ideo-color);
  box-shadow: 0 0 10px rgba(0, 245, 160, 0.15);
  border: 1px solid rgba(0, 245, 160, 0.3);
}
.layer-btn[data-layer="ideo"] .dot { background: var(--ideo-color); }
.layer-btn[data-layer="ideo"].inactive .dot { background: #334155; opacity: 0.5; }

.layer-btn[data-layer="iclick"].active {
  background: rgba(0, 114, 255, 0.12);
  color: var(--iclick-color);
  box-shadow: 0 0 10px rgba(0, 114, 255, 0.15);
  border: 1px solid rgba(0, 114, 255, 0.3);
}
.layer-btn[data-layer="iclick"] .dot { background: var(--iclick-color); }
.layer-btn[data-layer="iclick"].inactive .dot { background: #334155; opacity: 0.5; }

.layer-btn[data-layer="iclock"].active {
  border-color: var(--iclock-color);
  box-shadow: 0 0 10px rgba(255, 81, 47, 0.25);
  background: rgba(255, 81, 47, 0.08);
}
.layer-btn[data-layer="iclock"] .dot { background: var(--iclock-color); }
.layer-btn[data-layer="iclock"].inactive .dot { background: #334155; opacity: 0.5; }

.layer-btn[data-layer="foot"].active {
  border-color: var(--foot-color);
  box-shadow: 0 0 10px rgba(0, 114, 255, 0.25);
  background: rgba(0, 114, 255, 0.08);
}
.layer-btn[data-layer="foot"] .dot { background: var(--foot-color); }
.layer-btn[data-layer="foot"].inactive .dot { background: #334155; opacity: 0.5; }

.layer-btn.inactive {
  opacity: 0.45;
  color: var(--text-muted);
}

/* Mode Premium Switch */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.premium-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(18, 22, 38, 0.4);
  border: 1px solid var(--border-glass);
  padding: 6px 12px;
  border-radius: 12px;
}

.premium-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--iclock-color), #dd2476);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Main Dashboard layout */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 10px 20px;
  gap: 10px;
  height: calc(100vh - 85px);
}

/* Main View container with camera animation */
.view-viewport {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  perspective: 1200px;
  transform-style: preserve-3d;
}

/* Transition flash overlay for cinematic zoom feel */
.view-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  border-radius: var(--border-radius-lg);
  transition: opacity 0.15s ease;
}

.view-viewport.zooming::after {
  opacity: 1;
  animation: zoomFlash 0.55s ease forwards;
}

@keyframes zoomFlash {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

.timeline-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 45px;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity   0.45s cubic-bezier(0.22, 1, 0.36, 1),
    filter    0.45s ease,
    visibility 0.55s ease;
  transform-style: preserve-3d;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  filter: blur(0px);
  will-change: transform, opacity, filter;
}

/* === ZOOM OUT (going from detail → overview): old view shrinks away === */
.timeline-view.zoom-out-fade {
  transform: scale(0.55) translateZ(-200px) rotateX(6deg);
  opacity: 0;
  filter: blur(6px);
  pointer-events: none;
  visibility: hidden;
}

/* === ZOOM IN (going from overview → detail): old view explodes toward camera === */
.timeline-view.zoom-in-fade {
  transform: scale(1.6) translateZ(180px) rotateX(-5deg);
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
  visibility: hidden;
}

/* Slide-left for time navigation */
.timeline-view.slide-left-out {
  transform: translateX(-6%) scale(0.96);
  opacity: 0;
  filter: blur(3px);
  pointer-events: none;
  visibility: hidden;
}

.timeline-view.slide-right-out {
  transform: translateX(6%) scale(0.96);
  opacity: 0;
  filter: blur(3px);
  pointer-events: none;
  visibility: hidden;
}

.timeline-view.active {
  transform: scale(1) translateZ(0) rotateX(0deg);
  opacity: 1;
  filter: blur(0px);
  pointer-events: all;
  visibility: visible;
  z-index: 10;
}

/* The Horizontal Timeline Core */
.timeline-wrapper {
  position: absolute;
  top: 60%;
  transform: translateY(-50%);
  width: 100%;
  height: 480px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0 100px;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbar for clean spec look */
}

.timeline-wrapper::-webkit-scrollbar {
  display: none;
}

/* central laser line */
.timeline-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.01) 0%, 
    rgba(255,255,255,0.18) 10%, 
    rgba(255,255,255,0.18) 90%, 
    rgba(255,255,255,0.01) 100%
  );
  top: 60%;
  transform: translateY(-50%);
  z-index: 1;
}

/* Timeline Track hosting the blocks */
.timeline-track {
  display: flex;
  height: 100%;
  align-items: center;
  position: relative;
  z-index: 2;
  gap: 15px;
}

/* Timeline Time Unit Slots */
.time-unit {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 120px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(18, 22, 38, 0.2);
  transition: var(--transition-bounce);
  cursor: pointer;
  user-select: none;
}

.time-unit:hover {
  background: rgba(18, 22, 38, 0.55);
  border-color: rgba(255, 255, 255, 0.12);
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.time-unit.active-today {
  border-color: rgba(0, 114, 255, 0.4);
  background: rgba(0, 114, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 114, 255, 0.15);
}

.time-unit.selected {
  border-color: var(--ideo-color);
  background: rgba(0, 245, 160, 0.05);
  box-shadow: 0 0 15px rgba(0, 245, 160, 0.1);
}

/* Slash marker on the center line representing the notch from the sketch */
.time-notch {
  position: absolute;
  width: 3px;
  height: 20px;
  background: var(--text-muted);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(25deg);
  transition: var(--transition-smooth);
}

.time-unit:hover .time-notch {
  background-color: var(--text-primary);
  height: 26px;
}

/* Time labels text rendering */
.time-label-top {
  position: absolute;
  top: 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.time-label-bottom {
  position: absolute;
  bottom: 15px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Different sizes for view layouts */
.timeline-view[data-view="year"] .time-unit {
  width: 140px;
  height: 130px;
}

.timeline-view[data-view="year"] .time-label-bottom {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

.timeline-view[data-view="week"] .time-unit {
  width: 150px;
  height: 140px;
}

.timeline-view[data-view="day"] .time-unit {
  width: 85px;
  height: 110px;
}
.timeline-view[data-view="day"] .time-label-bottom {
  font-size: 16px;
}

/* Floating Events on Timeline (Exact replication of hand sketch floating icon circles) */
.floating-event-chip {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--glow-shadow);
  transition: var(--transition-bounce);
  border: 2px solid #000;
}

.floating-event-chip * {
  pointer-events: none;
}

.floating-event-chip:hover {
  z-index: 20;
}

.floating-event-chip svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
  fill: none;
}

/* Floating dynamic positions (above and below the center timeline line) */
.floating-event-chip.pos-above {
  transform: translateY(-110px);
}
.floating-event-chip.pos-above:hover {
  transform: translateY(-110px) scale(1.25) rotate(8deg);
}

.floating-event-chip.pos-below {
  transform: translateY(80px);
}
.floating-event-chip.pos-below:hover {
  transform: translateY(80px) scale(1.25) rotate(8deg);
}

/* Category gradients and glow on timeline */
.floating-event-chip[data-layer="ideo"] {
  background: var(--ideo-gradient);
  box-shadow: var(--ideo-glow);
  border-color: rgba(255,255,255,0.25);
}

.floating-event-chip[data-layer="iclick"] {
  background: var(--iclick-gradient);
  box-shadow: var(--iclick-glow);
  border-color: rgba(255,255,255,0.25);
}

.floating-event-chip[data-layer="iclock"] {
  background: var(--iclock-gradient);
  box-shadow: var(--iclock-glow);
  border-color: rgba(255,255,255,0.25);
}

/* Connection arrow lines pointing from floating event circles to target day notch */
.event-connect-line {
  position: absolute;
  width: 2px;
  background: rgba(255, 255, 255, 0.15);
  transform-origin: top center;
  z-index: 5;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.floating-event-chip:hover + .event-connect-line {
  background: var(--text-primary);
  box-shadow: 0 0 8px #ffffff;
}

/* Style spécial pour les puces F1 GP */
.floating-event-chip.f1-gp-chip {
  background: rgba(10, 10, 15, 0.92) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
}

.floating-event-chip.f1-gp-chip.pos-above:hover {
  transform: translateY(-110px) scale(1.3) rotate(5deg) !important;
  border-color: #ff3300 !important;
  box-shadow: 0 0 15px rgba(255, 51, 0, 0.7) !important;
}

.floating-event-chip.f1-gp-chip:hover + .event-connect-line {
  background: #ff3300 !important;
  box-shadow: 0 0 8px rgba(255, 51, 0, 0.8) !important;
}

.f1-gp-chip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.f1-gp-circuit-svg {
  width: 28px;
  height: 28px;
  display: block;
}

.f1-gp-flag-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 13px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 50%;
  padding: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Style spécial pour les puces de la Coupe du Monde */
.floating-event-chip.wc-match-chip {
  background: rgba(10, 15, 30, 0.92) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
}

.floating-event-chip.wc-match-chip.pos-above:hover {
  transform: translateY(-110px) scale(1.3) rotate(-5deg) !important;
  border-color: #0072ff !important;
  box-shadow: 0 0 15px rgba(0, 114, 255, 0.7) !important;
}

.floating-event-chip.wc-match-chip:hover + .event-connect-line {
  background: #0072ff !important;
  box-shadow: 0 0 8px rgba(0, 114, 255, 0.8) !important;
}

.wc-match-chip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wc-match-icon {
  font-size: 24px;
  line-height: 1;
}

.wc-flag-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 13px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 50%;
  padding: 1px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Floating Gamepad/Navigation Dial */
.gamepad-container {
  position: absolute;
  right: 50px;
  top: 60%;
  transform: translateY(-50%);
  width: 150px;
  height: 150px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gamepad-body {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(30, 37, 64, 0.8) 0%, rgba(14, 18, 33, 0.95) 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 15px 35px rgba(0,0,0,0.6),
    inset 0 2px 4px rgba(255,255,255,0.1),
    inset 0 -2px 4px rgba(0,0,0,0.5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
}

.gamepad-center-hub {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  background: radial-gradient(circle, rgba(22, 28, 45, 0.9) 0%, rgba(7, 8, 15, 0.95) 100%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.6);
  position: relative;
}

.gamepad-center-hub::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--iclick-color);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--iclick-color);
  transition: var(--transition-bounce);
}

.gamepad-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-bounce);
  user-select: none;
  outline: none;
}

.gamepad-btn:hover {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(255,255,255,0.6);
}

.gamepad-btn:active {
  transform: scale(0.9);
}

.gamepad-btn-up { grid-column: 2 / 3; grid-row: 1 / 2; }
.gamepad-btn-left { grid-column: 1 / 2; grid-row: 2 / 3; }
.gamepad-btn-right { grid-column: 3 / 4; grid-row: 2 / 3; }
.gamepad-btn-down { grid-column: 2 / 3; grid-row: 3 / 4; }

/* Dynamic Floating Labels on Navigation buttons to match French specification labels */
.nav-badge-label {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
  white-space: nowrap;
}
.gamepad-container .nav-badge-up { top: -20px; left: 50%; transform: translateX(-50%); }
.gamepad-container .nav-badge-down { bottom: -20px; left: 50%; transform: translateX(-50%); }
.gamepad-container .nav-badge-left { left: -50px; top: 50%; transform: translateY(-50%); }
.gamepad-container .nav-badge-right { right: -50px; top: 50%; transform: translateY(-50%); }

/* Interactive Widgets Bottom Area */
.dashboard-bottom-area {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 15px;
  height: 165px;
  margin-top: auto;
}

/* Event / Deadline panel list */
.events-panel {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title svg {
  width: 18px;
  height: 18px;
  stroke: var(--iclick-color);
}

.add-event-fab {
  background: linear-gradient(135deg, var(--iclick-color), var(--ideo-color));
  color: #fff;
  border: none;
  padding: 6px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 11.5px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 114, 255, 0.25);
  transition: var(--transition-bounce);
}

.add-event-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 114, 255, 0.4);
}

.events-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.events-list-scroll::-webkit-scrollbar {
  width: 5px;
}
.events-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.events-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* Event List Card */
.event-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 12px 18px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.event-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.event-card-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.event-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.event-card-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.event-card-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Event Category Accent Styling on List */
.event-card[data-layer="ideo"] .event-card-icon { background: rgba(0, 245, 160, 0.12); color: var(--ideo-color); }
.event-card[data-layer="ideo"] .event-card-tag { background: rgba(0, 245, 160, 0.12); color: var(--ideo-color); }
.event-card[data-layer="iclick"] .event-card-icon { background: rgba(0, 114, 255, 0.12); color: var(--iclick-color); }
.event-card[data-layer="iclick"] .event-card-tag { background: rgba(0, 114, 255, 0.12); color: var(--iclick-color); }
.event-card[data-layer="iclock"] .event-card-icon { background: rgba(255, 81, 47, 0.12); color: var(--iclock-color); }
.event-card[data-layer="iclock"] .event-card-tag { background: rgba(255, 81, 47, 0.12); color: var(--iclock-color); }

.no-events-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 10px;
  height: 100%;
  padding-bottom: 20px;
  font-size: 12.5px;
}
.no-events-state svg {
  width: 40px;
  height: 40px;
  stroke: var(--text-muted);
  opacity: 0.5;
}

/* Secondary interactive column: Ads / Weather widgets */
.widgets-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

/* Weather Widget Feed Panel — Premium redesign */
.weather-panel {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.weather-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius-lg);
  background: linear-gradient(135deg,
    rgba(0, 114, 255, 0.04) 0%,
    rgba(0, 245, 160, 0.03) 100%);
  pointer-events: none;
}

.weather-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.weather-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weather-location-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.07);
}

/* La ville est un bouton : on clique dessus pour en changer */
button.weather-location-badge {
  font-family: inherit;
  cursor: pointer;
  min-height: 24px;
}
button.weather-location-badge:hover {
  color: var(--text-primary);
  border-color: var(--border-glass-glow);
}

.weather-city-picker {
  margin-bottom: 8px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.weather-panel.is-picking-city .weather-track {
  display: none;
}
.weather-city-row {
  display: flex;
  gap: 6px;
}
.weather-city-row input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: inherit;
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 8px;
}
.weather-city-row button,
.weather-city-option {
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: inherit;
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 8px;
  cursor: pointer;
}
.weather-city-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  overflow-y: auto;
}
.weather-city-option:hover,
.weather-city-row button:hover {
  background: rgba(127, 127, 127, 0.25);
}

.weather-chip-min {
  font-size: 0.75em;
  font-weight: 600;
  opacity: 0.6;
}

.weather-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  align-items: stretch;
}
.weather-track::-webkit-scrollbar { display: none; }

.weather-chip {
  min-width: 68px;
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 6px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.weather-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--chip-bg, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.weather-chip:hover {
  transform: translateY(-4px) scale(1.04);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.weather-chip:hover::before {
  opacity: 1;
}

.weather-chip.is-today {
  background: rgba(0, 114, 255, 0.07);
  border-color: rgba(0, 114, 255, 0.25);
  box-shadow: 0 0 14px rgba(0, 114, 255, 0.12);
}

.weather-chip-day {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
}

.weather-chip-date {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
}

.weather-icon-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-icon-svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Animated weather icons */
.weather-chip[data-condition="soleil"] .weather-icon-svg {
  animation: weatherSunSpin 12s linear infinite;
}
.weather-chip[data-condition="orage"] .weather-icon-svg {
  animation: weatherStormPulse 1.5s ease-in-out infinite;
}
.weather-chip[data-condition="pluie"] .weather-icon-svg {
  animation: weatherRainBob 2s ease-in-out infinite;
}
.weather-chip[data-condition="nuage_soleil"] .weather-icon-svg {
  animation: weatherCloudDrift 4s ease-in-out infinite;
}

@keyframes weatherSunSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes weatherStormPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px rgba(255,80,0,0)); }
  50%       { transform: scale(1.1); filter: drop-shadow(0 0 6px rgba(255,80,0,0.6)); }
}
@keyframes weatherRainBob {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(3px); }
}
@keyframes weatherCloudDrift {
  0%, 100% { transform: translateX(0px); }
  50%       { transform: translateX(4px); }
}

.weather-chip-temp {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.weather-chip-desc {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  text-transform: capitalize;
  font-weight: 500;
  line-height: 1.2;
}

/* Banner Ads / Paid mode news widget */
.banner-widget {
  height: 100%;
  overflow: hidden;
  position: relative;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-glass);
}

.banner-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 15px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.banner-content.hidden {
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
}

.banner-content.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Free Mode Ads Styling */
.free-ad-banner {
  background: linear-gradient(135deg, rgba(22, 28, 45, 0.85), rgba(7, 8, 15, 0.95));
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

body[data-mode="light"] .free-ad-banner {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.95), rgba(226, 232, 240, 0.98));
}

.ad-sponsor-tag {
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

body[data-mode="light"] .ad-sponsor-tag {
  background: rgba(0, 0, 0, 0.06);
  color: #64748b;
}

.ad-text-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ad-brand {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

body[data-mode="light"] .ad-brand {
  color: #0f172a;
}

.ad-slogan {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

body[data-mode="light"] .ad-slogan {
  color: #334155;
}

.free-ad-banner .ideodock-download-btn {
  background: #ffffff;
  color: #000000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: stretch;
  text-align: center;
  justify-content: center;
}

body[data-mode="light"] .free-ad-banner .ideodock-download-btn {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.free-ad-banner .ideodock-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

body[data-mode="light"] .free-ad-banner .ideodock-download-btn:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

/* Paid Mode Content */
.paid-news-banner {
  background: linear-gradient(135deg, rgba(0, 114, 255, 0.15), rgba(0, 245, 160, 0.08));
  width: 100%;
  height: 100%;
  border: 1px solid rgba(0, 245, 160, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

body[data-mode="light"] .paid-news-banner {
  background: linear-gradient(135deg, rgba(0, 114, 255, 0.06), rgba(0, 245, 160, 0.03));
  border-color: rgba(0, 114, 255, 0.15);
}

.news-icon {
  width: 36px;
  height: 36px;
  background: var(--ideo-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.news-icon svg { width: 18px; height: 18px; stroke: #000; }

.news-text-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.news-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ideo-color);
  letter-spacing: 0.5px;
}

.news-headline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Slide out / Pop-out Agenda Panel (Entrée Agenda Form) */
.agenda-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 15, 0.6);
  backdrop-filter: blur(8px);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.agenda-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.agenda-modal-panel {
  position: fixed;
  right: -450px;
  top: 0;
  bottom: 0;
  width: 440px;
  background: rgba(18, 22, 38, 0.75);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-left: 1px solid var(--border-glass);
  box-shadow: -15px 0 45px rgba(0,0,0,0.5);
  z-index: 510;
  display: flex;
  flex-direction: column;
  padding: 35px;
  transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.agenda-modal-panel.active {
  right: 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* Beautiful Form controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: var(--transition-smooth);
  outline: none;
}

.form-input:focus {
  border-color: var(--iclick-color);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 12px rgba(0, 114, 255, 0.15);
}

/* Modal Form Category Selector */
.form-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.form-category-radio {
  position: relative;
  cursor: pointer;
}

.form-category-radio input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-category-card {
  padding: 10px;
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition-bounce);
  color: var(--text-secondary);
}

.form-category-radio input:checked + .form-category-card[data-cat="ideo"] {
  border-color: var(--ideo-color);
  background: rgba(0, 245, 160, 0.08);
  color: var(--ideo-color);
  box-shadow: var(--ideo-glow);
}

.form-category-radio input:checked + .form-category-card[data-cat="iclick"] {
  border-color: var(--iclick-color);
  background: rgba(0, 114, 255, 0.08);
  color: var(--iclick-color);
  box-shadow: var(--iclick-glow);
}

.form-category-radio input:checked + .form-category-card[data-cat="iclock"] {
  border-color: var(--iclock-color);
  background: rgba(255, 81, 47, 0.08);
  color: var(--iclock-color);
  box-shadow: var(--iclock-glow);
}

/* Icon Selection Grid */
.icon-selector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px;
  border-radius: var(--border-radius-md);
}

.form-icon-option {
  position: relative;
  cursor: pointer;
}

.form-icon-option input {
  position: absolute;
  opacity: 0;
}

.form-icon-box {
  width: 100%;
  aspect-ratio: 1;
  background: transparent;
  border-radius: 8px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.form-icon-option input:checked + .form-icon-box {
  background: rgba(255,255,255,0.08);
  border-color: var(--text-primary);
  color: var(--text-primary);
  transform: scale(1.1);
}

.form-icon-box svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* IdeoDock Share Download Card */
.ideodock-download-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px dashed rgba(0, 114, 255, 0.3);
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-smooth);
}

.ideodock-download-card.active {
  border-style: solid;
  border-color: rgba(0, 114, 255, 0.5);
  box-shadow: 0 4px 15px rgba(0, 114, 255, 0.1);
}

.ideodock-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ideodock-mini-logo {
  width: 26px;
  height: 26px;
  background: var(--iclick-gradient);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ideodock-mini-logo svg { width: 14px; height: 14px; stroke: #fff; }

.ideodock-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ideodock-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ideodock-download-btn {
  background: linear-gradient(90deg, #0072ff, #00f5a0);
  border: none;
  color: #000;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-bounce);
}

.ideodock-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 245, 160, 0.3);
}

.ideodock-download-btn svg { width: 12px; height: 12px; stroke: #000; }

/* Modal Form Button Panel */
.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--iclick-color), var(--ideo-color));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--border-radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-bounce);
  text-align: center;
}

.btn-primary:hover {
  box-shadow: 0 5px 15px rgba(0, 114, 255, 0.35);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  padding: 14px;
  border-radius: var(--border-radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-delete {
  background: rgba(255, 81, 47, 0.1);
  border: 1px solid rgba(255, 81, 47, 0.2);
  color: var(--iclock-color);
}

.btn-delete:hover {
  background: rgba(255, 81, 47, 0.2);
  color: #fff;
}

/* Event Tooltip / Detail Popover */
.event-popover {
  position: absolute;
  background: rgba(18, 22, 38, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass-glow);
  padding: 16px 20px;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 1000;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: all;
  transition: var(--transition-smooth);
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.popover-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.popover-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.popover-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.popover-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.popover-btn-edit {
  border-color: rgba(0, 114, 255, 0.3);
  color: var(--iclick-color);
}
.popover-btn-edit:hover {
  background: rgba(0, 114, 255, 0.15);
}

.popover-routine-tag {
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
  display: flex;
  align-items: center;
  user-select: none;
}

/* Custom Alert / Toast Notification */
.toast-container {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(18, 22, 38, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 245, 160, 0.2);
  padding: 12px 24px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-150%);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.toast svg {
  width: 18px;
  height: 18px;
  stroke: var(--ideo-color);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .dashboard-bottom-area {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }
  .widgets-column {
    height: auto;
  }
  .gamepad-container {
    right: 20px;
    width: 110px;
    height: 110px;
  }
  .gamepad-body {
    width: 100px;
    height: 100px;
  }
  .gamepad-container .nav-badge-label {
    display: none;
  }
  .timeline-wrapper {
    padding: 0 40px;
  }
}

/* ==========================================================================
   MODES & THÈMES DE L'AGENDA (SPÉCIFIÉS PAR DESSINS ET QUESTIONS)
   ========================================================================== */

/* 1. Gestion des overlays de fonds d'écran dynamiques */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: background-image 1s ease, opacity 1s ease;
}

body[data-theme="cyber"]::before {
  background-image: url('creative_idea_neon.png');
  opacity: 0.12;
}

body[data-theme="f1"]::before {
  background-image: url('f1_racing_neon.png');
  opacity: 0.28;
}

body[data-theme="foot"]::before {
  background-image: url('equipe_france_photo.png');
  opacity: 0.18;
}

body[data-theme="safari"]::before {
  background-image: url('safari_child_cartoon.png');
  opacity: 0.38;
}

body[data-theme="magicien"]::before {
  background-image: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.22), transparent 70%);
  opacity: 0.8;
}

/* ✨ THÈME SAISONS ILLUSTRÉES */
body[data-theme="saisons"]::before {
  background-image: url('saisons_illustrees_bg.png');
  opacity: 0.32;
}

body[data-theme="saisons"] {
  background-color: #1a100a;
  background-image:
    radial-gradient(at 15% 15%, rgba(255, 182, 100, 0.12) 0px, transparent 45%),
    radial-gradient(at 85% 20%, rgba(100, 200, 120, 0.10) 0px, transparent 40%),
    radial-gradient(at 15% 80%, rgba(220, 100, 60, 0.10) 0px, transparent 45%),
    radial-gradient(at 85% 85%, rgba(100, 160, 220, 0.10) 0px, transparent 45%);
}

/* Détection dynamique de la saison courante pour le thème */
body[data-theme="saisons"][data-season="spring"] {
  --season-color: #a8e6a3;
  --season-color-rgb: 168, 230, 163;
  --season-accent: #ff9cc2;
  --season-bg: rgba(168, 230, 163, 0.12);
}
body[data-theme="saisons"][data-season="summer"] {
  --season-color: #ffd166;
  --season-color-rgb: 255, 209, 102;
  --season-accent: #06d6a0;
  --season-bg: rgba(255, 209, 102, 0.12);
}
body[data-theme="saisons"][data-season="autumn"] {
  --season-color: #f4a261;
  --season-color-rgb: 244, 162, 97;
  --season-accent: #e76f51;
  --season-bg: rgba(244, 162, 97, 0.12);
}
body[data-theme="saisons"][data-season="winter"] {
  --season-color: #a8d8ea;
  --season-color-rgb: 168, 216, 234;
  --season-accent: #ffffff;
  --season-bg: rgba(168, 216, 234, 0.12);
}

/* Saisons : surbrillances sur unités du calendrier */
body[data-theme="saisons"] .time-unit.active-today {
  border-color: var(--season-color, #ffd166);
  background: var(--season-bg, rgba(255,209,102,0.1));
  box-shadow: 0 0 20px rgba(var(--season-color-rgb, 255,209,102), 0.25);
}

body[data-theme="saisons"] .time-unit.selected {
  border-color: var(--season-accent, #fff);
  background: rgba(255,255,255,0.05);
}



/* Saisons : glassmorphism adapté (couleur chaude) */
body[data-theme="saisons"] .glass-panel {
  background: rgba(26, 16, 10, 0.6);
  border-color: rgba(255, 200, 130, 0.12);
}

body[data-theme="saisons"] header {
  background: rgba(26, 16, 10, 0.55);
  border-bottom-color: rgba(255, 200, 130, 0.12);
}

/* Saisons : badge de saison dans le header */
.season-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  animation: seasonBadgePulse 3s ease-in-out infinite;
}

@keyframes seasonBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,200,100,0);
  }
  50% { transform: scale(1.03); box-shadow: 0 0 12px 3px rgba(255,200,100,0.2); }
}

.season-badge.spring { background: rgba(168,230,163,0.15); color: #a8e6a3; border: 1px solid rgba(168,230,163,0.35); }
.season-badge.summer { background: rgba(255,209,102,0.15); color: #ffd166; border: 1px solid rgba(255,209,102,0.35); }
.season-badge.autumn { background: rgba(244,162,97,0.15);  color: #f4a261; border: 1px solid rgba(244,162,97,0.35);  }
.season-badge.winter { background: rgba(168,216,234,0.15); color: #a8d8ea; border: 1px solid rgba(168,216,234,0.35); }

/* 2. Overrides de fonds pour les thèmes enfants */
body[data-theme="safari"] {
  background-color: #0c2010;
  background-image: 
    radial-gradient(at 10% 20%, rgba(11, 40, 20, 0.9) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(245, 158, 11, 0.1) 0px, transparent 40%),
    radial-gradient(at 50% 80%, rgba(0, 245, 160, 0.08) 0px, transparent 50%);
}

body[data-theme="magicien"] {
  background-color: #120e2e;
  background-image: 
    radial-gradient(at 10% 20%, rgba(25, 18, 62, 0.95) 0px, transparent 50%),
    radial-gradient(at 90% 10%, rgba(139, 92, 246, 0.16) 0px, transparent 40%);
}



/* 4. Affichage du mois en clair sous le jour ("Mois en clair sous le jour") */
.day-month-sublabel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
  transition: var(--transition-smooth);
}

.time-unit:hover .day-month-sublabel {
  color: var(--text-secondary);
}

/* 5. Styles pour la Modal de Synchronisation Google GCal / Gmail */
.sync-modal-panel {
  width: 450px;
  background: rgba(18, 22, 38, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  padding: 40px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}

.sync-modal-panel.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.sync-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 5px;
}

.sync-gcal-logo {
  width: 58px;
  height: 58px;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(66, 133, 244, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sync-gcal-logo svg {
  width: 100%;
  height: 100%;
}

.sync-progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin: 10px 0;
}

.sync-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.sync-status-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.google-button {
  background: #4285f4;
  color: #fff;
  border: none;
  padding: 12px 24px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
  transition: var(--transition-bounce);
}

.google-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.45);
}

/* ==========================================================================
   CURSEUR DE TEMPS EN DIRECT
   ========================================================================== */

.time-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 40;
  pointer-events: none;
  width: 0;
}

/* Halo lumineux élargi autour de l'aiguille */
.time-cursor-glow {
  position: absolute;
  top: 0; bottom: 0;
  left: -24px; width: 48px;
  background: radial-gradient(ellipse 24px 50% at center,
    rgba(255, 107, 53, 0.12) 0%, transparent 100%);
}

/* Aiguille principale */
.time-cursor-needle {
  position: absolute;
  top: 0; bottom: 0;
  width: 4px;
  left: -2px;
  background: linear-gradient(180deg,
    rgba(255, 81, 47, 0)   0%,
    #ff512f                15%,
    #dd2476                50%,
    #ff512f                85%,
    rgba(255, 81, 47, 0) 100%
  );
  box-shadow:
    0 0 16px rgba(255, 81, 47, 0.95),
    0 0 36px rgba(255, 81, 47, 0.6),
    0 0 65px rgba(255, 81, 47, 0.3);
}

/* Badge heure flottant en bas de la frise - ULTRA VISIBLE (X2 Taille) */
.time-cursor-badge {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  padding: 8px 20px;
  border-radius: 30px;
  white-space: nowrap;
  box-shadow: 
    0 0 20px rgba(255, 81, 47, 0.75),
    0 6px 15px rgba(0, 0, 0, 0.35);
  letter-spacing: 1.2px;
  z-index: 50;
  border: 2px solid rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.time-cursor-badge::after {
  display: none;
}

/* Point pulsant au centre de la ligne de temps */
.time-cursor-dot {
  position: absolute;
  width: 16px; height: 16px;
  background: #ff6b35;
  border: 2.5px solid #fff;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 5px rgba(255, 107, 53, 0.25),
    0 4px 15px rgba(255, 107, 53, 0.6);
  animation: timeCursorPulse 1.8s ease-in-out infinite;
  z-index: 5;
}

@keyframes timeCursorPulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(255,107,53,0.25), 0 4px 15px rgba(255,107,53,0.5); }
  50%       { box-shadow: 0 0 0 14px rgba(255,107,53,0),  0 4px 22px rgba(255,107,53,0.75); }
}

/* Variante vue semaine : plus fin */
.time-cursor.week-cursor .time-cursor-needle {
  width: 2px; left: -1px;
  box-shadow: 0 0 6px rgba(255,107,53,0.7), 0 0 14px rgba(255,107,53,0.3);
}
.time-cursor.week-cursor .time-cursor-dot {
  width: 10px; height: 10px;
}
.time-cursor.week-cursor .time-cursor-badge {
  font-size: 15px;
  padding: 5px 14px;
  border-radius: 20px;
  bottom: 25px;
}

/* Barre de progression du jour (bas du track) */
.day-progress-bar {
  position: absolute;
  bottom: 2px; left: 0;
  height: 3px;
  background: linear-gradient(90deg,
    rgba(255, 107, 53, 0.75) 0%,
    rgba(255, 150, 90, 0.35) 100%
  );
  border-radius: 0 3px 3px 0;
  pointer-events: none;
  z-index: 3;
}

/* ==========================================================================
   ROUTINES ENFANT — Chips journalières
   ========================================================================== */

.child-routine-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 20;
  pointer-events: all;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.child-routine-chip * {
  pointer-events: none;
}


/* Cercle icône */
.child-routine-icon {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  position: relative;
  flex-shrink: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.child-routine-icon .emoji {
  font-size: 26px;
  line-height: 1;
  display: block;
}

/* Badge heure (visible au survol) */
.child-routine-time-badge {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px; font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.child-routine-chip:hover .child-routine-time-badge { opacity: 1; }

/* Label texte */
.child-routine-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.3s ease;
}

/* État : passé (is-done) */
.child-routine-chip.is-done {
  opacity: 0.25;
  filter: grayscale(75%);
}

/* État : maintenant (is-now) — glow pulsant */
.child-routine-chip.is-now .child-routine-icon {
  border-width: 3px;
  background: rgba(255, 255, 255, 0.09);
  animation: routineNowPulse 1.4s ease-in-out infinite alternate;
}

@keyframes routineNowPulse {
  from {
    transform: scale(1.2);
    box-shadow:
      0 0 0  8px rgba(255, 200, 50, 0.15),
      0 0 25px rgba(255, 200, 50, 0.30);
  }
  to {
    transform: scale(1.38);
    box-shadow:
      0 0 0 16px rgba(255, 200, 50, 0),
      0 0 45px rgba(255, 200, 50, 0.55);
  }
}

.child-routine-chip.is-now .child-routine-label {
  font-size: 11px;
  color: #ffd166;
  font-weight: 900;
}

/* Connecteur vertical entre l'icône et la ligne de temps */
.child-routine-connector {
  width: 1.5px;
  height: 45px;
  background: rgba(255, 255, 255, 0.13);
  flex-shrink: 0;
  align-self: center;
  border-radius: 2px;
}

/* Quand c'est l'heure : connecteur légèrement plus brillant */
.child-routine-chip.is-now .child-routine-connector {
  background: rgba(255, 209, 102, 0.35);
  box-shadow: 0 0 6px rgba(255, 209, 102, 0.25);
}

/* ==========================================================================
   CURSEUR THÉMATIQUE (icône flottante sur l'aiguille)
   ========================================================================== */

/* Icône générique (emoji positionné sur la ligne) */
.time-cursor-icon {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 65px;
  line-height: 1;
  z-index: 6;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.65));
  animation: cursorIconBob 2s ease-in-out infinite;
}

/* Conteneur d'inversion pour les icônes orientées à gauche (ex: Girafe, F1) afin de les faire pointer vers la droite (direction du temps) */
.time-cursor-flipped {
  display: inline-block;
  transform: scaleX(-1);
}

@keyframes cursorIconBob {
  0%, 100% { transform: translate(-50%, -50%)  scale(1);    }
  50%       { transform: translate(-50%, -68%)  scale(1.12); }
}

/* 🦒🧸 Thèmes enfants — ourson qui saute */
.time-cursor.child-cursor .time-cursor-icon {
  font-size: 70px;
  animation: cursorBear 2.2s ease-in-out infinite;
}

@keyframes cursorBear {
  0%   { transform: translate(-50%, -50%) scale(1)    rotate(-5deg); }
  50%  { transform: translate(-50%, -70%) scale(1.18) rotate( 5deg); }
  100% { transform: translate(-50%, -50%) scale(1)    rotate(-5deg); }
}

/* 🏎️ Thème F1 — voiture qui fonce */
.time-cursor.f1-cursor .time-cursor-icon {
  font-size: 72px;
  animation: cursorF1 1.4s ease-in-out infinite alternate;
}

@keyframes cursorF1 {
  from { transform: translate(-50%, -50%) scale(1)    rotate(-4deg) translateX(-3px); }
  to   { transform: translate(-50%, -62%) scale(1.12) rotate( 0deg) translateX( 3px); }
}

/* 🔮 Thème Magicien — boule magique qui tourne */
.time-cursor.time-cursor:not(.child-cursor):not(.f1-cursor):not(.week-cursor) .time-cursor-icon {
  animation: cursorIconBob 2s ease-in-out infinite;
}

/* Adaptation semaine : icône plus petite */
.time-cursor.week-cursor .time-cursor-icon {
  font-size: 42px;
  animation: cursorIconBob 2.5s ease-in-out infinite;
}

/* Le badge est maintenant centralisé ci-dessus */

/* La frise doit laisser ses enfants absolus (curseur, chips) déborder */
.timeline-track { overflow: visible; }

/* ==========================================================================
   PANNEAU CONFIGURATION — Drawer droit
   ========================================================================== */
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
.settings-overlay.open { opacity: 1; pointer-events: all; }

.settings-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 95vw);
  background: linear-gradient(160deg, #0d1021 0%, #111827 100%);
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 901;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.1, 0.64, 1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.6);
}
.settings-panel.open { transform: translateX(0); }

.settings-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
}
.settings-panel-title-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--text-primary);
}
.settings-close-btn {
  background: none; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 6px 8px;
  color: var(--text-secondary); cursor: pointer;
  display: flex; transition: all 0.2s ease;
}
.settings-close-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.settings-gear-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease; flex-shrink: 0;
}
.settings-gear-btn:hover {
  background: rgba(255,255,255,0.13); color: var(--text-primary);
  transform: rotate(35deg);
}

.settings-panel-body {
  flex: 1; overflow-y: auto;
  padding: 14px 18px 28px;
  display: flex; flex-direction: column; gap: 6px;
}
.settings-panel-body::-webkit-scrollbar { width: 4px; }
.settings-panel-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.cfg-section {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 14px; border-radius: 13px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  transition: background 0.2s ease;
}
.cfg-section:hover { background: rgba(255,255,255,0.04); }

.cfg-num { font-size: 19px; flex-shrink: 0; opacity: 0.65; margin-top: 1px; }

.cfg-content { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.cfg-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); display: block;
}

/* Radio */
.cfg-radio-group { display: flex; flex-direction: column; gap: 5px; }
.cfg-radio { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.cfg-radio input[type="radio"] { display: none; }
.cfg-radio-box { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0; transition: all 0.2s; }
.cfg-radio input:checked + .cfg-radio-box { background: var(--ideo-color); border-color: var(--ideo-color); box-shadow: 0 0 8px rgba(0,245,160,0.4); }

/* Grille thèmes */
.cfg-theme-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.cfg-theme-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; border-radius: 11px; padding: 6px;
  border: 2px solid transparent; background: rgba(255,255,255,0.03);
  transition: all 0.25s ease;
}
.cfg-theme-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); }
.cfg-theme-card.active { border-color: var(--ideo-color); box-shadow: 0 0 14px rgba(0,245,160,0.25); }
.cfg-theme-preview { width: 100%; height: 40px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.cfg-theme-card span { font-size: 9px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; }
.cfg-theme-card.active span { color: var(--ideo-color); }

/* Selects */
.cfg-select {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: var(--text-primary); font-size: 13px;
  padding: 8px 12px; width: 100%; outline: none; cursor: pointer;
  transition: border-color 0.2s;
}
.cfg-select:focus { border-color: var(--ideo-color); }
.cfg-select option { background: #111827; }

.cfg-select-sm {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: var(--text-primary); font-size: 12px;
  padding: 6px 10px; outline: none; cursor: pointer;
}
.cfg-select-sm option { background: #111827; }

/* Ligne d'échelle */
.cfg-scale-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfg-scale-label { font-size: 12px; color: var(--text-secondary); }
.cfg-scale-unit  { font-size: 12px; color: var(--text-muted); }

.cfg-num-input {
  width: 50px; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  color: var(--text-primary); font-size: 14px; font-weight: 700;
  padding: 6px 8px; text-align: center; outline: none;
}
.cfg-num-input:focus { border-color: var(--ideo-color); }
.cfg-num-input::-webkit-inner-spin-button { opacity: 0.4; }

/* Bouton action */
.cfg-action-btn {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: var(--text-secondary); font-size: 13px;
  padding: 9px 14px; cursor: pointer; transition: all 0.2s; width: fit-content;
}
.cfg-action-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* Bouton Appliquer */
.cfg-apply-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #00f5a0, #00d8f6);
  color: #000; font-size: 14px; font-weight: 800;
  padding: 14px 24px; border: none; border-radius: 13px;
  cursor: pointer; margin-top: 8px; letter-spacing: 0.4px;
  transition: all 0.25s ease; box-shadow: 0 6px 22px rgba(0,245,160,0.3);
}
.cfg-apply-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(0,245,160,0.45); }

/* ==========================================================================
   ICÔNES ENFANT dans le formulaire d'événement
   ========================================================================== */
.icon-selector-grid:has(.child-icon-option) {
  grid-template-columns: repeat(5, 1fr) !important;
}
.child-icon-box {
  display: flex !important; flex-direction: column !important;
  align-items: center !important; justify-content: center !important;
  gap: 3px !important; height: 64px !important; padding: 6px 4px !important;
}
.child-icon-emoji { font-size: 26px; line-height: 1; display: block; }
.child-icon-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); white-space: nowrap; }
.child-icon-option input:checked + .child-icon-box {
  background: rgba(0,245,160,0.12) !important;
  border-color: var(--ideo-color) !important;
  box-shadow: 0 0 12px rgba(0,245,160,0.25) !important;
}
.child-icon-option input:checked + .child-icon-box .child-icon-label { color: var(--ideo-color); }

/* ==========================================================================
   FONDS THÉMATIQUES — body background fills the full viewport
   ========================================================================== */

/* Assurer que le body remplit toujours tout l'écran */
body {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
}

/* ── Thèmes enfant : fonds lumineux et illustrés ── */
body[data-theme="safari"] {
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(194,157,20,0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(34,120,30,0.4) 0%, transparent 50%),
    linear-gradient(160deg, #0c1f0e 0%, #1a3a18 25%, #2d5a28 50%, #6b8c1a 75%, #c4a030 100%);
}

body[data-theme="nounours"] {
  background-image:
    radial-gradient(ellipse at 30% 70%, rgba(180,100,40,0.4) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 25%, rgba(210,160,80,0.3) 0%, transparent 50%),
    linear-gradient(155deg, #1a0f08 0%, #3a1f0e 35%, #5a3018 65%, #8b5525 100%);
}

body[data-theme="magicien"] {
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(139,92,246,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 20%, rgba(99,102,241,0.25) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(168,85,247,0.2) 0%, transparent 40%),
    linear-gradient(135deg, #120e2e 0%, #1e1248 40%, #2a1a5a 70%, #1a0a3a 100%);
}

body[data-theme="saisons"] {
  background-image:
    radial-gradient(ellipse at 30% 40%, rgba(168,230,163,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 70%, rgba(244,162,97,0.3) 0%, transparent 50%),
    linear-gradient(145deg, #0e150b 0%, #1c2e14 30%, #3a5228 55%, #7a6018 80%, #4a1a0a 100%);
}

/* ── Thèmes adulte : fonds sombres et premium ── */
body[data-theme="cyber"] {
  background-image:
    radial-gradient(ellipse at 0% 100%, rgba(0,245,160,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(0,114,255,0.1) 0%, transparent 50%),
    linear-gradient(135deg, #07080f 0%, #0a0e1a 50%, #0d1022 100%);
}

body[data-theme="f1"] {
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(255,51,0,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(200,0,0,0.08) 0%, transparent 50%),
    linear-gradient(135deg, #100505 0%, #1a0808 50%, #0f0303 100%);
}

body[data-theme="foot"] {
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(0,47,190,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(239,68,68,0.1) 0%, transparent 50%),
    linear-gradient(135deg, #050a1b 0%, #0a112c 50%, #030612 100%);
}

/* ── Fonds personnalisés (picker) ── */
body[data-bg="space"] {
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(100,50,200,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 90%, rgba(0,100,255,0.12) 0%, transparent 50%),
    linear-gradient(160deg, #02010a 0%, #06040f 40%, #0a0620 100%);
}

body[data-bg="forest"] {
  background-image:
    radial-gradient(ellipse at 30% 60%, rgba(20,100,20,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(50,120,20,0.2) 0%, transparent 50%),
    linear-gradient(160deg, #020a02 0%, #071507 40%, #0e2610 100%);
}

body[data-bg="ocean"] {
  background-image:
    radial-gradient(ellipse at 40% 60%, rgba(0,100,200,0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(0,200,255,0.15) 0%, transparent 50%),
    linear-gradient(160deg, #010810 0%, #031525 40%, #062040 100%);
}

body[data-bg="sunset"] {
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255,200,50,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(255,80,20,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(200,0,100,0.15) 0%, transparent 50%),
    linear-gradient(160deg, #100505 0%, #1a0c05 40%, #0a0510 100%);
}

body[data-bg="candy"] {
  background-image:
    radial-gradient(ellipse at 30% 30%, rgba(255,100,200,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 70%, rgba(100,200,255,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255,200,50,0.15) 0%, transparent 50%),
    linear-gradient(160deg, #120815 0%, #0e0a20 50%, #050f1a 100%);
}

/* ==========================================================================
   MODE CLAIR — body[data-mode="light"]
   ========================================================================== */

body[data-mode="light"] {
  --bg-space: #e8edf5;
  --bg-space-light: #f0f4fb;
  --bg-glass: rgba(255, 255, 255, 0.80);
  --bg-glass-hover: rgba(255, 255, 255, 0.95);
  --border-glass: rgba(0, 0, 0, 0.09);
  --border-glass-glow: rgba(0, 0, 0, 0.14);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  /* Couleurs de marque rehaussées pour le mode clair (contraste optimal) */
  --ideo-color: #059669;
  --ideo-gradient: linear-gradient(135deg, #059669, #0d9488);
  --ideo-glow: 0 0 10px rgba(5, 150, 105, 0.2);

  --iclick-color: #1d4ed8;
  --iclick-gradient: linear-gradient(135deg, #1d4ed8, #2563eb);
  --iclick-glow: 0 0 10px rgba(29, 78, 216, 0.2);

  --iclock-color: #e11d48;
  --iclock-gradient: linear-gradient(135deg, #e11d48, #ea580c);
  --iclock-glow: 0 0 10px rgba(225, 29, 72, 0.2);

  --foot-color: #1d4ed8;
  --foot-gradient: linear-gradient(135deg, #002fbe, #1d4ed8, #ef4444);
  --foot-glow: 0 0 10px rgba(29, 78, 216, 0.2);

  background-image: linear-gradient(160deg, #dde7f5 0%, #eef2fb 50%, #f5f7ff 100%) !important;
}

/* En-tête */
body[data-mode="light"] header {
  background: rgba(255,255,255,0.88);
  border-bottom-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* Panneaux latéraux */
body[data-mode="light"] .events-panel,
body[data-mode="light"] .agenda-modal-panel {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.08);
}

/* Cellules de la frise */
body[data-mode="light"] .time-unit {
  background: rgba(255,255,255,0.75);
  border-color: rgba(0,0,0,0.07);
}
body[data-mode="light"] .time-unit:hover {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.12);
}
body[data-mode="light"] .time-unit.active-today {
  background: rgba(0,114,255,0.08);
  border-color: rgba(0,114,255,0.25);
}

/* Ligne centrale */
body[data-mode="light"] .timeline-line {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,0,0,0.15) 10%,
    rgba(0,0,0,0.15) 90%,
    transparent 100%
  );
}

/* Labels */
body[data-mode="light"] .time-label-bottom { color: #0f172a; }
body[data-mode="light"] .time-label-top    { color: #475569; }

/* Gamepad */
body[data-mode="light"] .gamepad-container {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.08);
}
body[data-mode="light"] .gamepad-body {
  background: radial-gradient(circle at 35% 35%, rgba(240, 244, 251, 0.95) 0%, rgba(200, 210, 230, 0.95) 100%);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 15px 35px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.8),
    inset 0 -2px 4px rgba(0,0,0,0.05);
}
body[data-mode="light"] .gamepad-btn {
  color: #334155;
}
body[data-mode="light"] .gamepad-btn:hover {
  color: #0f172a;
  text-shadow: 0 0 8px rgba(15, 23, 42, 0.25);
}

/* Bannière météo */
body[data-mode="light"] .weather-panel {
  background: rgba(255,255,255,0.8);
}

/* Panneau settings lui-même */
body[data-mode="light"] .settings-panel {
  background: linear-gradient(160deg, #f0f4fb 0%, #ffffff 100%);
  border-left-color: rgba(0,0,0,0.08);
}
body[data-mode="light"] .cfg-section { background: rgba(0,0,0,0.025); border-color: rgba(0,0,0,0.06); }
body[data-mode="light"] .cfg-section:hover { background: rgba(0,0,0,0.04); }
body[data-mode="light"] .cfg-label { color: #64748b; }
body[data-mode="light"] .cfg-select,
body[data-mode="light"] .cfg-select-sm,
body[data-mode="light"] .cfg-num-input {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
  color: #0f172a;
}
body[data-mode="light"] .cfg-select option { background: #ffffff; color: #0f172a; }
body[data-mode="light"] .cfg-action-btn { background: rgba(0,0,0,0.05); color: #334155; border-color: rgba(0,0,0,0.1); }
body[data-mode="light"] .cfg-theme-card { background: rgba(0,0,0,0.04); }
body[data-mode="light"] .cfg-theme-card:hover { background: rgba(0,0,0,0.07); }
body[data-mode="light"] .cfg-radio { color: #334155; }
body[data-mode="light"] .settings-panel-header { background: rgba(0,0,0,0.03); border-bottom-color: rgba(0,0,0,0.07); }
body[data-mode="light"] .settings-close-btn { color: #334155; border-color: rgba(0,0,0,0.1); }

/* ==========================================================================
   SWITCHER MODE & PICKER FOND (Settings panel)
   ========================================================================== */

.cfg-mode-switcher {
  display: flex;
  gap: 8px;
}
.cfg-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.cfg-mode-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.cfg-mode-btn.active {
  background: rgba(0,245,160,0.15);
  border-color: var(--ideo-color);
  color: var(--ideo-color);
  box-shadow: 0 0 12px rgba(0,245,160,0.2);
}

body[data-mode="light"] .cfg-mode-btn { border-color: rgba(0,0,0,0.08); background: rgba(0,0,0,0.04); color: #334155; }
body[data-mode="light"] .cfg-mode-btn.active { background: rgba(0,114,255,0.1); border-color: #0072ff; color: #0072ff; }

/* Picker fond */
.cfg-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.cfg-bg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 22px;
}
.cfg-bg-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); }
.cfg-bg-btn.active { border-color: var(--ideo-color); box-shadow: 0 0 10px rgba(0,245,160,0.2); background: rgba(0,245,160,0.08); }
.cfg-bg-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.cfg-bg-btn.active .cfg-bg-lbl { color: var(--ideo-color); }

body[data-mode="light"] .cfg-bg-btn { background: rgba(0,0,0,0.04); }
body[data-mode="light"] .cfg-bg-btn:hover { background: rgba(0,0,0,0.07); }
body[data-mode="light"] .cfg-bg-btn.active { border-color: #0072ff; background: rgba(0,114,255,0.08); }
body[data-mode="light"] .cfg-bg-btn.active .cfg-bg-lbl { color: #0072ff; }

/* ==========================================================================
   CORRECTIONS DE POSITION SEMAINE & ALARME ENFANT
   ========================================================================== */

/* Surélévation des puces événement dans la vue semaine pour ne pas chevaucher les étiquettes */
.timeline-view[data-view="week"] .floating-event-chip.pos-above {
  transform: translateY(-130px);
}

.timeline-view[data-view="week"] .floating-event-chip.pos-above:hover {
  transform: translateY(-130px) scale(1.25) rotate(8deg);
}

.timeline-view[data-view="week"] .floating-event-chip.f1-gp-chip.pos-above:hover {
  transform: translateY(-130px) scale(1.3) rotate(5deg) !important;
}

.timeline-view[data-view="week"] .floating-event-chip.wc-match-chip.pos-above:hover {
  transform: translateY(-130px) scale(1.3) rotate(-5deg) !important;
}

/* Overlay plein écran pour les alarmes des enfants */
.child-alarm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.child-alarm-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.child-alarm-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 32px;
  padding: 45px 50px;
  text-align: center;
  max-width: 480px;
  width: 90%;
  box-shadow: 
    0 15px 45px rgba(0, 0, 0, 0.65),
    0 0 35px rgba(255, 165, 0, 0.18);
  transform: scale(0.75) translateY(40px);
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.child-alarm-overlay.active .child-alarm-card {
  transform: scale(1) translateY(0);
}

.child-alarm-emoji-wrapper {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  margin: 0 auto 30px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 65px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.18);
  animation: alarmEmojiPulse 1.8s infinite ease-in-out;
}

@keyframes alarmEmojiPulse {
  0%, 100% { transform: scale(1) rotate(-6deg); }
  50% { transform: scale(1.16) rotate(6deg); box-shadow: 0 0 45px rgba(255, 255, 255, 0.32); }
}

.child-alarm-title {
  color: #ffffff;
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 12px 0;
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.child-alarm-time {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 32px 0;
}

.child-alarm-btn {
  background: linear-gradient(135deg, #ff9f43 0%, #ff5252 100%);
  color: #ffffff;
  border: none;
  font-size: 19px;
  font-weight: 800;
  padding: 13px 45px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 82, 82, 0.45);
  transition: all 0.3s ease;
  outline: none;
}

.child-alarm-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 82, 82, 0.65);
}

.child-alarm-btn:active {
  transform: scale(0.98) translateY(0);
}
/* ==========================================================================
   AJUSTEMENTS DU MODE CLAIR (COMPOSANTS RESTANTS)
   ========================================================================== */

/* Popover d'événements en mode clair */
body[data-mode="light"] .event-popover {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Toast en mode clair */
body[data-mode="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(5, 150, 105, 0.25);
  color: #0f172a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

body[data-mode="light"] .popover-title {
  color: #0f172a;
}

body[data-mode="light"] .popover-time {
  color: #475569;
}

body[data-mode="light"] .popover-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #334155;
}

body[data-mode="light"] .popover-btn:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #0f172a;
}

body[data-mode="light"] .popover-btn-edit {
  border-color: rgba(29, 78, 216, 0.3);
  color: #1d4ed8;
}

body[data-mode="light"] .popover-btn-edit:hover {
  background: rgba(29, 78, 216, 0.08);
}

body[data-mode="light"] .popover-routine-tag {
  color: #64748b;
}

/* Modals en mode clair */
body[data-mode="light"] .sync-modal-panel {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

body[data-mode="light"] .modal-title {
  background: linear-gradient(to right, #0f172a, #475569) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

body[data-mode="light"] .modal-close-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #334155;
}

body[data-mode="light"] .modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

/* Formulaires et Boutons de Modale en mode clair */
body[data-mode="light"] .form-input {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

body[data-mode="light"] .form-input:focus {
  background: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 0 12px rgba(29, 78, 216, 0.12);
}

body[data-mode="light"] .form-input::placeholder {
  color: #94a3b8;
}

body[data-mode="light"] .form-category-card {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  color: #475569;
}

body[data-mode="light"] .icon-selector-grid {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

body[data-mode="light"] .form-icon-box {
  color: #475569;
}

body[data-mode="light"] .form-icon-option input:checked + .form-icon-box {
  background: rgba(0, 0, 0, 0.06);
  border-color: #0f172a;
  color: #0f172a;
}

body[data-mode="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: #334155;
}

body[data-mode="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

body[data-mode="light"] .btn-delete {
  background: rgba(225, 29, 72, 0.06);
  border-color: rgba(225, 29, 72, 0.16);
  color: #e11d48;
}

body[data-mode="light"] .btn-delete:hover {
  background: rgba(225, 29, 72, 0.15);
  color: #be123c;
}

/* Éléments de la frise et lignes de connexion en mode clair */
body[data-mode="light"] .event-connect-line {
  background: linear-gradient(180deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0.02) 100%);
}

body[data-mode="light"] .floating-event-chip:hover + .event-connect-line {
  background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.05) 100%);
}

body[data-mode="light"] .child-routine-connector {
  background: rgba(0, 0, 0, 0.12);
}

/* En-tête et conteneurs en mode clair */
body[data-mode="light"] .active-calendars {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.08);
}

body[data-mode="light"] .premium-toggle-wrapper {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Rendre le select global option en mode clair propre */
body[data-mode="light"] option,
body[data-mode="light"] select option {
  background: #ffffff !important;
  color: #0f172a !important;
}


/* ==========================================================================
   BANDEAU D'INFORMATION DÉFILANT (JT Info TV - Adulte uniquement)
   ========================================================================== */
.adult-ticker-banner {
  height: 57px;
  background: rgba(18, 22, 38, 0.55);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  z-index: 100;
  margin-bottom: -5px; /* Compacifie l'espace vertical */
}

body[data-mode="light"] .adult-ticker-banner {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.08);
}

.ticker-label {
  background: linear-gradient(95deg, #ff3b30, #e60023);
  color: #ffffff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 1.5px;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.25);
  text-transform: uppercase;
  flex-shrink: 0;
}

.ticker-label::before {
  content: '';
  width: 11px;
  height: 11px;
  background-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  animation: tickerDotBlink 1s infinite alternate;
}

@keyframes tickerDotBlink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.ticker-content-wrapper {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}

.ticker-content {
  display: inline-block;
  white-space: nowrap;
  padding-left: 24px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.4px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, color 0.2s ease;
  opacity: 1;
  transform: translateY(0);
  cursor: pointer;
}

.ticker-content:hover {
  color: #ff3b30;
  text-decoration: underline;
}

.ticker-content.exit {
  transform: translateY(-15px);
  opacity: 0;
}

.ticker-content.enter-prep {
  transition: none !important;
  transform: translateY(15px);
  opacity: 0;
}

/* Rappel de la date en mode journée (centré sous le flash info) */
.day-date-reminder {
  display: none;
  align-self: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  padding: 8px 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  margin-top: -5px;
  margin-bottom: -5px;
  z-index: 90;
}

.day-date-reminder.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dayDateFadeInDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body[data-mode="light"] .day-date-reminder {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

@keyframes dayDateFadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ajustement de la zone de défilement de la semaine pour s'arrêter avant la manette */
#wrapperWeek {
  padding-right: 220px;
}

@media (max-width: 1024px) {
  #wrapperWeek {
    padding-right: 140px;
  }
}

/* ==========================================================================
   SELECTEUR DE LANGUE (FR / EN)
   ========================================================================== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 6px;
  border-radius: 20px;
  margin-left: 14px;
}

body[data-mode="light"] .lang-switcher {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

.lang-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--ideo-gradient);
  color: #ffffff !important;
  box-shadow: var(--ideo-glow);
}

.lang-separator {
  color: rgba(255, 255, 255, 0.15);
  font-size: 10px;
  user-select: none;
}

body[data-mode="light"] .lang-separator {
  color: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   SUPPORT RESPONSIVE (IPAD & IPHONE)
   ========================================================================== */

/* 1. Écrans Tablettes et Mobiles (max-width: 768px) */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  main {
    height: auto;
    overflow-y: visible;
    padding: 10px;
    gap: 15px;
  }

  header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    align-items: stretch;
  }

  .logo-container {
    justify-content: space-between;
    width: 100%;
  }

  .header-actions {
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }

  .active-calendars {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px;
    border-radius: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .active-calendars::-webkit-scrollbar {
    display: none;
  }

  .layer-btn {
    padding: 8px 12px;
    font-size: 13px;
    flex: 1 0 auto;
    justify-content: center;
  }

  .view-viewport {
    height: 540px; /* Hauteur fixe pour éviter l'effondrement de la frise */
    flex: none;
  }

  /* Repositionnement et réduction de la manette */
  .gamepad-container {
    right: 15px;
    bottom: 15px;
    top: auto;
    transform: none;
    width: 90px;
    height: 90px;
  }
  .gamepad-body {
    width: 80px;
    height: 80px;
    padding: 3px;
  }
  .gamepad-btn svg {
    width: 14px;
    height: 14px;
  }
  .gamepad-container .nav-badge-label {
    display: none !important;
  }

  /* Alignement vertical et empilement des widgets du bas */
  .dashboard-bottom-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: auto;
    margin-top: 15px;
  }

  .events-panel, .weather-panel, .banner-widget {
    height: 300px;
    flex: none;
  }

  /* Ajustements pour les popups */
  .agenda-modal-panel {
    z-index: 1100;
  }
}

/* 2. Écrans Mobiles Fins / iPhone (max-width: 480px) */
@media (max-width: 480px) {
  .logo-text {
    font-size: 19px;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
  }

  .premium-toggle-label {
    font-size: 11px;
  }

  .day-date-reminder {
    font-size: 14px;
    padding: 6px 14px;
    margin-top: 0px;
  }

  .adult-ticker-banner {
    height: 48px;
  }
  .ticker-label {
    font-size: 11px;
    padding: 0 10px;
  }
  .ticker-content {
    font-size: 11px;
  }

  /* Modal de création d'événements plein écran */
  .agenda-modal-panel {
    width: 100%;
    right: -100%;
    padding: 24px 20px;
    border-left: none;
  }
  
  .sync-modal-panel {
    width: 92%;
    padding: 20px;
  }
  
  .sync-modal-panel p {
    font-size: 13px;
  }

  .timeline-wrapper {
    padding: 0 15px;
  }
}



/* =====================================================================
   v5 — Modernisation : mise en page plus stable, tablette murale,
   accessibilité, agendas connectés
   ===================================================================== */

/* Le panneau de réglages fermé ne projette plus d'ombre sur le bord droit */
.settings-panel { box-shadow: none; visibility: hidden; transition: transform 0.4s cubic-bezier(0.34, 1.1, 0.64, 1), visibility 0s linear 0.4s; }
.settings-panel.open { box-shadow: -20px 0 60px rgba(0,0,0,0.45); visibility: visible; transition: transform 0.4s cubic-bezier(0.34, 1.1, 0.64, 1); }

/* En-tête : plus compact, ne déborde plus, les libellés ne se coupent plus */
header {
  padding: 12px 22px;
  gap: 14px;
  flex-wrap: nowrap;
  padding-top: max(12px, env(safe-area-inset-top));
}
.header-actions { gap: 12px; flex-wrap: nowrap; justify-content: flex-end; }
@media (max-width: 1100px) { .header-actions { flex-wrap: wrap; } }
.active-calendars { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.active-calendars::-webkit-scrollbar { display: none; }
.layer-btn { white-space: nowrap; padding: 8px 14px; font-size: 13px; }
.logo-text { white-space: nowrap; }
#googleSyncBtn { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.agenda-count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: rgba(255,255,255,0.9); color: #1e6fe8; font-size: 11px; font-weight: 800;
}

/* Le contenu s'adapte à la hauteur réelle de l'en-tête (qui peut passer sur 2 lignes) */
main { height: auto; min-height: 0; }

@media (max-width: 1280px) {
  .premium-toggle-label { display: none; }
  .header-actions { gap: 8px; }
}
@media (max-width: 1100px) {
  header { flex-wrap: wrap; }
  .logo-text { display: none; }
  .lang-switcher { transform: scale(0.92); }
}

/* Curseur de l'heure : le badge n'est plus caché par les widgets du bas */
.time-cursor-badge { bottom: 44px; font-size: 18px; padding: 6px 16px; }

/* Manette : libellés lisibles, qui ne chevauchent plus les cartes */
.nav-badge-label {
  background: var(--bg-glass, rgba(255,255,255,0.85));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass, rgba(0,0,0,0.08));
  border-radius: 999px; padding: 2px 8px; white-space: nowrap; pointer-events: none;
}
.gamepad-container .nav-badge-left { left: auto; right: calc(100% - 6px); }
.gamepad-container .nav-badge-right { right: auto; left: calc(100% - 6px); }
.gamepad-container { right: 70px; }

/* Notifications : en haut au centre, sans masquer les panneaux */
.toast-container { top: 18px; bottom: auto; left: 50%; transform: translateX(-50%); align-items: center; pointer-events: none; }
.toast { pointer-events: auto; }

/* Accessibilité : contour visible au clavier, animations réduites si demandé */
:focus-visible { outline: 3px solid #1e6fe8; outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Écran tactile (tablette murale) : cibles plus grandes */
@media (pointer: coarse) {
  .layer-btn { padding: 11px 16px; }
  .gamepad-btn { min-width: 44px; min-height: 44px; }
  .popover-btn, .btn-primary, .btn-secondary { min-height: 44px; }
}

/* Appli installée (plein écran) : respect des bords arrondis / encoche */
@media (display-mode: standalone) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  main { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* ---------- Fenêtre « Mes agendas » ---------- */
.sync-modal-panel.agenda-sync-panel {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto;
  align-items: stretch; text-align: left; gap: 10px;
}
.agenda-sync-head { display: flex; align-items: center; justify-content: space-between; }
.agenda-x { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-secondary); padding: 6px; }
.agenda-intro, .agenda-help, .agenda-status { font-size: 13px; color: var(--text-secondary); line-height: 1.45; margin: 0; }
.agenda-help details summary { cursor: pointer; font-weight: 600; }
.agenda-help details p { margin: 6px 0 0; }
.agenda-status:empty { display: none; }
.agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.agenda-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-glass, rgba(0,0,0,0.08));
  background: rgba(127,127,127,0.06);
}
.agenda-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.agenda-meta { grid-column: 1 / -1; font-size: 12px; color: var(--text-secondary); }
.ag-layer, .ag-new-layer { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.ag-remove { background: none; border: none; cursor: pointer; font-size: 16px; }
.agenda-empty { font-size: 13px; color: var(--text-secondary); padding: 8px 0; }
.agenda-add { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-glass, rgba(0,0,0,0.08)); padding-top: 12px; }
.agenda-add-row { display: flex; gap: 8px; }
.agenda-add-row select { flex: 1; }
.agenda-primary {
  border: none; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #1e6fe8, #00b38f);
}
.agenda-primary:disabled { opacity: 0.5; cursor: default; }
.agenda-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.agenda-file { font-size: 13px; font-weight: 600; cursor: pointer; color: #1e6fe8; }
/* Formulaire d'événement fermé : plus d'ombre visible sur le bord droit */
.agenda-modal-panel:not(.active) { box-shadow: none; visibility: hidden; transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.5s; }
.agenda-modal-panel.active { visibility: visible; }
.premium-toggle-label { white-space: nowrap; }
/* Logo lisible en mode clair (le début du mot disparaissait sur fond blanc) */
body[data-mode="light"] .logo-text { background: linear-gradient(to right, #1e293b, #475569); -webkit-background-clip: text; background-clip: text; }
