/* RTL Hebrew styling for Pesach eligibility calculator */
* { box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, "Heebo", sans-serif;
  margin: 0;
  background: #f4f6fa;
  color: #1f2937;
  line-height: 1.5;
}

header {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  padding: 28px 24px;
  text-align: center;
}

header h1 { margin: 0; font-size: 28px; font-weight: 700; }
.subtitle { margin: 6px 0 0; opacity: 0.92; font-size: 15px; }

main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

/* Holiday selector tabs */
.holiday-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  background: white;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.holiday-tab {
  flex: 1;
  background: transparent;
  color: #4b5563;
  border: none;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  font-family: inherit;
}
.holiday-tab:hover:not(.active) { background: #f3f4f6; color: #1f2937; }
.holiday-tab.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  box-shadow: 0 2px 6px rgba(79,70,229,0.35);
}

[data-mode][hidden] { display: none !important; }

/* Multi-upload zone for shift reports (independence day) */
.shift-reports-zone {
  margin-bottom: 18px;
}
.shift-reports-zone .bulk-zone {
  border-color: #fde68a;
  background: #fffbeb;
}
.shift-reports-zone .bulk-zone:hover { background: #fef3c7; border-color: #f59e0b; }
.shift-reports-zone .bulk-zone.dragover { background: #fef3c7; border-color: #d97706; }

.info-box {
  background: white;
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.info-box h2 { margin-top: 0; font-size: 18px; }
.info-box ol { margin: 8px 0 0; padding-right: 22px; }
.info-box .note { background: #fef3c7; padding: 8px 12px; border-radius: 6px; margin-top: 10px; font-size: 14px; }

.bulk-upload {
  margin-bottom: 18px;
}
.bulk-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: white;
  border: 2px dashed #c7d2fe;
  border-radius: 14px;
  padding: 26px 18px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  text-align: center;
}
.bulk-zone:hover { background: #eef2ff; border-color: #818cf8; }
.bulk-zone.dragover { background: #eef2ff; border-color: #4f46e5; }
.bulk-icon { font-size: 36px; line-height: 1; }
.bulk-title { font-size: 17px; font-weight: 700; color: #1f2937; }
.bulk-sub { font-size: 13px; color: #6b7280; }
.bulk-detected {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detected-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.detected-chip.warn {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.detected-chip.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.chip-remove {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 700;
  margin-right: 4px;
  margin-left: 0;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  opacity: 0.7;
}
.chip-remove:hover { opacity: 1; }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.upload-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.1s;
}
.upload-card.loaded {
  border-color: #10b981;
  background: #f0fdf4;
}
.upload-card.error {
  border-color: #ef4444;
  background: #fef2f2;
}
.upload-title { font-weight: 700; font-size: 15px; }
.upload-desc { font-size: 13px; color: #6b7280; min-height: 36px; }
.upload-card input[type=file] { display: none; }
.upload-button {
  display: inline-block;
  background: #4f46e5;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
}
.upload-button:hover { background: #4338ca; }
.upload-status { font-size: 12px; color: #6b7280; min-height: 16px; word-break: break-all; }
.upload-card.loaded .upload-status { color: #047857; font-weight: 600; }
.upload-card.error .upload-status { color: #b91c1c; font-weight: 600; }

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.actions button {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.actions button:hover:not(:disabled) { background: #4338ca; }
.actions button:active:not(:disabled) { transform: scale(0.98); }
.actions button:disabled { background: #d1d5db; cursor: not-allowed; }
#download-btn { background: #10b981; }
#download-btn:hover:not(:disabled) { background: #059669; }
#download-import-btn { background: #0ea5e9; }
#download-import-btn:hover:not(:disabled) { background: #0284c7; }
.btn-secondary { font-size: 15px; }

.message {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.message.success { color: #047857; }
.message.error { color: #b91c1c; }
.message.info { color: #1d4ed8; }
.message.warning { color: #92400e; background: #fef3c7; padding: 6px 10px; border-radius: 6px; white-space: pre-wrap; }

.import-config {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.import-config summary {
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  user-select: none;
}
.import-config[open] summary { margin-bottom: 10px; }
.config-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.config-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #4b5563;
  font-weight: 600;
}
.config-grid input {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  width: 100px;
}
.config-grid input:focus {
  outline: 2px solid #4f46e5;
  outline-offset: -1px;
  border-color: #4f46e5;
}
.config-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.results-section {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.results-section h2 { margin-top: 0; }
.summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.summary-card {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.summary-card strong { color: #4f46e5; font-size: 18px; display: block; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-item label {
  font-size: 12px;
  color: #4b5563;
  font-weight: 600;
}
.filter-item select,
.filter-item input {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  min-width: 140px;
}
.filter-item input { min-width: 180px; }
.filter-item select:focus,
.filter-item input:focus {
  outline: 2px solid #4f46e5;
  outline-offset: -1px;
  border-color: #4f46e5;
}
#reset-filters,
#reset-filters-ind {
  background: #e5e7eb;
  color: #374151;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  height: 34px;
  align-self: end;
}
#reset-filters:hover,
#reset-filters-ind:hover { background: #d1d5db; }
.filter-count {
  margin-right: auto;
  font-size: 13px;
  color: #4b5563;
  align-self: center;
  padding-bottom: 2px;
}
.filter-count strong { color: #4f46e5; }

.table-wrapper {
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
#results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
#results-table th {
  background: #f9fafb;
  position: sticky;
  top: 0;
  padding: 8px;
  text-align: right;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
  z-index: 1;
}
#results-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f3f4f6;
}
#results-table tr:hover td { background: #f9fafb; }
.cell-yes { color: #047857; font-weight: 600; }
.cell-no  { color: #b91c1c; font-weight: 600; }
.cell-num { font-variant-numeric: tabular-nums; text-align: left; direction: ltr; }

footer {
  text-align: center;
  padding: 18px;
  color: #6b7280;
  font-size: 13px;
}
