/* ============================================================
   Gray Rock Design System — Gray Rock Mock Data Generator
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --sf-navy:         #353946;
  --sf-blue:         #235476;
  --sf-blue-light:   #617ea3;
  --sf-blue-cloud:   #dce8f2;
  --sf-teal:         #344558;
  --sf-teal-dark:    #2b3847;
  --sf-purple:       #617ea3;
  --sf-purple-dark:  #4d6585;
  --sf-orange:       #afc5de;
  --sf-success:      #2E844A;
  --sf-error:        #EA001E;
  --sf-neutral-10:   #f5f5f5;
  --sf-neutral-20:   #afc5de;
  --sf-neutral-60:   #617ea3;
  --sf-neutral-90:   #383a44;
  --sf-shadow:       0 4px 20px rgba(53, 57, 70, 0.10);
  --sf-shadow-hover: 0 8px 28px rgba(53, 57, 70, 0.20);
  --sf-radius:       14px;
  --sf-radius-sm:    8px;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Inter Tight', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--sf-neutral-10);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--sf-neutral-90);
}

body > .container-fluid { flex: 1; }
footer { margin-top: auto; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sf-neutral-10); }
::-webkit-scrollbar-thumb { background: var(--sf-neutral-20); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sf-blue-light); }

/* ── Navbar ── */
.navbar-cosmos {
  background: var(--sf-navy);
  box-shadow: 0 2px 12px rgba(53, 57, 70, 0.25);
  min-height: 60px;
  padding: 0 1.5rem;
}

.navbar-cosmos .navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-cosmos .nav-link-cosmos {
  color: rgba(255,255,255,0.88) !important;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
}

.navbar-cosmos .nav-link-cosmos:hover {
  color: white !important;
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
}

.navbar-cosmos .btn-navbar-logout {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.55);
  color: white;
  background: transparent;
  transition: all 0.18s ease;
}

.navbar-cosmos .btn-navbar-logout:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
  color: white;
}

.avatar-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sf-blue-cloud);
  color: var(--sf-blue);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* ── Page Hero Header ── */
.sf-page-header {
  background: linear-gradient(135deg, var(--sf-navy) 0%, var(--sf-blue) 100%);
  color: white;
  padding: 2rem 2rem 1.75rem;
  border-radius: var(--sf-radius);
  margin-bottom: 1.75rem;
  box-shadow: var(--sf-shadow);
}

.sf-page-header h1,
.sf-page-header h2,
.sf-page-header h3 {
  color: white;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.sf-page-header .sf-header-subtitle {
  color: rgba(255,255,255,0.78);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.sf-page-header .sf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Cards ── */
.card {
  border-radius: var(--sf-radius);
  border: 1px solid var(--sf-neutral-20);
  box-shadow: var(--sf-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.card:hover { box-shadow: var(--sf-shadow-hover); }

.card-header {
  border-bottom: 1px solid var(--sf-neutral-20);
  background: white;
  font-weight: 600;
  padding: 0.875rem 1.25rem;
}

.card-body { padding: 1.25rem; }

/* Card accent top-border variants */
.sf-card-accent-blue  { border-top: 4px solid var(--sf-blue);   }
.sf-card-accent-teal  { border-top: 4px solid var(--sf-teal);   }
.sf-card-accent-purple{ border-top: 4px solid var(--sf-purple); }
.sf-card-accent-orange{ border-top: 4px solid var(--sf-orange); }

/* Lift animation for gallery-style cards */
.card-lift { cursor: pointer; }
.card-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--sf-shadow-hover);
}

/* ── Buttons ── */
.btn {
  border-radius: var(--sf-radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
  transition: all 0.18s ease;
  border-width: 1.5px;
}

.btn-primary {
  background: var(--sf-blue);
  border-color: var(--sf-blue);
  color: white;
}
.btn-primary:hover {
  background: var(--sf-teal);
  border-color: var(--sf-teal);
  box-shadow: 0 4px 12px rgba(35, 84, 118, 0.35);
}

.btn-success {
  background: var(--sf-teal);
  border-color: var(--sf-teal);
  color: white;
}
.btn-success:hover {
  background: var(--sf-teal-dark);
  border-color: var(--sf-teal-dark);
  box-shadow: 0 4px 12px rgba(6, 165, 154, 0.35);
}

.btn-outline-primary {
  color: var(--sf-blue);
  border-color: var(--sf-blue);
}
.btn-outline-primary:hover {
  background: var(--sf-blue);
  border-color: var(--sf-blue);
  color: white;
}

.btn-outline-secondary {
  color: var(--sf-neutral-60);
  border-color: var(--sf-neutral-20);
}
.btn-outline-secondary:hover {
  background: var(--sf-neutral-10);
  border-color: var(--sf-neutral-60);
  color: var(--sf-neutral-90);
}

.btn-outline-danger {
  color: var(--sf-error);
  border-color: var(--sf-error);
}
.btn-outline-danger:hover {
  background: var(--sf-error);
  border-color: var(--sf-error);
  color: white;
}

.btn-danger {
  background: var(--sf-error);
  border-color: var(--sf-error);
  color: white;
}

/* Teal CTA button */
.btn-teal {
  background: var(--sf-teal);
  border-color: var(--sf-teal);
  color: white;
}
.btn-teal:hover {
  background: var(--sf-teal-dark);
  border-color: var(--sf-teal-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(6, 165, 154, 0.35);
}

/* Purple button */
.btn-purple {
  background: var(--sf-purple);
  border-color: var(--sf-purple);
  color: white;
}
.btn-purple:hover {
  background: var(--sf-purple-dark);
  border-color: var(--sf-purple-dark);
  color: white;
}

/* ── Scale toggle pill buttons ── */
.scale-toggle { display: flex; gap: 0.5rem; }

.scale-toggle .scale-btn {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--sf-neutral-20);
  background: white;
  color: var(--sf-neutral-60);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scale-toggle .scale-btn:hover {
  border-color: var(--sf-blue-light);
  color: var(--sf-blue);
}

.scale-toggle .scale-btn.active {
  background: var(--sf-blue);
  border-color: var(--sf-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(1, 118, 211, 0.3);
}

/* ── Badges ── */
.badge {
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.3em 0.7em;
}

.badge-cosmos-blue   { background: var(--sf-blue-cloud); color: var(--sf-blue); }
.badge-cosmos-teal   { background: #d0f5f3; color: var(--sf-teal-dark); }
.badge-cosmos-purple { background: #ede0ff; color: var(--sf-purple); }
.badge-cosmos-orange { background: #ffe5db; color: #c04a1c; }
.badge-cosmos-success{ background: #d4edda; color: var(--sf-success); }
.badge-cosmos-error  { background: #fde8eb; color: var(--sf-error); }

/* Job status badges */
.badge-queued  { background: #ede0ff; color: var(--sf-purple); }
.badge-running { background: var(--sf-blue-cloud); color: var(--sf-blue); }
.badge-done    { background: #d0f5f3; color: var(--sf-teal-dark); }
.badge-failed  { background: #fde8eb; color: var(--sf-error); }

/* ── Forms ── */
.form-control, .form-select {
  border-radius: var(--sf-radius-sm);
  border: 1.5px solid var(--sf-neutral-20);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  background: white;
}

.form-control:focus, .form-select:focus {
  border-color: var(--sf-blue-light);
  box-shadow: 0 0 0 3px rgba(27, 150, 255, 0.18);
  outline: none;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--sf-neutral-90);
  margin-bottom: 0.35rem;
}

.form-text { color: var(--sf-neutral-60); font-size: 0.8rem; }

/* ── Tables ── */
.table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.table thead th {
  background: var(--sf-blue-cloud);
  color: var(--sf-navy);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--sf-neutral-20);
  border-top: none;
}

.table tbody tr {
  background: white;
  transition: background 0.12s ease;
}

.table tbody tr:hover { background: #f0f7ff; }

.table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sf-neutral-20);
  vertical-align: middle;
  border-top: none;
}

.table tbody tr:last-child td { border-bottom: none; }

/* ── Modals ── */
.modal-content {
  border-radius: var(--sf-radius);
  border: none;
  box-shadow: 0 20px 60px rgba(3, 45, 96, 0.25);
  overflow: hidden;
}

.modal-header {
  background: var(--sf-navy);
  color: white;
  border-bottom: none;
  padding: 1.25rem 1.5rem;
}

.modal-header .modal-title { color: white; font-weight: 700; }

.modal-header .btn-close {
  filter: invert(1) brightness(2);
  opacity: 0.8;
}
.modal-header .btn-close:hover { opacity: 1; }

.modal-body { padding: 1.5rem; }
.modal-footer {
  border-top: 1px solid var(--sf-neutral-20);
  padding: 1rem 1.5rem;
}

/* ── Alerts ── */
.alert {
  border-radius: var(--sf-radius-sm);
  border-left-width: 4px;
  font-size: 0.9rem;
}

.alert-success { border-left-color: var(--sf-teal); }
.alert-danger   { border-left-color: var(--sf-error); }
.alert-warning  { border-left-color: var(--sf-orange); }
.alert-info     { border-left-color: var(--sf-blue); }

/* ── List Groups ── */
.list-group-item {
  border-color: var(--sf-neutral-20);
  font-size: 0.9rem;
}

.list-group-item:first-child { border-radius: var(--sf-radius-sm) var(--sf-radius-sm) 0 0; }
.list-group-item:last-child  { border-radius: 0 0 var(--sf-radius-sm) var(--sf-radius-sm); }

/* ── Accordion (Faker suggestions) ── */
.accordion-button {
  font-size: 0.85rem;
  font-weight: 500;
  background: white;
  color: var(--sf-neutral-90);
}

.accordion-button:not(.collapsed) {
  background: var(--sf-blue-cloud);
  color: var(--sf-navy);
  box-shadow: none;
}

.accordion-button:focus { box-shadow: 0 0 0 3px rgba(27, 150, 255, 0.18); }

#fakerSuggestions .list-group-item {
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.1s ease;
}

#fakerSuggestions .list-group-item:hover {
  background: var(--sf-blue-cloud);
  color: var(--sf-navy);
}

/* ── Object tree depth colors ── */
.object-depth-0 { border-left: 4px solid var(--sf-blue);   }
.object-depth-1 { border-left: 4px solid var(--sf-teal);   }
.object-depth-2 { border-left: 4px solid var(--sf-purple); }
.object-depth-3 { border-left: 4px solid var(--sf-blue-light); }

/* ── Codey empty state ── */
.codey-empty {
  text-align: center;
  padding: 3rem 1.5rem;
}

.codey-empty img {
  width: 120px;
  height: auto;
  margin-bottom: 1.25rem;
  filter: drop-shadow(0 4px 12px rgba(3,45,96,0.15));
}

.codey-empty .codey-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--sf-navy);
  margin-bottom: 0.5rem;
}

.codey-empty .codey-subtitle {
  color: var(--sf-neutral-60);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Codey in generate modal */
.codey-modal-bear {
  width: 90px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(3,45,96,0.15));
}

/* ── Footer ── */
.footer-cosmos {
  background: rgba(53,57,70,0.04);
  border-top: 1px solid var(--sf-neutral-20);
  padding: 0.875rem 1.5rem;
  font-size: 0.82rem;
  color: var(--sf-neutral-60);
}

.footer-cosmos a {
  color: var(--sf-neutral-60);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-cosmos a:hover { color: var(--sf-blue); }

/* ── Auth split-panel layout ── */
.auth-page {
  min-height: 100vh;
  display: flex;
}

.auth-panel-left {
  background: var(--sf-navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-panel-left .auth-logo {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-panel-left h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: white;
}

.auth-panel-left p {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  max-width: 320px;
}

.auth-cloud-bg {
  position: absolute;
  bottom: -60px;
  right: -80px;
  opacity: 0.07;
  font-size: 22rem;
  line-height: 1;
  color: white;
}

.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card .card {
  border: none;
  box-shadow: none;
}

/* ── Monospace utility ── */
.font-monospace {
  font-family: 'Roboto Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.85em;
}

/* ── Spinner animation ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }

/* ── Responsive ── */
@media (max-width: 767px) {
  .auth-page { flex-direction: column; }
  .auth-panel-left { padding: 2rem 1.5rem; min-height: 220px; }
  .auth-cloud-bg { font-size: 12rem; }
  .sf-page-header { padding: 1.5rem; border-radius: var(--sf-radius-sm); }
}
