/* ==========================================================================
   🎨 BALLOM Console Stylesheet
   Theme: Electric violet, rose pink, glassmorphism, hyper-premium dashboard
   ========================================================================== */

:root {
  /* Colors */
  --bg-dark: #080c14;
  --bg-card: rgba(14, 21, 33, 0.5);
  --bg-card-hover: rgba(22, 32, 49, 0.65);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(180, 213, 231, 0.4);
  
  --primary: #b4d5e7;      /* Ice Blue Logo Color */
  --primary-glow: rgba(180, 213, 231, 0.25);
  --secondary: #88b0cc;    /* Soft Slate Blue */
  
  --accent-emerald: #10b981;
  --accent-blue: #b4d5e7;
  --accent-amber: #eab308;
  --accent-indigo: #6366f1;
  --accent-rose: #f43f5e;
  
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  /* Fonts */
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Blurs & Shadows */
  --blur: 24px;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px 0 rgba(180, 213, 231, 0.15);
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* BACKGROUND GLOWS */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.28;
  pointer-events: none;
}

.bg-glow-1 {
  width: 450px;
  height: 450px;
  background-color: var(--primary);
  top: -10%;
  left: -5%;
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  background-color: var(--secondary);
  bottom: 5%;
  right: -5%;
}

.bg-glow-3 {
  width: 350px;
  height: 350px;
  background-color: var(--primary);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
}

/* APP LAYOUT */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: rgba(8, 12, 20, 0.75);
  backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.brand-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #fff 10%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  opacity: 0.85;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  background: var(--primary-glow);
  border-color: rgba(180, 213, 231, 0.3);
  box-shadow: 0 4px 15px rgba(180, 213, 231, 0.12);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 4px;
  background-color: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  font-size: 18px;
}

.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-purple { background: rgba(180, 213, 231, 0.15); color: #b4d5e7; border: 1px solid rgba(180, 213, 231, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: auto;
}

.version {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}

.credits {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* MAIN WORKSPACE */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents overflow inside flex child */
  background: rgba(0, 0, 0, 0.15);
}

/* TOP BAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(var(--blur));
  background: rgba(8, 12, 20, 0.5);
  z-index: 9;
}

.workspace-title h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.repo-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 12px;
}

.selector-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

#storage-repo-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  width: 130px;
}

.token-input-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  padding: 2px;
}

.token-input-group input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 12px;
  width: 200px;
}

.token-input-group input::placeholder {
  font-family: var(--font-sans);
}

/* BUTTONS */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #080c14;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-emerald {
  background: var(--accent-emerald);
  color: #fff;
}

.btn-emerald:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-blue {
  background: var(--accent-blue);
  color: #fff;
}

.btn-blue:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-amber {
  background: var(--accent-amber);
  color: #000;
}

.btn-amber:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-indigo {
  background: var(--accent-indigo);
  color: #fff;
}

.btn-indigo:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-rose {
  background: var(--accent-rose);
  color: #fff;
}

.btn-rose:hover { opacity: 0.9; transform: translateY(-1px); }

/* Force Black Text on Create Buttons for high contrast & readability */
.btn-create-black {
  color: #000000 !important;
  font-weight: 700 !important;
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
}

.btn-icon:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* CONTENT BODY */
.content-body {
  padding: 40px;
  flex: 1;
  position: relative;
  min-height: 0;
  overflow-y: auto;
}

/* CARDS */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(180, 213, 231, 0.25);
  box-shadow: 0 8px 32px 0 rgba(180, 213, 231, 0.05);
  background: var(--bg-card-hover);
}

.card-header {
  margin-bottom: 20px;
}

.card-header h3 {
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.icon-purple  { background: rgba(168, 85, 247, 0.12); color: var(--primary); border: 1px solid rgba(168, 85, 247, 0.2); }
.icon-emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.icon-blue    { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.2); }
.icon-amber   { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.icon-indigo  { background: rgba(99, 102, 241, 0.12); color: var(--accent-indigo); border: 1px solid rgba(99, 102, 241, 0.2); }
.icon-rose    { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.2); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(180, 213, 231, 0.35);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* SECTION HEADERS & LAYOUTS */
.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }

/* QUICK ACTIONS */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-actions-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.btn-action-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action-card:hover {
  background: rgba(180, 213, 231, 0.05);
  border-color: rgba(180, 213, 231, 0.3);
  box-shadow: 0 0 15px rgba(180, 213, 231, 0.1);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.action-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.action-text p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* HEALTH / METADATA LIST */
.health-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.health-item:last-child {
  border-bottom: none;
}

.health-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.health-value {
  font-size: 13px;
  font-weight: 600;
}

.text-purple { color: #c084fc; }
.text-emerald { color: #34d399; }

/* DATA TABLES */
.table-container {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 880px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.data-table th:last-child, .data-table td:last-child {
  text-align: right;
  padding-right: 28px;
  white-space: nowrap;
  min-width: 200px;
}

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

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* EMPTY STATES */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  border-radius: 20px;
  max-width: 600px;
  margin: 40px auto;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.2));
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* MODALS */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  width: 100%;
  max-width: 550px;
  background: rgba(14, 10, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 30px;
  max-height: 90vh;
  overflow-y: auto;
}

.max-w-lg { max-width: 600px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.close-btn:hover { color: #fff; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* FORMS */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

input, select, textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

select option {
  background-color: #0d131f !important;
  color: #f3f4f6 !important;
  padding: 8px 12px;
}

select option:hover, select option:focus, select option:checked {
  background-color: #182335 !important;
  color: var(--primary) !important;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  background: rgba(255, 255, 255, 0.05);
}

textarea {
  resize: vertical;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.01);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
  cursor: pointer;
}

/* PHANTOM CARDS */
.phantom-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: 20px;
}

.phantom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.phantom-title-group h4 {
  font-size: 16px;
  font-weight: 700;
}

.phantom-domain {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
}

.phantom-details {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  flex: 1;
}

.phantom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
}

.status-dot-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.active { background-color: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.status-dot.inactive { background-color: var(--accent-rose); }

/* TOASTS */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.toast {
  background: rgba(14, 10, 30, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transform: translateX(100%);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--accent-blue); }

@keyframes slideIn {
  to { transform: translateX(0); }
}

/* API KEY DISPLAY BOX */
.key-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.warning-alert {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #fda4af;
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}

/* OVERLAYS & LOADING */
.loading-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(7, 4, 15, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 50;
  border-radius: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(180, 213, 231, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* BRAND LOGO IMAGE styling */
.brand-logo-img {
  height: 38px;
  width: auto;
  border-radius: 8px;
  filter: drop-shadow(0 0 10px rgba(180, 213, 231, 0.35));
}

/* HORIZONTAL QUICK ACTIONS GRID */
.quick-actions-horizontal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .quick-actions-horizontal {
    grid-template-columns: 1fr;
  }
}

/* HELPERS */
.hidden { display: none !important; }
.font-mono { font-family: var(--font-mono) !important; }
.font-sm { font-size: 12px; }
.text-left { text-align: left; }
.mb-4 { margin-bottom: 16px; }
.rounded { border-radius: 10px; }
.p-4 { padding: 16px; }
.bg-black-05 { background: rgba(0, 0, 0, 0.25); }
.dns-guidelines {
  padding-left: 20px;
  margin-top: 10px;
}
.dns-guidelines li {
  margin-bottom: 8px;
  line-height: 1.5;
}
