/* style.css */

body {
  font-family: Arial, sans-serif;
  background-color: #0f1117;
  color: #e0e0e0;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
  background-color: #1a1c23;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Let the weapons table scroll horizontally if it ever overflows */
.weap-table-wrap {
  overflow-x: auto;
}

/* Ensure the table is wide enough so the Remove button doesn’t get clipped */
#weaponsTable {
  width: 100%;
  min-width: 1100px;          /* guarantees columns + Remove stay in view */
}

@media (min-width: 1400px) {
  .container { max-width: 1400px; }
}


h1, h2 {
  color: #00bcd4;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
}

label {
  display: block;
  margin: 0.5rem 0;
}

input[type="text"],
input[type="number"] {
  padding: 0.4rem;
  margin-left: 0.5rem;
  border: none;
  border-radius: 4px;
  background-color: #2a2d36;
  color: #e0e0e0;
  width: 150px;
}

.mod-row {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
}

.mod-row label {
  flex: 1;
}

.mod-row input[type="number"] {
  width: 60px;
}

section {
  margin-bottom: 2rem;
}

.results p {
  margin: 0.3rem 0;
  font-weight: bold;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  input[type="text"],
  input[type="number"] {
    width: 100%;
    margin-top: 0.3rem;
  }

  .mod-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  background-color: #222;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.stat-label {
  font-weight: bold;
  color: #00bcd4;
  text-align: right;
  padding-right: 0.5rem;
}

.stat-value {
  color: #e0e0e0;
  text-align: left;
}


#weaponsSection .weap-row{display:flex;align-items:center;gap:.6rem;margin:.4rem 0}
#weaponsSection label{width:180px}
#weaponsTable th,#weaponsTable td{padding:.45rem .5rem}



/* --- Restore weapons section defaults (undo the broad wildcard) --- */
#weaponsResultBlock { text-align: inherit; }
#weaponsResultBlock * { text-align: inherit; }   /* stop forcing left on everything */

/* Keep the weapons table readable */
#weaponsTable th,
#weaponsTable td {
  text-align: left;
}

/* Optional: tidy bullets (adjust to taste or remove) */
#weaponsResultBlock ul { margin-left: 1.25rem; }


/* --- Left-align ONLY the Starship Stat Block --- */
#starshipStats .stat-grid {
  grid-template-columns: 180px 1fr; /* adjust if you want wider/narrower labels */
}
#starshipStats .stat-label {
  text-align: left;   /* override default right-aligned labels */
  padding-right: 0;
}
#starshipStats .stat-value {
  text-align: left;
}
#starshipStats h2 {
  text-align: left;
}

/* === Separate Weapons Stat Block === */
#weaponStats h2 { text-align: left; }

#weaponStats .content {
  padding-top: 0.25rem;
}

#weaponStats ul {
  margin: 0.5rem 0 0.75rem 1.25rem;  /* clean bullets, left aligned */
  padding: 0;
  list-style: disc;
}

#weaponStats .weapons-totals {
  display: grid;
  grid-template-columns: 220px 1fr;  /* label column + value column */
  gap: 0.4rem 0.75rem;
  background: #222;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}

#weaponStats .weapons-totals > div {
  display: contents; /* let label/value occupy the two columns */
}

#weaponStats .weapons-totals strong {
  text-align: left;
  color: #00bcd4;
}

#weaponStats .weapons-totals span {
  text-align: left;
  color: #e0e0e0;
}

#weaponStats .weapon-note {
  color: #aeb7c8;
  font-style: italic;
}


/* === Modifications layout: input first, then label with spacing === */
.mod-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;              /* space between control and label */
}

/* kill the global left margin for mod controls */
.mod-row input[type="number"],
.mod-row input[type="checkbox"] {
  margin-left: 0;
}

/* lock a consistent label column (overrides earlier flex:1) */
.mod-row label {
  flex: 0 0 240px;           /* try 200–260px to taste */
  line-height: 1.2;
}

/* slightly wider counter if you want */
.mod-row input[type="number"] {
  width: 72px;
}

/* mobile: narrower label column */
@media (max-width: 700px) {
  .mod-row { gap: 0.5rem; }
  .mod-row label { flex-basis: 180px; }
}

/* Keep cost as one unit and add the $ via CSS */
#weaponCost {
  white-space: nowrap;
}
#weaponCost::before {
  content: "$";
  margin-right: 0.25rem;
}

/* softer, italic notes in the weapons list */
#weaponStats .weapon-note {
  color: #aeb7c8;
  font-style: italic;
}


/* === Modifications: right-justify controls, left-justify labels === */
.mod-row {
  display: grid;                       /* switch from flex to grid */
  grid-template-columns: 110px 1fr;    /* control column, label column */
  align-items: center;
  column-gap: 0.75rem;
}

.mod-row input[type="number"],
.mod-row input[type="checkbox"] {
  justify-self: end;                   /* right edge of the control column */
  margin-left: 0;                      /* kill inherited margin */
}

.mod-row label {
  justify-self: start;                 /* left edge of the label column */
  text-align: left;
  margin: 0;
  flex: unset;                         /* override earlier flex sizing */
  line-height: 1.2;
}

/* keep a comfortable width for counters */
.mod-row input[type="number"] {
  width: 72px;
}

/* mobile: slightly narrower control column */
@media (max-width: 700px) {
  .mod-row { grid-template-columns: 90px 1fr; }
}


#saveLoadSection .save-controls {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
#saveLoadSection button, #saveLoadSection .btn-file span {
  background:#2a2d36; color:#e0e0e0; border:1px solid #444;
  border-radius:6px; padding:.4rem .7rem; cursor:pointer;
}
#saveLoadSection .btn-file input { display:none; }
#saveLoadSection .btn-file span:hover,
#saveLoadSection button:hover { background:#333843; }


/* Header with title + logo side by side */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* puts logo to the right */
  gap: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
}

.page-header h1 {
  margin: 0;
  color: #00bcd4;
}

.brand-logo {
  height: 180px;        /* tweak to taste */
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.5));  /* optional */
}

/* On small screens, stack title over logo */
@media (max-width: 520px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .brand-logo { height: 40px; }
}

