/* usafwx-multiday/assets/app.css
   Full replacement CSS (theme override-proof for tables)
*/

/* =========================
   Base container + reset
   ========================= */

.usafwx-wrap {
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  max-width: 1200px;
}

#usafwx-multiday,
#usafwx-multiday * {
  box-sizing: border-box;
}

/* Force a sane base so themes don't invert things inside the widget */
#usafwx-multiday {
  color: #111;
  background: transparent;
}

/* =========================
   Header
   ========================= */

.usafwx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.usafwx-title {
  font-size: 18px;
  font-weight: 700;
}

/* =========================
   Controls + rows
   ========================= */

.usafwx-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

#usafwx-multiday label {
  color: #666;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: 12px;
  display: block;
  margin: 0 0 4px 0;
}

.usafwx-col input,
.usafwx-row input {
  width: 100%;
  display: block;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 0;
  font-size: 14px;
  color: #111;
  background: #fff;
}

#usafwx-multiday input::placeholder,
#usafwx-multiday textarea::placeholder {
  font-size: 12px;
  color: #999;
  opacity: 1;
}

.usafwx-row-top {
  display: grid;
  grid-template-columns: 75% 25%;
  gap: 10px;
  align-items: end;
}

.usafwx-top-left-grid {
  display: grid;
  grid-template-columns: 19% 80%;
  gap: 10px;
  align-items: end;
}

.usafwx-row-bottom {
  display: grid;
  grid-template-columns: 75% 25%;
  gap: 10px;
  align-items: end;
}

.usafwx-col {
  min-width: 0;
}

/* =========================
   Buttons / actions
   ========================= */

.usafwx-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.usafwx-btn {
  padding: 8px 10px;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.usafwx-btn.secondary {
  background: #fff;
  color: #111;
  border-color: #aaa;
}

/* =========================
   Status
   ========================= */

.usafwx-status {
  color: #000;
  background: #fafafa;
  border: 1px dashed #bbb;
  border-radius: 6px;
  padding: 8px;
}

/* =========================
   Panels
   ========================= */

.usafwx-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
  align-items: start;
}

@media (max-width: 900px) {
  .usafwx-panels {
    grid-template-columns: 1fr;
  }
}

.usafwx-panel {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
  background: #fff;
}

.usafwx-panel-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #111;
}

.usafwx-panel textarea {
  width: 100%;
  display: block;
  min-height: 140px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #111;
  background: #fff;
}

.usafwx-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* =========================
   Row Controls
   ========================= */

.usafwx-row-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px 0;
  padding: 8px;
  border: 1px dashed #ddd;
  border-radius: 8px;
  background: #fcfcfc;
}

.usafwx-row-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  user-select: none;
}

.usafwx-row-pill label {
  margin: 0;
  font-size: 12px;
  color: #555;
}

.usafwx-row-pill button {
  border: 1px solid #aaa;
  background: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  color: #111;
}

/* =========================
   Grid sections (both tables)
   ========================= */

.usafwx-grid-wrap {
  border-top: 1px solid #eee;
  padding-top: 12px;

  /* Theme override protection: keep the section light */
  background: #fff;
  border-radius: 8px;
}

.usafwx-empty {
  padding: 14px;
  border: 1px dashed #bbb;
  border-radius: 8px;
  background: #fcfcfc;
  color: #111;
}

/* =========================================================
   THEME OVERRIDE-PROOF TABLE STYLING (fix black backgrounds)
   Applies to BOTH interpreted + raw tables (any table inside)
   ========================================================= */

#usafwx-multiday table,
#usafwx-multiday table thead,
#usafwx-multiday table tbody,
#usafwx-multiday table tfoot {
  background: #fff !important;
  color: #111 !important;
}

#usafwx-multiday table th,
#usafwx-multiday table td {
  background: #fff !important;
  color: #111 !important;
  border: 1px solid #ddd !important;
}

/* Top header row */
#usafwx-multiday table thead th {
  background: #f0f0f0 !important;
  font-weight: 800 !important;
}

/* Left header column (row labels) — works for both implementations:
   - interpreted grid uses .usafwx-rowlabel
   - raw table often uses tbody th
*/
#usafwx-multiday .usafwx-rowlabel,
#usafwx-multiday table tbody th {
  background: #f9f9f9 !important;
  font-weight: 800 !important;
  text-align: left !important;
  color: #111 !important;
}

/* =========================
   Interpreted grid (.usafwx-table)
   ========================= */

.usafwx-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.usafwx-table th,
.usafwx-table td {
  padding: 6px;
  vertical-align: middle;
  text-align: center;
  font-size: 13px;
}

.usafwx-rowlabel {
  width: 140px;
}

/* =========================
   Raw model table (.usafwx-raw-table)
   ========================= */

.usafwx-raw-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff !important;
}

.usafwx-raw-table th,
.usafwx-raw-table td {
  padding: 6px 8px;
  vertical-align: middle;
  text-align: center;
  font-size: 13px;
}

/* =========================
   Icons + wind arrow
   ========================= */

.usafwx-icon {
  font-size: 18px;
  line-height: 1;
}

/* Wind arrow icon (triangle) */
.usafwx-wind-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 12px solid #111;
  margin-right: 6px;
  vertical-align: middle;
  transform-origin: 50% 70%;
}

.usafwx-wind-vrb {
  border-bottom-color: #777;
}

.usafwx-wind-txt {
  vertical-align: middle;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
/* =========================================
   GRID SPACING + HEIGHT TUNING
   ========================================= */

/* Space between multiday grid and raw grid */
#usafwx-multiday .usafwx-grid-wrap + .usafwx-grid-wrap {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid #e0e0e0;
}

/* Interpreted grid minimum height */
#usafwx-grid {
  min-height: 260px;
}

/* Raw model grid scroll height */
#usafwx-multiday .usafwx-raw-wrap {
  max-height: 420px !important;
}
