/* Blue Shift - Composants UI reutilisables */

/* ===== Cards ===== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}
.card-strong {
  background: var(--glass-bg-strong);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  line-height: 1;
  min-height: 2.75rem; /* 44px touch target */
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}
.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(var(--glass-blur));
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  min-height: 2.75rem; /* 44px touch target */
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-md);
  min-height: 3.25rem;
  border-radius: var(--radius-lg);
}
.btn-icon {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
}
.btn-full {
  width: 100%;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  background: var(--badge-bg);
  color: var(--badge-text);
}
.badge-work {
  background: rgba(14, 165, 233, 0.15);
  color: var(--color-work);
}
.badge-rest {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-rest);
}
.badge-conge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-conge);
}
.badge-matin {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-matin);
}
.badge-aprem {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-aprem);
}
.badge-nuit {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-nuit);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* ===== Input / Form ===== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.input-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
}
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--fs-base);
  min-height: 2.75rem;
  transition: all var(--transition-fast);
}
.input:focus {
  background: var(--surface-input-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.input::placeholder {
  color: var(--text-muted);
}
textarea.input {
  resize: vertical;
  min-height: 5rem;
}
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

/* ===== Toggle ===== */
.toggle {
  position: relative;
  width: 3rem;
  height: 1.625rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: all var(--transition-fast);
}
.toggle.active {
  background: var(--accent-muted);
  border-color: var(--accent);
}
.toggle.active::after {
  left: calc(100% - 1.25rem - 2px);
  background: var(--accent);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 200ms ease;
}
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}
.modal {
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 28rem;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: var(--space-6);
}
@media (min-width: 640px) {
  .modal {
    border-radius: var(--radius-xl);
    animation: fadeInScale 250ms ease;
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.modal-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.modal-handle {
  width: 2rem;
  height: 4px;
  background: var(--glass-border);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-4);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: calc(var(--safe-area-top) + var(--nav-height) + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur-heavy));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 300ms var(--transition-spring);
  max-width: calc(100vw - 2rem);
}

/* ===== Chip / Tag ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 2.75rem; /* 44px touch target */
}
.chip:hover {
  background: var(--glass-bg-hover);
}
.chip.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Divider ===== */
.divider {
  width: 100%;
  height: 1px;
  background: var(--divider);
  margin: var(--space-4) 0;
}

/* ===== Progress bar ===== */
.progress {
  width: 100%;
  height: 4px;
  background: var(--glass-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ===== Empty state ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--text-tertiary);
}
.empty-state svg {
  width: 3rem;
  height: 3rem;
  opacity: 0.4;
}

/* ===== Skeleton loader ===== */
.skeleton {
  background: linear-gradient(90deg, var(--glass-bg) 25%, var(--glass-bg-hover) 50%, var(--glass-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ===== Color dot ===== */
.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Section header (legacy plain) ===== */
.section-header {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

/* ===== Section header — premium dashboard variant ===== */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
  border-bottom: 1px solid var(--glass-border);
}
.dash-section-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.dash-section-accent {
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(to bottom, #38bdf8, #0ea5e9);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(14, 165, 233, 0.4);
}
.dash-section-title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.dash-section-action {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.dash-section-action:hover {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(14, 165, 233, 0.38);
}
.dash-section-action:active { transform: scale(0.95); }

/* ===== Stat card ===== */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.stat-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: 1;
}
.stat-label {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

/* ===== Premium Dashboard — Widgets ===== */

/* --- Info row (Prochain travail) --- */
.dash-info-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dash-info-row:active { transform: scale(0.98); }
.dash-info-row:hover { background: var(--glass-bg-hover); }

/* --- Week strip --- */
.week-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 3px;
  -webkit-overflow-scrolling: touch;
}
.week-strip::-webkit-scrollbar { display: none; }

.week-strip-separator {
  flex-shrink: 0;
  width: 1px;
  height: 54px;
  background: linear-gradient(to bottom, transparent, var(--glass-border-hover), transparent);
  align-self: center;
  margin: 0 2px;
}

.week-day-cell {
  flex-shrink: 0;
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 5px 8px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  cursor: pointer;
  gap: 3px;
  transition: all var(--transition-fast);
}
.week-day-cell:active { transform: scale(0.93); }
.week-day-cell.today {
  background: var(--today-bg);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.2);
}
.week-day-cell.next-week {
  opacity: 0.72;
}

.week-cell-dow {
  font-size: 0.72rem;
  font-weight: var(--fw-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.week-cell-num {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--text-primary);
}
.week-cell-num.active { color: var(--accent); }

.week-cell-bar {
  width: 32px;
  height: 2.5px;
  border-radius: 2px;
  flex-shrink: 0;
}
.week-cell-type {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  min-height: 0.65rem;
}
.week-cell-weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 2px;
}
.week-cell-temp {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  line-height: 1;
}

/* --- À venir --- */
.dash-upcoming-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

/* --- Stats chips --- */
.stats-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.stat-chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  transition: all var(--transition-fast);
}
.stat-chip:hover { background: var(--glass-bg-hover); }
.stat-chip-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: 1;
  margin-bottom: 3px;
}
.stat-chip-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Customize modal rows --- */
.customize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--glass-border);
}
.customize-row:last-of-type { border-bottom: none; }
