/**
 * app.css: Custom Design System layered on Pico.css @2.0.6
 */

:root {
  --primary-color: #6366f1; /* Modern Indigo */
  --primary-hover: #4f46e5;
  --bg-color: #f8fafc;
  --matrix-bg: #ffffff;
  --accent-color: #10b981; /* Success Green */
  --highlight-color: rgba(99, 102, 241, 0.1);
  --border-radius: 8px;
}

[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg-color: #0f172a;
  --matrix-bg: #1e293b;
  --primary-color: #818cf8;
  --highlight-color: rgba(129, 140, 248, 0.1);
}

body {
  background-color: var(--bg-color);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  transition: background-color 0.3s ease;
}

header nav {
  margin-bottom: 2rem;
}

/* Premium Matrix Table Density Overrides */
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--muted-border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  font-size: 0.875rem; /* UI-08 refinement */
}

.matrix-table th, 
.matrix-table td {
  padding: 0.5rem 0.75rem; /* Tight density */
  text-align: center;
  border-bottom: 1px solid var(--muted-border-color);
  border-right: 1px solid var(--muted-border-color);
  background: var(--matrix-bg);
}

.matrix-table th:last-child, 
.matrix-table td:last-child {
  border-right: none;
}

/* Sticky Headers & Columns for Mobile/Large Grids */
.matrix-table th:first-child, 
.matrix-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--matrix-bg);
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 11;
    background: var(--matrix-bg);
}

.matrix-table thead th:first-child {
    z-index: 12;
}

/* Premium Optimal Badge */
.optimal-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.optimal-column {
    background: var(--highlight-color) !important;
}

/* Success View Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utility: Copy Button Feedback */
.copied {
  background-color: var(--accent-color) !important;
  border-color: var(--accent-color) !important;
  transition: all 0.2s ease;
}

/* Slot Management UX */
#slots-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.slot-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slot-row input {
  margin-bottom: 0;
}

.slot-row button {
  width: auto;
  margin-bottom: 0;
  padding: 0.5rem 1rem;
}

/* Aria-Invalid styling (Pico provides this, but we'll ensure consistency) */
[aria-invalid="true"] {
  border-color: #ef4444 !important;
}

/* Admin/Edit Link Warning Callout */
.warning-callout {
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    background: var(--highlight-color);
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}
