/* =============================================
   ZES Design System — Components
   ============================================= */
@import url('design-tokens.css');

/* ============================================
   Hero Section
   ============================================ */
.hero {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, var(--color-primary-light) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  margin-bottom: var(--space-4);
  position: relative;
}
.hero p {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-6);
  position: relative;
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.stat-card {
  text-align: center;
  padding: var(--space-5);
}
.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}
.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

/* ============================================
   Service List
   ============================================ */
.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--glass-border);
}
.service-item:last-child { border-bottom: none; }
.service-info { display: flex; align-items: center; gap: var(--space-3); }
.service-name { font-weight: 500; }
.service-port { font-size: var(--text-xs); color: var(--color-text-muted); font-family: var(--font-mono); }

/* ============================================
   Badge / Tag
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  border: 1px solid var(--glass-border);
}
.badge.primary { background: var(--color-primary-light); color: var(--color-primary); border-color: transparent; }
.badge.success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge.danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }

/* ============================================
   Toolbar / Action Bar
   ============================================ */
.toolbar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.toolbar-spacer { flex: 1; }

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: var(--space-4); opacity: 0.5; }
.empty-state h3 { font-size: var(--text-lg); margin-bottom: var(--space-2); color: var(--color-text-secondary); }

/* ============================================
   Code Block
   ============================================ */
.code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ============================================
   Modal / Overlay
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--glass-shadow);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}
.modal-title { font-size: var(--text-lg); font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: var(--text-xl);
  padding: var(--space-1);
}
.modal-close:hover { color: var(--color-text); }

/* ============================================
   Toast / Notification
   ============================================ */
.toast {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--glass-shadow);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   Spinner
   ============================================ */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Glow Effects
   ============================================ */
.glow { box-shadow: 0 0 20px var(--color-primary-light); }
.glow-success { box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
.glow-danger { box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }

/* ============================================
   Responsive Table
   ============================================ */
.glass-table {
  width: 100%;
  border-collapse: collapse;
}
.glass-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}
.glass-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  font-size: var(--text-sm);
}
.glass-table tr:hover td { background: var(--color-primary-light); }

/* ============================================
   Mobile overrides for table
   ============================================ */
@media (max-width: 768px) {
  .glass-table thead { display: none; }
  .glass-table tr {
    display: block;
    padding: var(--space-3);
    border-bottom: 1px solid var(--glass-border);
  }
  .glass-table td {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border: none;
  }
  .glass-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
  }
}

/* ============================================
   Glowing Brand Button — ZES.CODES identity
   ============================================ */
.glow-wrap {
  position: relative;
  padding: 3px;
  background: linear-gradient(90deg, #03a9f4, #f441a5);
  border-radius: 0.9em;
  display: inline-block;
  transition: all 0.4s ease;
}
.glow-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 0.9em;
  z-index: -10;
  filter: blur(0);
  transition: filter 0.4s ease;
}
.glow-wrap:hover::before {
  background: linear-gradient(90deg, #03a9f4, #f441a5);
  filter: blur(1.2em);
}
.glow-wrap:active::before {
  filter: blur(0.2em);
}
.glow-btn {
  font-size: 1.4em;
  padding: 0.6em 0.8em;
  border-radius: 0.5em;
  border: none;
  background-color: #000;
  color: #fff;
  cursor: pointer;
  box-shadow: 2px 2px 3px #000000b4;
  display: block;
  font-weight: 800;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Brand header logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo .glow-small {
  padding: 1.5px;
  border-radius: 0.5em;
  display: inline-block;
  background: linear-gradient(90deg, #03a9f4, #f441a5);
}
.brand-logo .glow-small button {
  font-size: 0.85em;
  padding: 0.2em 0.4em;
  border-radius: 0.3em;
  border: none;
  background: #000;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 2px 2px 3px #000000b4;
  display: block;
}
