@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Space+Mono:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #09111B;
  --surface: #0F1117;
  --surface-light: #161A23;
  --border: #1E2433;
  --primary: #4ADE80;
  --secondary: #60A5FA;
  --accent: #F59E0B;
  --error: #FB7185;
  --text: #F8FAFC;
  --text-dim: #94A3B8;
  --text-muted: #64748B;
  --glass: rgba(15, 17, 23, 0.75);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.15);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'Space Mono', monospace;
}

/* Layout */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  min-height: 44px;
}

.nav-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.login-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 1rem;
  width: 280px;
  background-color: #0B1522;
  border: 1px solid #223248;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--primary);
}

.btn {
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: none;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  min-height: 44px;
}

.btn-primary {
  background: var(--primary);
  color: #03120a;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
  background: #5ee994;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--secondary);
  background: rgba(96, 165, 250, 0.05);
}

/* Hero Section */
.hero {
  padding: 7rem 2rem 5rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.8rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 2.5rem;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

/* Features Table */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.2rem;
  border-radius: 16px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.5);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(96, 165, 250, 0.1);
  color: var(--secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
  color: var(--text);
  font-weight: 600;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Playground Styles (Adapted from OR-Flow) */
.playground-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.metrics-bar {
  display: flex;
  gap: 1.5rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  min-width: 180px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--primary);
}

.metric-value.warning { color: var(--accent); }
.metric-value.danger { color: var(--error); }

.or-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.or-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.or-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(94, 165, 250, 0.3);
}

.or-card.delayed { border-color: var(--error); }
.or-card.delayed::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--error);
}

.or-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.or-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-scheduled { background: rgba(148, 163, 184, 0.1); color: #94a3b8; }
.status-progress { background: rgba(96, 165, 250, 0.1); color: #60a5fa; }
.status-delayed { background: rgba(251, 113, 133, 0.1); color: #fb7185; }
.status-complete { background: rgba(74, 222, 128, 0.1); color: #4ade80; }

.or-time {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.delay-badge {
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 600;
}

.controls {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.control-group {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface-light);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: var(--surface);
  border-color: var(--secondary);
}

/* Forms & Inputs */
input, select, textarea {
  font-family: inherit;
  transition: all 0.2s ease-in-out;
  min-height: 44px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--secondary) !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15) !important;
}

select {
  cursor: pointer;
}

/* Hides public navbar wrapper on mobile when inside authenticated playground views */
.public-nav-desktop-only { display: block; }

/* Footer */
.footer {
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  body {
    font-size: 16px; /* Ensure mobile readability */
  }

  /* Hamburger Menu Support */
  .navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap; /* Re-flow menu logic */
  }

  .nav-brand-container {
    width: 100%;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links, .nav-actions {
    display: none;
  }

  /* When menu is toggled open */
  .navbar.menu-open {
    height: 100vh;
    align-items: flex-start;
    flex-direction: column;
    background: var(--bg);
    overflow-y: auto;
  }

  .navbar.menu-open .nav-links,
  .navbar.menu-open .nav-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 1.5rem;
    gap: 1rem;
    align-items: flex-start;
  }

  .navbar.menu-open .nav-actions {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
  }
  
  .login-dropdown {
    position: static;
    width: 100%;
    margin-top: 1rem;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
  }

  /* Touch targets and Layout Refinements */
  .hero { 
    padding: 5rem 1rem 3rem; 
  }
  .hero h1 { font-size: 2.3rem; }
  .hero p { font-size: 1.05rem; }
  
  .features-grid { 
    grid-template-columns: 1fr; 
    gap: 1.5rem; 
    padding: 2rem 1rem; 
  }
  .feature-card { padding: 1.8rem; }
  
  .metric-card { min-width: 100%; margin-bottom: 1rem; }
  .metrics-bar { flex-direction: column; gap: 0; width: 100%; }
  
  .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
  .hero-actions { flex-direction: column; width: 100%; gap: 1rem; }

  input, select, textarea { width: 100%; display: block; }

  /* Hide public navbar on mobile when inside authenticated playground views */
  .public-nav-desktop-only { display: none; }

  /* Ensure consistent vertical spacing and no overlap */
  section { padding-block: 2.5rem; }
}
