/* ==========================
   AI Supply Chain – App CSS
   ========================== */

:root{
  --container-max: 1400px;
  --gap: 20px;
  --radius: 8px;
  --border: 1px solid #ddd;
  --brand: #007bff;
  --brand-dark: #0056b3;
  --muted: #6c757d;
  --muted-dark:#545b62;
  --pane-h: clamp(320px, 52vh, 640px);
}

/* Reset */
*{ box-sizing: border-box; }

/* Base */
body{
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  color: #111;
}

.container{
  padding: 20px;
  max-width: var(--container-max);
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 0 10px rgba(0,0,0,.08);
}

.header{ text-align: center; padding-bottom: 20px; }
.header h1{ margin: 0 0 6px; font-size: 28px; }
.header p{ margin: 0; color:#555; }

/* File path callout */
.file-path-section{
  background:#f8f9fa;
  padding:15px;
  border-radius:5px;
  margin-bottom:20px;
  border-left:4px solid var(--brand);
}

/* Layout grids */
.input-section, .output-section{ margin-bottom: 30px; }

.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;  /* two columns */
  gap: var(--gap);
}

/* Full-width helper */
.input-section .grid .span-2{ grid-column: 1 / -1; }

.input-group{ margin-bottom: 8px; }
label{ display:block; margin:0 0 6px; font-weight:700; }

input, select, textarea{
  width: 100%;
  padding: 10px;
  border: var(--border);
  border-radius: 4px;
  background: #fff;
}

/* Make dropdown (select) match input width and keep Search button to the right */
.select-row{
  display: grid;
  grid-template-columns: 1fr auto; /* full-width select + fixed button */
  gap: 10px;
}
#startNodeSelect{ width: 100% !important; }  /* ensure same length as input */

/* Buttons */
.button-group{ display:flex; gap:10px; flex-wrap:wrap; }
.button-group button{
  padding:12px 20px;
  cursor:pointer;
  border:none;
  border-radius:4px;
  background:var(--brand);
  color:#fff;
  font-size:14px;
}
.button-group button:hover{ background:var(--brand-dark); }
.button-group .secondary{ background:var(--muted); }
.button-group .secondary:hover{ background:var(--muted-dark); }

/* Status toasts */
.status{ margin:10px 0; padding:10px; border-radius:4px; background:#e9ecef; }
.status.success{ background:#d4edda; color:#155724; }
.status.error{ background:#f8d7da; color:#721c24; }

/* Output split */
.output-section .grid{ align-items: start; }

#graphviz-container{
  height: var(--pane-h);
  min-height: 0 !important;
  border: var(--border);
  border-radius: 4px;
  background: #fff;
  padding: 10px;
  overflow: auto;
  position: relative;
}
#graphviz-container svg{ max-width:100%; height:auto; }

.dot-textarea{
  height: var(--pane-h);
  resize: vertical;
  font-family: "Courier New", monospace;
  font-size: 12px;
  border: var(--border);
  border-radius: 4px;
  padding: 10px;
}

.output-section h2{ margin:0 0 8px; font-size:18px; }

/* Responsive */
@media (max-width: 900px){
  .grid{ grid-template-columns: 1fr; }
  :root{ --pane-h: 360px; }
}
