/* ============================================
   IV WEST HUB - CONSOLIDATED STYLES (FINAL)
   Clean, professional design without icons
   - consistent 1300px max width
   - header has separation from body
   - list-table HYBRID: fits better + hides description text
   - optional modal styles (used by resources.html)
   ============================================ */

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
  background-color: #f8f8f8;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== HEADER & NAVIGATION ===== */
.header {
  background: transparent;
  color: #1f4e79;
  padding: 10px 18px 14px 18px;   /* extra bottom padding */
  box-shadow: none;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 30px;            /* space under header so it doesn’t blend */
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { font-size: 16px; font-weight: 650; }

.logo-link { color: #1f4e79; text-decoration: none; }

.nav-links { display: flex; gap: 14px; align-items: center; }

.nav-link {
  color: #1f4e79;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.nav-link:hover { background-color: rgba(31, 78, 121, 0.10); }
.nav-link.active { background-color: rgba(31, 78, 121, 0.16); }

.nav-link-mobile {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: #1f4e79;
}

.quarter-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f4e79;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
    text-align: center;  /* ← ADD THIS */
}


/* Mobile Menu */
.mobile-menu {
  display: none;
  background-color: #ffffff;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
  border-bottom: 1px solid #e5e7eb;
}
.mobile-menu.show { display: block; }
.mobile-menu a {
  display: block;
  color: #1f4e79;
  padding: 14px 18px;
  text-decoration: none;
  border-bottom: 1px solid #eef2f7;
  font-weight: 600;
}
.mobile-menu a:hover { background-color: rgba(31, 78, 121, 0.06); }

/* ===== CONTAINER (generic) ===== */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

/* Helpful generic wrapper for page bodies that are NOT using .container */
.page-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  background-color: transparent;
  padding: 25px 30px;
  border-radius: 4px;
  margin-bottom: 25px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.0);
}
.page-header h1 {
  font-size: 24px;
  color: #1f4e79;
  margin-bottom: 8px;
}
.page-header p { color: #666; font-size: 14px; }

/* ===== SEARCH & FILTERS ===== */
.search-section {
  background-color: white;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.search-box { display: flex; gap: 10px; margin-bottom: 15px; }

.search-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
.search-input:focus { outline: none; border-color: #1f4e79; }

.filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 15px;
  align-items: end;
}
.filter-group { display: flex; flex-direction: column; }
.filter-group label {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: #555;
}
.filter-group select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-primary { background-color: #1f4e79; color: white; }
.btn-primary:hover { background-color: #163a5c; }

.btn-secondary { background-color: #f3f4f6; color: #374151; }
.btn-secondary:hover { background-color: #e5e7eb; }

.btn-export { background-color: #10b981; color: white; }
.btn-export:hover { background-color: #059669; }

/* ===== DEPARTMENT/TAB CONTENT (if used) ===== */
.department {
  display: none;
  background-color: white;
  padding: 20px;
  border-radius: 0 4px 4px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.department.active { display: block; }

/* ===== RESULTS INFO ===== */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: white;
  border-radius: 4px;
  margin-bottom: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.results-count {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

/* ============================================================
   LIST TABLE (HYBRID)
   - scrolls only when truly needed
   - description column shows only “Click for more details”
   ============================================================ */
.list-table {
  width: 100%;
  background: #ffffff;
  border-radius: 4px;
  overflow-x: auto; /* horizontal scroll only if needed */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.list-table table {
  width: 100%;
  min-width: 980px;       /* keeps columns visible in normal desktop widths */
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.list-table th {
  background: #f9fafb;
  padding: 10px 10px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  font-size: 13px;
  white-space: nowrap;
}

.list-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.list-table tbody tr:hover { background: #fafafa; }

/* widths tuned to reduce overflow */
.list-table th:nth-child(1), .list-table td:nth-child(1) { width: 60px; }   /* Area */
.list-table th:nth-child(2), .list-table td:nth-child(2) { width: 180px; }  /* Title */
.list-table th:nth-child(3), .list-table td:nth-child(3) { width: 90px; }   /* Type */
.list-table th:nth-child(4), .list-table td:nth-child(4) { width: 80px; }   /* Status */
.list-table th:nth-child(5), .list-table td:nth-child(5) { width: 110px; }  /* Updated */
.list-table th:nth-child(6), .list-table td:nth-child(6) { width: 60px; }   /* Link */

/* Title should read like a link */
.list-title { color: #1f4e79; font-weight: 600; cursor: pointer; }
.list-title:hover { text-decoration: underline; }

/* “Open” link styling */
.list-link { color: #1f4e79; text-decoration: none; font-size: 13px; }
.list-link:hover { text-decoration: underline; }

/* HYBRID: hide “Last Updated” on tighter widths to avoid scroll */
@media (max-width: 1300px) {
  .list-table th:nth-child(5),
  .list-table td:nth-child(5) { display: none; }

  .list-table table { min-width: 800px; }
}

/* ===== SPREADSHEET TABLE (used on some pages) ===== */
.spreadsheet-container {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
}
.spreadsheet-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 350px);
}
.spreadsheet-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 14px;
  table-layout: auto; /* Changed from fixed to allow flexible widths */
}
.spreadsheet-table thead { position: sticky; top: 0; z-index: 10; }
.spreadsheet-table th {
  text-align: left;
  background-color: #f0f3f7;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
  position: relative; /* For resize handle positioning */
  user-select: none; /* Prevent text selection while resizing */
}
.spreadsheet-table th:hover { background-color: #e5e9ef; cursor: pointer; }
.spreadsheet-table td { 
  padding: 12px; 
  border-top: 1px solid #eee; 
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spreadsheet-table tbody tr:hover { background-color: #f9fbfd; }
.spreadsheet-table tbody tr:nth-child(even) { background-color: #fafafa; }

/* Resize handle for spreadsheet tables */
.spreadsheet-table .resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 1;
  background: transparent;
  user-select: none;
}

.spreadsheet-table .resize-handle:hover {
  background: rgba(31, 78, 121, 0.15);
  border-right: 2px solid #1f4e79;
}

.spreadsheet-table .resize-handle.resizing {
  background: rgba(31, 78, 121, 0.25);
  border-right: 2px solid #1f4e79;
}

input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.spreadsheet-table th input[type="checkbox"] { width: 18px; height: 18px; }

.email-link, .phone-link { color: #1f4e79; text-decoration: none; }
.email-link:hover, .phone-link:hover { text-decoration: underline; }

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.card {
  background-color: white;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 6px rgba(0,0,0,0.1); transform: translateY(-2px); }
.card h3 { font-size: 16px; color: #1f4e79; margin-bottom: 10px; }
.card p { font-size: 14px; color: #666; margin-bottom: 15px; }

.card-btn {
  background-color: #1f4e79;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.card-btn:hover { background-color: #163a5c; }

/* ===== FOOTER ===== */
.footer {
  background-color: #1f4e79;
  color: white;
  padding: 20px 30px;
  margin-top: 60px;
  text-align: center;
}
.footer-content { max-width: 1300px; margin: 0 auto; }
.footer p { font-size: 13px; opacity: 0.9; }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }

.no-results { text-align: center; padding: 40px; color: #666; font-size: 14px; }

/* ===== NOTIFICATION ===== */
@keyframes slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #10b981;
  color: white;
  padding: 15px 25px;
  border-radius: 4px;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

/* ============================================================
   OPTIONAL: MODAL STYLES (resources details modal)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.modal-overlay.show { display: flex; }

.modal {
  width: min(760px, 96vw);
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  background: #f9fafb;
}
.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f4e79;
  line-height: 1.25;
}
.modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 8px;
  color: #334155;
}
.modal-close:hover { background: rgba(31,78,121,0.08); }

.modal-body { padding: 14px 16px 16px; }

.modal-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.meta-item {
  background: #ffffff;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 10px 10px;
}
.meta-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  margin-bottom: 2px;
}
.meta-value {
  font-size: 13px;
  color: #0f172a;
  font-weight: 600;
  word-break: break-word;
}
.modal-desc {
  border: 1px solid #eef2f7;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #334155;
  line-height: 1.55;
  white-space: pre-wrap;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.modal-actions a { text-decoration: none; }

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #1f4e79;
  font-weight: 700;
  font-size: 13px;
}
.btn-link:hover { background: #f8fafc; }

.btn-primaryish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: #1f4e79;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
}
.btn-primaryish:hover { background: #163a5c; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { padding: 15px 20px; }
  .nav-links { display: none; }
  .nav-link-mobile { display: block; }

  .container { padding: 20px; }
  .page-header { padding: 20px; }
  .page-header h1 { font-size: 20px; }

  .filters-row { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }

  .spreadsheet-table { font-size: 12px; }
  .spreadsheet-table th, .spreadsheet-table td { padding: 8px; }

  .modal-meta { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 18px; }
}

.sidebar-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}