@import "./theme.css";

/* Reset and Layout Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* 32px graph-paper grid wallpaper using CSS variables */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

/* Typography Helpers */
.font-mono {
  font-family: var(--font-mono);
}

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.text-center { text-align: center; }
.text-left { text-align: left; }

.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

/* Layout Grid and Utilities */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pt-6 { padding-top: 1.5rem; }

/* Dashboard Card Components */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  position: relative;
}

.border-glow {
  transition: all 0.3s ease;
}
.border-glow:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--color-text);
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
}

.btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--color-text-muted);
}

.btn-danger {
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-danger:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background-color: rgba(239, 68, 68, 0.05);
  color: var(--color-danger);
}

.glow-btn {
  background: linear-gradient(135deg, var(--accent), var(--action));
  border: none;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px var(--accent-muted);
  font-family: var(--font-mono);
}
.glow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--accent-muted);
}

/* Inputs */
.input-field {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  padding: 0.75rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-muted);
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding-bottom: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Header & Navigation */
.header {
  border-bottom: 1px solid var(--border-primary);
  background-color: var(--bg-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 72rem;
  margin: 0 auto;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius-card);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-warning {
  background-color: var(--color-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.alert-danger {
  background-color: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

/* Custom background animations */
.glow-accent-left {
  position: absolute;
  top: -6rem;
  left: -6rem;
  width: 12rem;
  height: 12rem;
  background-color: var(--accent-muted);
  border-radius: 9999px;
  filter: blur(40px);
  pointer-events: none;
}

.glow-accent-right {
  position: absolute;
  bottom: -6rem;
  right: -6rem;
  width: 12rem;
  height: 12rem;
  background-color: var(--error-muted);
  border-radius: 9999px;
  filter: blur(40px);
  pointer-events: none;
}

.sidebar-brand {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Sidebar Layout styles */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-button);
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  padding-left: 1.25rem;
}

.sidebar-link.active {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 15px var(--accent-muted);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.625rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Top bar style */
.topbar {
  height: 4rem;
  background-color: var(--bg-elevated);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Catalog Grid cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.catalog-card {
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.catalog-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 12px var(--accent-muted);
}

/* Badge types */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-family: var(--font-mono);
  font-weight: bold;
}

.badge-success { background-color: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background-color: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background-color: var(--color-danger-bg); color: var(--color-danger); }
.badge-info { background-color: var(--info-muted); color: var(--info); }

/* Category filter chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: var(--color-text-muted);
}
.chip:hover {
  opacity: 0.85;
  filter: brightness(1.1);
}
.chip-active {
  background-color: var(--accent);
  color: var(--text-white);
}

/* Code box */
.code-box {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-card);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--success);
}

/* Console Log ticker */
.console-ticker {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-card);
  padding: 1rem;
  height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--success);
}

/* Additional utility classes */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.m-0 { margin: 0; }
.max-w-6xl { max-width: 72rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.inline { display: inline; }

/* Scrollbar styling for tables */
.table-container::-webkit-scrollbar { width: 6px; height: 6px; }
.table-container::-webkit-scrollbar-track { background: var(--color-surface); }
.table-container::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
.table-container::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* Font-size utility classes */
.fs-9 { font-size: 9px; }
.fs-10 { font-size: 10px; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-0_9rem { font-size: 0.9rem; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.sticky { position: sticky; }

/* Flexbox utilities */
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }

/* Grid utilities */
.grid-auto-fit { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.col-span-2 { grid-column: span 2; }
.grid-2col { grid-template-columns: 1fr 1fr; }

/* Overflow utilities */
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Sizing utilities */
.w-auto { width: auto; }
.w-8 { width: 8px; }
.w-20 { width: 20px; }
.w-40 { width: 40px; }
.w-180 { width: 180px; }
.h-full { height: 100%; }
.h-8 { height: 8px; }
.h-28 { height: 28px; }
.h-180 { height: 180px; }
.min-w-160 { min-width: 160px; }
.min-w-180 { min-width: 180px; }
.min-w-200 { min-width: 200px; }
.min-w-220 { min-width: 220px; }
.min-w-400 { min-width: 400px; }
.min-h-250 { min-height: 250px; }
.max-h-200 { max-height: 200px; }
.max-h-400 { max-height: 400px; }
.max-h-500 { max-height: 500px; }
.max-h-80vh { max-height: 80vh; }
.max-w-200 { max-width: 200px; }

/* Spacing utilities */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-5 { padding: 1.25rem; }
.p-10 { padding: 2.5rem; }
.p-10px { padding: 10px; }
.px-10px { padding-left: 10px; padding-right: 10px; }
.py-10px { padding-top: 10px; padding-bottom: 10px; }
.px-24px { padding-left: 24px; padding-right: 24px; }
.mt-3 { margin-top: 0.75rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-12px { margin-top: 12px; }
.mb-4px { margin-bottom: 4px; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-6px { margin-top: 6px; margin-bottom: 6px; }
.ml-auto { margin-left: auto; }

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-6 { gap: 1.5rem; }
.gap-6px { gap: 6px; }

/* Border radius utilities */
.br-2 { border-radius: 2px; }
.br-3 { border-radius: 3px; }
.br-4 { border-radius: 4px; }
.br-6 { border-radius: 6px; }
.br-8 { border-radius: 8px; }
.br-12 { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

/* Text utilities */
.break-all { word-break: break-all; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.no-underline { text-decoration: none; }
.cursor-pointer { cursor: pointer; }

/* Z-index utilities */
.z-5 { z-index: 5; }
.fs-1_5rem { font-size: 1.5rem; }

/* Quota progress bars */
.quota-progress-track { height: 6px; background: var(--white-10); border-radius: 3px; overflow: hidden; }
.quota-progress-bar { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.quota-ok { background: var(--color-success); }
.quota-warn { background: var(--warning); }
.quota-danger { background: var(--error-bright); }

