/* indispos.css - Styles specifiques a la page indisponibilites */

body { max-width: 1200px; }

/* === Saisie banner === */
.saisie-banner {
  background: #d4efdf;
  border: 1px solid #27ae60;
  color: #1e7e34;
  padding: 8px 16px;
  border-radius: 8px;
  text-align: center;
  margin: 8px auto;
  max-width: 600px;
  font-size: 0.9em;
}

/* === Confirm section === */
.confirm-section {
  text-align: center;
  margin: 8px auto;
}
.confirm-section button {
  padding: 8px 20px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
}
.confirm-section span { margin-left: 10px; color: #27ae60; font-size: 0.85em; }

/* === Welcome / Instructions (collapsible) === */
.welcome {
  background: #ebf4ff;
  border: 1px solid #bee3f8;
  border-left: 4px solid #2d5fa1;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 0.95em;
  color: #2a4365;
  line-height: 1.6;
}
.welcome summary {
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  color: #1a365d;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.welcome summary::-webkit-details-marker { display: none; }
.welcome summary::before {
  content: ">";
  display: inline-block;
  font-size: 0.8em;
  transition: transform 0.2s;
  font-weight: 700;
  color: #2d5fa1;
}
.welcome[open] summary::before {
  transform: rotate(90deg);
}
.welcome .welcome-content {
  padding: 0 18px 14px 18px;
}
.welcome ol {
  margin: 4px 0 0 20px;
  padding: 0;
}
.welcome ol li {
  margin-bottom: 4px;
}
.welcome .welcome-tip {
  margin-top: 6px;
  font-size: 0.9em;
  color: #4a5568;
}

/* === Planning link === */
.planning-link {
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.planning-link .btn-changelog {
  position: relative;
  font-size: 0.9em;
}
.planning-link a {
  color: #2d5fa1;
  text-decoration: none;
  font-weight: 600;
  font-size: 1em;
  padding: 10px 18px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: inline-block;
  border: 1px solid #e2e8f0;
  transition: background 0.15s;
}
.planning-link a:hover { background: #ebf4ff; }
.planning-link a:focus {
  outline: 3px solid #63b3ed;
  outline-offset: 2px;
}

/* === Toolbar (elu selector) === */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  padding: 14px 18px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 2px solid #2d5fa1;
}
.toolbar label {
  font-weight: 700;
  font-size: 1.1em;
  color: #1a365d;
}
.toolbar select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 2px solid #2d5fa1;
  font-size: 1.1em;
  font-weight: 600;
  background: #f7fafc;
  color: #1a365d;
  cursor: pointer;
  min-width: 200px;
}
.toolbar select:focus {
  outline: 3px solid #63b3ed;
  outline-offset: 2px;
}
.btn-clear {
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid #c53030;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  background: white;
  color: #c53030;
  transition: background 0.15s, color 0.15s;
}
.btn-clear:hover { background: #c53030; color: white; }
.btn-clear:focus {
  outline: 3px solid #fc8181;
  outline-offset: 2px;
}
.btn-clear.hidden { display: none; }

/* === Active elu banner === */
.active-elu-banner {
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.05em;
  color: white;
  letter-spacing: 0.3px;
}

/* === Save status === */
.status {
  text-align: center;
  font-size: 0.95em;
  margin-bottom: 12px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
}
.status-indicator.saved {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}
.status-indicator.saving {
  background: #fffff0;
  color: #975a16;
  border: 1px solid #fbd38d;
}
.status-indicator.error {
  background: #fff5f5;
  color: #c53030;
  border: 2px solid #fc8181;
  font-weight: 700;
  padding: 8px 20px;
}
.status-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-indicator.saved .status-icon { background: #38a169; }
.status-indicator.saving .status-icon { background: #d69e2e; animation: pulse 1s infinite; }
.status-indicator.error .status-icon { background: #e53e3e; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === Legend === */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95em;
  padding: 6px 12px;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  font-weight: 500;
  min-height: 36px;
}
.legend-item:hover {
  background: #edf2f7;
}
.legend-item:focus {
  outline: 3px solid #63b3ed;
  outline-offset: 2px;
}
.legend-item.active {
  border-color: #1a365d;
  background: #ebf8ff;
  font-weight: 700;
  box-shadow: 0 0 0 1px #1a365d;
}
.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.2);
}
.legend-count {
  font-size: 0.85em;
  color: #718096;
  font-weight: 400;
}

/* Sticky legend in "Tous" mode for persistent color reference */
.legend.sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f0f2f5;
  padding: 10px 0;
  margin-left: -4px;
  margin-right: -4px;
  padding-left: 4px;
  padding-right: 4px;
  border-bottom: 1px solid #e2e8f0;
}

/* === Calendar type legend === */
.vacances-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 0.9em;
  color: #4a5568;
}
.vacances-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.vac-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* === Hint === */
.hint {
  text-align: center;
  color: #718096;
  font-size: 0.9em;
  margin-bottom: 14px;
  font-style: italic;
}

/* === Calendar grid === */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.month {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.month-header {
  background: #2d5fa1;
  color: white;
  padding: 10px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1em;
  letter-spacing: 0.3px;
}
.month-grid {
  display: grid;
  grid-template-columns: 28px repeat(7, 1fr);
  gap: 2px;
  padding: 6px;
}

/* === Week marker === */
.week-header {
  /* Empty top-left corner above week markers */
}
.week-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68em;
  font-weight: 700;
  color: #94a3b8;
  cursor: default;
  border-radius: 4px;
  user-select: none;
  transition: all 0.15s;
}
/* Show as clickable only in edit mode */
body.edit-active .week-marker {
  cursor: pointer;
  color: #2d5fa1;
  background: #f0f4ff;
}
body.edit-active .week-marker:hover {
  background: #2d5fa1;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 1px 4px rgba(45,95,161,0.3);
}
.day-header {
  text-align: center;
  font-size: 0.85em;
  font-weight: 700;
  color: #4a5568;
  padding: 6px 0;
}
.day {
  text-align: center;
  padding: 6px 3px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.95em;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, border 150ms ease, color 150ms ease, transform 0.1s;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-weight: 500;
}
.day:hover:not(.empty):not(.outside) {
  transform: scale(1.1);
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.day:focus-visible {
  outline: 3px solid #63b3ed;
  outline-offset: 1px;
  z-index: 2;
}
.day.empty { cursor: default; }
.day.empty:hover { transform: none; box-shadow: none; }
.day.outside { color: #a0aec0; cursor: default; }
.day.outside:hover { transform: none; box-shadow: none; }
.day.weekend { color: #718096; }
.day.vacances { background: #c6f6d5; border: 1px solid #9ae6b4; }
.day.ferie { background: #fefcbf; font-weight: 700; border: 1px solid #f6e05e; }
.day.pm-absente { background: #fed7aa; border: 1px solid #f6ad55; }
.day.selected { color: white; font-weight: 700; border: none; }
.day.maybe {
  font-weight: 600;
  border: 2px dashed currentColor;
  position: relative;
}
.day.maybe::before {
  content: '?';
  position: absolute;
  top: 0px;
  right: 2px;
  font-size: 0.6em;
  font-weight: 800;
  line-height: 1;
  opacity: 0.7;
}
.day.has-others::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a5568;
  border: 1px solid white;
}
.day.selected.has-others::after {
  background: rgba(255,255,255,0.8);
  border-color: transparent;
}
.day.imported::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2980b9;
}

/* === Multi-elu day in "Tous" view === */
.day .elu-count-badge {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.65em;
  font-weight: 700;
  color: white;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* === Summary === */
.summary {
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 16px;
  border: 1px solid #e2e8f0;
}
.summary h2 {
  margin-bottom: 12px;
  font-size: 1.15em;
  color: #1a365d;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95em;
}

/* === Skip link === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: #1a365d;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  z-index: 200;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
}

/* === Edit toggle button in banner === */
.lock-toggle {
  cursor: pointer;
  font-size: 0.8em;
  margin-left: 12px;
  vertical-align: middle;
  padding: 6px 16px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.15);
  color: white;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: background 0.15s, border-color 0.15s;
}
.lock-toggle:hover {
  background: rgba(255,255,255,0.3);
  border-color: white;
}
.lock-toggle.editing {
  background: rgba(255,255,255,0.9);
  color: #c53030;
  border-color: rgba(255,255,255,0.9);
}
.lock-toggle.editing:hover {
  background: white;
}
.active-elu-banner.editing {
  border: 2px dashed rgba(255,255,255,0.5);
  animation: editing-pulse 2s ease-in-out infinite;
}
@keyframes editing-pulse {
  0%, 100% { border-color: rgba(255,255,255,0.3); }
  50% { border-color: rgba(255,255,255,0.7); }
}

/* === ICS calendar config === */
.ical-config {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px auto;
  max-width: 600px;
}
.ical-config h3 { margin: 0 0 8px 0; font-size: 1em; }
.ical-hint { font-size: 0.85em; color: #555; margin: 0 0 10px 0; }
.ical-url-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ical-url-input { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85em; }
.btn-save-ical { padding: 6px 14px; background: #2d5fa1; color: white; border: none; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.ical-status { font-size: 0.8em; color: #27ae60; margin-top: 6px; }

/* === Recurrence panel === */
.recurrence-panel {
  max-width: 600px;
  margin: 0 auto 14px;
  border: 2px solid #2d5fa1;
  border-radius: 12px;
  overflow: hidden;
  animation: rec-slide-in 0.2s ease-out;
}
@keyframes rec-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.recurrence-content {
  padding: 20px;
  background: #f0f4ff;
}
.recurrence-title {
  font-weight: 600;
  font-size: 1em;
  margin: 0 0 16px 0;
  color: #1a365d;
}
.recurrence-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}
.recurrence-section-title {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 12px;
}
.recurrence-cycle-config {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.9em;
  color: #555;
}
.recurrence-cycle-config select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 2px solid #2d5fa1;
  font-size: 0.95em;
  background: #f0f4ff;
  font-weight: 600;
  color: #1a365d;
}
.recurrence-groups {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.recurrence-group-card {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.recurrence-group-card:hover {
  background: #f7fafc;
}
.recurrence-group-card.selected {
  border-color: #2d5fa1;
  background: #f0f4ff;
}
.recurrence-group-card .group-label {
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 4px;
}
.recurrence-group-card.selected .group-label {
  color: #2d5fa1;
}
.recurrence-group-card .group-dates {
  font-size: 0.8em;
  color: #666;
}
.recurrence-group-card .group-next {
  font-size: 0.75em;
  color: #999;
  margin-top: 2px;
}
.recurrence-preview {
  font-size: 0.85em;
  color: #718096;
  background: #f7fafc;
  padding: 8px 10px;
  border-radius: 6px;
}
.recurrence-day-toggles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rec-day-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 2px solid #e2e8f0;
  font-size: 0.9em;
  cursor: pointer;
  background: white;
  font-weight: 500;
  transition: all 0.15s;
  font-family: inherit;
}
.rec-day-btn:hover {
  background: #f7fafc;
}
.rec-day-btn.selected {
  border-color: #2d5fa1;
  background: #f0f4ff;
  color: #2d5fa1;
  font-weight: 600;
}
.recurrence-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.rec-btn-cancel {
  padding: 8px 20px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.95em;
  cursor: pointer;
  background: white;
  font-family: inherit;
}
.rec-btn-cancel:hover { background: #f7fafc; }
.rec-btn-apply {
  padding: 8px 20px;
  border-radius: 6px;
  background: #2d5fa1;
  color: white;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.rec-btn-apply:hover { background: #1e4a8a; }

/* === Responsive === */
@media (max-width: 600px) {
  body { padding: 10px; overflow-x: hidden; }
  h1 { font-size: 1.3em; }
  .welcome { font-size: 0.9em; }
  .welcome summary { padding: 10px 14px; }
  .calendar-grid { grid-template-columns: 1fr; overflow: hidden; max-width: 100%; }
  .month { max-width: 100%; box-sizing: border-box; overflow: hidden; }
  .day {
    min-height: 44px;
    font-size: 1em;
    padding: 8px 4px;
  }
  .toolbar { padding: 12px; box-sizing: border-box; max-width: 100%; }
  .toolbar select {
    min-width: 0;
    width: 100%;
    font-size: 1em;
    padding: 10px 12px;
    box-sizing: border-box;
  }
  .btn-clear { padding: 10px 16px; }
  .legend-item {
    padding: 8px 10px;
    font-size: 0.9em;
    min-height: 44px;
  }
  .month-grid { gap: 1px; padding: 4px; grid-template-columns: 20px repeat(7, minmax(0, 1fr)); box-sizing: border-box; max-width: 100%; }
  .week-marker { font-size: 0.6em; }
  .summary-grid { grid-template-columns: 1fr; }
  .recurrence-content { padding: 14px; }
  .recurrence-groups { flex-direction: column; }
  .recurrence-cycle-config { font-size: 0.85em; }
}

@media (min-width: 601px) and (max-width: 900px) {
  .calendar-grid { grid-template-columns: repeat(2, 1fr); }
}
