/* GLOBAL SETTINGS */
body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f1f5f9;
  padding: 20px;
  color: #1e293b;
}
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* STATUS BAR */
#status-bar {
  padding: 12px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
  display: none;
}
.status-error {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}
.status-success {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #4ade80;
}
.status-working {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px solid #38bdf8;
}

/* INPUTS */
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}
.input-field {
  width: 100%;
  background: transparent;
  border: 1px solid #cbd5e1;
  padding: 12px;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
  background-color: white;
}
.input-field:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.input-field:focus {
  border-color: #2563eb;
  background: white;
  outline: 2px solid #2563eb;
}
.table-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.95rem;
}
.table-input:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.table-input:focus {
  border-color: #2563eb;
  background: white;
  outline: 2px solid #2563eb;
}

/* TOOLTIPS */
.tooltip-container {
  position: relative;
  overflow: visible; /* Critical: allows the popup to float outside the box */
}

.tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: #1e293b; /* Dark Slate */
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 12px;

  /* POSITIONING: FLIP TO TOP */
  position: absolute;
  z-index: 9999; /* Ensure it sits on top of everything */
  bottom: 125%; /* Push it UP above the element */
  left: 50%; /* Center horizontally */
  transform: translateX(-50%); /* Perfect centering */

  /* Reset old properties */
  top: auto;
  right: auto;
  margin-top: 0;

  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.75rem;
  font-weight: normal;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); /* Stronger shadow for readability */
  pointer-events: none;
  line-height: 1.4;
  text-transform: none;
}

/* Show on Hover */
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Little Arrow Pointing Down */
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%; /* Put arrow at the bottom of the black box */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

/* BUTTONS */
.btn-action {
  cursor: pointer;
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  transition: all 0.2s;
  border: none;
  font-size: 0.95rem;
}
.btn-blue {
  background-color: #2563eb;
  color: white;
}
.btn-blue:hover {
  background-color: #1d4ed8;
}
.btn-teal {
  background-color: #0d9488;
  color: white;
}
.btn-teal:hover {
  background-color: #0f766e;
}
.btn-gray {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-gray:hover {
  background-color: #e2e8f0;
}
.btn-dark {
  background-color: #1e293b;
  color: white;
}
.btn-dark:hover {
  background-color: #0f172a;
}

/* PRINT ENGINE */
#print-preview-area {
  display: none;
  margin-top: 40px;
  border-top: 4px solid #cbd5e1;
  padding-top: 40px;
}
.print-month {
  break-inside: avoid;
  border: 1px solid #cbd5e1;
  margin-bottom: 20px;
  background: white;
}
.print-header {
  background: #1e293b;
  color: white;
  font-weight: bold;
  text-align: center;
  padding: 5px;
  font-size: 0.9rem;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}
.print-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid #cbd5e1;
  background: #f1f5f9;
  font-size: 0.7rem;
  font-weight: bold;
  text-align: center;
}
.print-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* 1. Ensure the container expands to fit its content */
.print-day {
  min-height: 90px !important;
  height: auto !important; /* Forces the cell to grow if there are many events */
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.print-day:nth-child(7n) {
  border-right: none;
}
.print-day-num {
  font-weight: bold;
  color: #64748b;
  margin-bottom: 4px;
  display: block;
  text-align: right;
  padding-right: 4px;
  font-size: 0.8rem;
}

.tag-base {
  display: block !important;
  white-space: normal !important; /* Allows text to wrap */
  overflow: visible !important; /* Ensures text isn't cut off */
  text-overflow: clip !important; /* Removes the ellipsis (...) */
  word-wrap: break-word !important; /* Breaks long strings like times */
  padding: 2px 4px !important;
  margin-bottom: 2px;
  font-size: 0.65rem !important;
}

.tag-pickup {
  background-color: #16a34a !important;
  color: white !important;
  border-left: 3px solid #14532d !important;
}
.tag-dropoff {
  background-color: #334155 !important;
  color: white !important;
  border-left: 3px solid #0f172a !important;
}
.tag-mid {
  background-color: #dbeafe !important;
  color: #1e40af !important;
  border-left: 3px solid #60a5fa !important;
}
.tag-conflict {
  background-color: #dc2626 !important;
  color: white !important;
  border: 1px dashed white !important;
}

/* PRINT MEDIA QUERIES */
@media print {
  @page {
    size: landscape;
    margin: 0.5in;
  }
  body {
    background: white;
    padding: 0;
    margin: 0;
  }
  .btn-action,
  .no-print,
  #status-bar {
    display: none !important;
  }
  .main-container {
    box-shadow: none;
    border: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
  }
  body:not(.printing-table) .main-container > div:not(#print-preview-area) {
    display: none;
  }
  body:not(.printing-table) #print-preview-area {
    display: block !important;
  }
  body:not(.printing-table) .print-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  body.printing-table .main-container > div:not(#table-section) {
    display: none;
  }
  body.printing-table #table-section {
    display: block !important;
    width: 100%;
  }
  body.printing-table table {
    width: 100%;
    border-collapse: collapse;
  }
  thead {
    display: table-header-group;
  }
  tfoot {
    display: table-footer-group;
  }
  tr {
    page-break-inside: avoid;
  }
  body.printing-table input {
    border: none;
    padding: 0;
    font-weight: 600;
    color: #334155;
  }
  table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }

  /* Optional: gives more room to the Event column since names can be long */
  th:nth-child(1) {
    width: 40%;
  }
  th:nth-child(2),
  th:nth-child(3) {
    width: 25%;
  }
  th:nth-child(4) {
    width: 10%;
  }

  /* Ensure text wraps nicely within cells */
  td {
    word-wrap: break-word;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
/* --- FIX FOR BRIAN HIRSCH TOOLTIP --- */
/* This ensures the tooltip works even if JS wipes the classes */

#tabTemplates {
  position: relative !important;
  overflow: visible !important;
}

#tabTemplates .tooltip-text {
  /* Ensure the text box properties are locked in */
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background-color: #1e293b;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 12px;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 0.3s ease;
  font-weight: normal;
  text-transform: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* The Arrow */
#tabTemplates .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

/* The Hover Trigger */
#tabTemplates:hover .tooltip-text {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Add this to style.css */
.row-marked-out {
  background-color: #f3f4f6 !important; /* Light gray background */
  opacity: 0.7;
}

.row-marked-out .table-input,
.row-marked-out td {
  text-decoration: line-through;
  color: #64748b !important;
}

.print-strike {
  text-decoration: line-through !important;
  color: #94a3b8 !important;
  background-color: #f3f4f6 !important;
}
