/* frontend/assets/phase3.css — Phase 3 Leave & Holiday styles */

/* ── Toast notifications ──────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  background: #1e293b;
  color: #fff;
  font-size: .9rem;
  opacity: 0;
  transform: translateY(12px);
  transition: all .25s ease;
  z-index: 9999;
  max-width: 360px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info    { background: #2563eb; }

/* ── Badge variants ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2em .55em;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-info      { background: #dbeafe; color: #1e40af; }

/* ── Leave balance grid ───────────────────────────────────────── */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.balance-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.balance-type { font-weight: 700; font-size: .8rem; color: #64748b; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .05em; }
.balance-numbers { margin-bottom: .25rem; }
.balance-avail { font-size: 2rem; font-weight: 800; color: #2563eb; }
.balance-label { font-size: .75rem; color: #94a3b8; margin-left: .25rem; }
.balance-detail { font-size: .72rem; color: #94a3b8; }

/* ── Leave day preview box ────────────────────────────────────── */
.leave-day-preview { margin: .75rem 0; }
.preview-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.preview-days  { font-size: 1.1rem; font-weight: 800; color: #1d4ed8; }
.preview-info  { font-size: .85rem; color: #3b82f6; }
.preview-holidays { font-size: .8rem; color: #64748b; width: 100%; }

/* ── Holiday calendar ─────────────────────────────────────────── */
.holiday-list { display: flex; flex-direction: column; gap: 1.5rem; }
.holiday-month-group {}
.holiday-month-title {
  font-size: 1rem; font-weight: 700; color: #1e293b;
  margin-bottom: .75rem; padding-bottom: .4rem;
  border-bottom: 2px solid #e2e8f0;
}
.holiday-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem .75rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: .5rem;
}
.holiday-item.holiday-optional { border-left: 3px solid #f59e0b; }
.holiday-date-box {
  display: flex; flex-direction: column; align-items: center; min-width: 44px;
  background: #2563eb; color: #fff; border-radius: 8px; padding: .3rem .5rem;
}
.holiday-day-name { font-size: .65rem; font-weight: 600; text-transform: uppercase; }
.holiday-day-num  { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.holiday-info { flex: 1; }
.holiday-name { font-weight: 600; font-size: .9rem; color: #1e293b; display: block; }
.holiday-desc { font-size: .8rem; color: #64748b; display: block; }
.holiday-source { margin-top: .25rem; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.75rem;
  width: 100%; max-width: 480px;
  box-shadow: 0 12px 48px rgba(0,0,0,.25);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }

/* ── Empty / loading states ───────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: #475569; margin-bottom: .3rem; }
.empty-state p  { font-size: .875rem; }

.loading-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto .75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ─────────────────────────────────────────────────────── */
.error-message {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 6px;
  padding: .65rem .875rem;
  font-size: .875rem;
  white-space: pre-wrap;
}
.form-hint { font-size: .78rem; color: #64748b; margin-top: .25rem; }
.p-4  { padding: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted  { color: #94a3b8; }
.text-danger { color: #dc2626; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  background: #f8fafc;
  font-weight: 600;
  text-align: left;
  padding: .6rem .875rem;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.data-table td {
  padding: .6rem .875rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
