/* WellOpsTree Engineering Suite — Portal Stylesheet */
:root {
  --bg-main: #090d16;
  --bg-card: #0f172a;
  --bg-card-hover: #131d36;
  --border: #1e293b;
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  --track-primary: #0284c7;
  --track-accent: #38bdf8;
  --ledger-primary: #d97706;
  --ledger-accent: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Background grid & subtle lights */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.bg-glow-1 {
  top: -150px;
  left: 10%;
  background: var(--track-accent);
}

.bg-glow-2 {
  bottom: -150px;
  right: 10%;
  background: var(--ledger-accent);
}

/* Suite Wrapper */
.suite-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 48px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--track-primary), #0369a1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-status-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  position: relative;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.ping::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--success);
  opacity: 0.7;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.status-name {
  color: var(--text-dim);
  font-weight: 500;
}

.status-val {
  color: #ffffff;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 52px;
}

.badge-suite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--track-accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--track-accent);
  box-shadow: 0 0 8px var(--track-accent);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: #334155;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.accent-track {
  background: linear-gradient(90deg, var(--track-primary), var(--track-accent));
}

.accent-ledger {
  background: linear-gradient(90deg, var(--ledger-primary), var(--ledger-accent));
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.card-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.box-track {
  background: rgba(2, 132, 199, 0.15);
  color: var(--track-accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.box-ledger {
  background: rgba(217, 119, 6, 0.15);
  color: var(--ledger-accent);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.card-icon-box svg {
  width: 28px;
  height: 28px;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.card-endpoint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.card-name {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.card-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.badge-track {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-ledger {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.55;
  margin-bottom: 22px;
  flex: 1;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}

.feature-tag {
  background: #090d16;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #cbd5e1;
}

.card-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  flex: 2;
  color: #ffffff;
}

.btn-track {
  background: #0284c7;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.btn-track:hover {
  background: #0369a1;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45);
}

.btn-ledger {
  background: #d97706;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}

.btn-ledger:hover {
  background: #b45309;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
}

.btn-secondary {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
}

.btn-secondary:hover {
  background: #334155;
  color: #ffffff;
}

.card-keyboard-hint {
  margin-top: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  font-family: var(--font-mono);
}

kbd {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.68rem;
  color: #cbd5e1;
}

/* Bottom Footer */
.bottom-footer {
  margin-top: auto;
  padding: 24px 0 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-sep {
  color: #334155;
}

.tls-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
  font-family: var(--font-mono);
}

/* Embedded Workspace Overlay */
.workspace-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.workspace-header {
  height: 48px;
  background: #0f172a;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
}

.workspace-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.workspace-tabs {
  display: flex;
  gap: 4px;
}

.ws-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ws-tab:hover {
  background: #1e293b;
  color: #ffffff;
}

.ws-tab.active {
  background: #1e293b;
  border-color: #334155;
  color: #38bdf8;
}

.workspace-controls {
  display: flex;
  gap: 8px;
}

.ws-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ws-btn:hover {
  background: #334155;
  color: #ffffff;
}

.ws-btn-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.workspace-frame-container {
  flex: 1;
  width: 100%;
  height: calc(100vh - 48px);
}

.workspace-frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Responsive */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .nav-status-group {
    width: 100%;
    justify-content: space-between;
  }
  .hero-title {
    font-size: 2rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .bottom-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
