/* ============================================
   KubeBlocks Enterprise - Liquid Glass Design System
   ============================================ */

:root {
  /* Background Colors */
  --bg-primary: #F5F5F7;
  --bg-secondary: #FFFFFF;
  --bg-sidebar: rgba(255, 255, 255, 0.72);
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-hover: rgba(255, 255, 255, 0.85);
  --bg-glass-strong: rgba(255, 255, 255, 0.92);
  
  /* Text Colors */
  --text-primary: #1D1D1F;
  --text-secondary: #86868B;
  --text-tertiary: #A1A1A6;
  --text-inverse: #FFFFFF;
  
  /* Accent Colors */
  --accent-blue: #0071E3;
  --accent-blue-hover: #0077ED;
  --accent-green: #34C759;
  --accent-orange: #FF9500;
  --accent-red: #FF3B30;
  --accent-purple: #AF52DE;
  
  /* Glass Border */
  --border-glass: rgba(255, 255, 255, 0.5);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.5) inset, 0 4px 20px rgba(0, 113, 227, 0.08);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --sidebar-width: 240px;
  --header-height: 56px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Liquid Glass Card
   ============================================ */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: var(--bg-glass-hover);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  transform: translateY(-1px);
}

.glass-card-strong {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
}

/* ============================================
   Glass Button
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: var(--accent-blue);
  color: var(--text-inverse);
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Status Tags
   ============================================ */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.status-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-running {
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.1);
}

.status-stopped {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
}

.status-failed {
  color: var(--accent-red);
  background: rgba(255, 59, 48, 0.1);
}

.status-warning {
  color: var(--accent-orange);
  background: rgba(255, 149, 0, 0.1);
}

/* ============================================
   Glass Input
   ============================================ */
.glass-input {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.glass-input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 113, 227, 0.3);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.glass-input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   Glass Table
   ============================================ */
.glass-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.glass-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-subtle);
}

.glass-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.glass-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.5);
}

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

/* ============================================
   Layout
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--border-subtle);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  padding: 16px 0;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.page-content {
  padding: 24px;
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.sidebar-logo {
  padding: 0 20px 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 0 8px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-blue);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-sub {
  padding-left: 42px;
  font-size: 12px;
}

.nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 16px;
}

/* ============================================
   Stats Card
   ============================================ */
.stat-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.blue::before { background: linear-gradient(90deg, var(--accent-blue), #5AC8FA); }
.stat-card.green::before { background: linear-gradient(90deg, var(--accent-green), #30D158); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--accent-orange), #FFCC00); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--accent-purple), #BF5AF2); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  line-height: 1.2;
}

.stat-change {
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }

/* ============================================
   Chart Placeholder
   ============================================ */
.chart-placeholder {
  height: 60px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.chart-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
}

/* ============================================
   Cluster Type Card
   ============================================ */
.cluster-type-card {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.cluster-type-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.cluster-type-info {
  flex: 1;
  min-width: 0;
}

.cluster-type-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.cluster-type-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.cluster-type-status {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.15s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-5 { animation-delay: 0.25s; opacity: 0; }
.animate-delay-6 { animation-delay: 0.3s; opacity: 0; }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--accent-red);
  margin-left: 2px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.form-alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.2);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   Tabs
   ============================================ */
.glass-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-md);
  width: fit-content;
}

.glass-tab {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--transition-fast);
}

.glass-tab:hover {
  color: var(--text-primary);
}

.glass-tab.active {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   Topology
   ============================================ */
.topology-container {
  background: linear-gradient(135deg, rgba(245, 245, 247, 0.8), rgba(255, 255, 255, 0.6));
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 200px;
  position: relative;
}

.topology-node {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  position: absolute;
  transition: all var(--transition-base);
}

.topology-node:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.topology-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, var(--border-subtle), var(--accent-blue), var(--border-subtle));
  opacity: 0.5;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-blue);
}

.breadcrumb-separator {
  color: var(--text-tertiary);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   Page Title Section
   ============================================ */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================
   Grid Layouts
   ============================================ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
