/* alpha.css - Utility layer for unsandbox.com
   Framework-agnostic enhancement layer
   Works with cs16 or any base CSS */

:root {
  /* Colors */
  --c-white: #fff;
  --c-black: #000;
  --c-success: #4ade80;
  --c-error: #ff4444;
  --c-warning: #fbbf24;
  --c-info: #3b82f6;
  --c-orange: #ff6b00;
  --c-muted: #888;
  --c-muted-light: #aaa;
  --c-muted-dark: #666;
  --c-bg-card: #1a1a1a;
  --c-bg-card-alt: #2a2a2a;
  --c-bg-dark: #0d0d0d;
  --c-bg-green: #1a2a1f;
  --c-bg-green-light: #243828;

  /* Spacing */
  --sp-5: 5px;
  --sp-8: 8px;
  --sp-10: 10px;
  --sp-15: 15px;
  --sp-20: 20px;
  --sp-30: 30px;
  --sp-40: 40px;

  /* Font sizes (18px min) */
  --fs-sm: 18px;
  --fs-md: 20px;
  --fs-lg: 24px;
  --fs-xl: 30px;
  --fs-2xl: 42px;
  --fs-3xl: 54px;
  --fs-4xl: 70px;

  /* Gaps */
  --gap-sm: 8px;
  --gap-md: 10px;
  --gap-lg: 15px;
  --gap-xl: 20px;
  --gap-2xl: 30px;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
}

/* ==================
   TYPOGRAPHY
   ================== */
.mono { font-family: monospace; }
.bold { font-weight: bold; }
.center, .text-center { text-align: center; }
.left, .text-left { text-align: left; }
.right, .text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.6; }

/* Font sizes */
.fs-sm { font-size: var(--fs-sm); }
.fs-md { font-size: var(--fs-md); }
.fs-lg { font-size: var(--fs-lg); }
.fs-xl { font-size: var(--fs-xl); }
.fs-2xl { font-size: var(--fs-2xl); }
.fs-3xl { font-size: var(--fs-3xl); }
.fs-4xl { font-size: var(--fs-4xl); }

/* ==================
   COLORS
   ================== */
.text-white, .color-white { color: var(--c-white); }
.text-black { color: var(--c-black); }
.text-accent { color: var(--accent); }
.text-success, .color-green { color: var(--c-success); }
.text-error, .color-red { color: var(--c-error); }
.text-warning, .color-yellow { color: var(--c-warning); }
.text-info { color: var(--c-info); }
.text-orange { color: var(--c-orange); }
.text-muted { color: var(--c-muted); }
.text-muted-light { color: var(--c-muted-light); }
.text-default { color: var(--text); }
.text-3 { color: var(--text-3); }
.text-cyan, .color-cyan { color: #06b6d4; }
.text-blue, .color-blue { color: #60a5fa; }

/* Themed external links */
.link-external {
  color: var(--accent);
  text-decoration: underline;
}
.link-external:visited {
  color: var(--accent);
}
.link-external:hover {
  color: var(--c-white);
}

.bg-card { background: var(--c-bg-card); }
.bg-card-alt { background: var(--c-bg-card-alt); }
.bg-dark { background: var(--c-bg-dark); }
.bg-green { background: var(--c-bg-green); }
.bg-green-light { background: var(--c-bg-green-light); }
.bg-default { background: var(--bg); }
.bg-secondary { background: var(--secondary-bg); }
.bg-accent { background-color: var(--accent); }
.bg-transparent { background: transparent; }
.bg-none { background: none; }

/* ==================
   LAYOUT - GRID
   ================== */
.grid { display: grid; }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-auto { grid-template-columns: auto; }
.grid-1fr-auto { grid-template-columns: 1fr auto; }
.grid-auto-1fr { grid-template-columns: auto 1fr; }
.grid-auto-auto { grid-template-columns: auto auto; }
.grid-1fr-auto-auto { grid-template-columns: 1fr auto auto; }
.grid-auto-1fr-auto { grid-template-columns: auto 1fr auto; }
.grid-flow-col { grid-auto-flow: column; }

.items-center { align-items: center; }
.items-start { align-items: start; }
.items-end { align-items: end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: start; }
.justify-end { justify-content: end; }
.justify-items-center { justify-items: center; }

/* ==================
   GAPS
   ================== */
.gap-0 { gap: 0; }
.gap-5 { gap: 5px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }
.gap-40 { gap: 40px; }

/* ==================
   SPACING
   ================== */
.p-0 { padding: 0; }
.p-5 { padding: 5px; }
.p-8 { padding: 8px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.p-40 { padding: 40px; }
.p-60 { padding: 60px; }

.px-sm { padding-left: var(--sp-10); padding-right: var(--sp-10); }
.px-md { padding-left: var(--sp-15); padding-right: var(--sp-15); }
.px-lg { padding-left: var(--sp-20); padding-right: var(--sp-20); }

.py-sm { padding-top: var(--sp-10); padding-bottom: var(--sp-10); }
.py-md { padding-top: var(--sp-15); padding-bottom: var(--sp-15); }
.py-lg { padding-top: var(--sp-20); padding-bottom: var(--sp-20); }

.m-0 { margin: 0; }
.m-10 { margin: 10px; }
.m-20 { margin: 20px; }
.m-30 { margin: 30px; }
.mt-3 { margin-top: 3px; }
.mt-5 { margin-top: 5px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-3 { margin-bottom: 3px; }
.mb-5 { margin-bottom: 5px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.ml-5 { margin-left: 5px; }
.ml-10 { margin-left: 10px; }
.mr-5 { margin-right: 5px; }
.mr-10 { margin-right: 10px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-40 { margin-bottom: 40px; }

/* ==================
   COMPONENTS
   ================== */
.card {
  background: var(--c-bg-card);
  border: 1px solid var(--border-dark);
  padding: var(--sp-15);
}

.card-alt {
  background: var(--c-bg-card-alt);
  border: 1px solid var(--border-dark);
  padding: var(--sp-15);
}

.border { border: 1px solid var(--border-dark); }
.border-light { border: 1px solid var(--border-light); }
.border-accent { border: 2px solid var(--accent); }
.border-bottom { border-bottom: 1px solid var(--border-dark); }
.rounded-sm { border-radius: 3px; }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.max-w-xl { max-width: 1200px; }
.fixed { position: fixed; }

/* ==================
   UTILITIES
   ================== */
.pointer { cursor: pointer; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.no-underline { text-decoration: none; }
.underline { text-decoration: underline; }
.border-none { border: none; }
.italic { font-style: italic; }
.break-all { word-break: break-all; }

/* ==================
   STATUS BADGES
   ================== */
.status-active,
.status-running,
.status-sleeping,
.status-redeploying,
.status-expired,
.status-stopped,
.status-upgrading,
.status-deep_upgrading {
  padding: 3px 10px;
  border-radius: 3px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 18px;
  width: fit-content;
}

.status-active,
.status-running {
  background: rgba(76, 222, 128, 0.2);
  color: var(--c-success);
}

.status-sleeping {
  background: rgba(255, 165, 0, 0.2);
  color: #ffa500;
}

.status-redeploying {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.status-expired,
.status-stopped {
  background: rgba(255, 68, 68, 0.2);
  color: var(--c-error);
}

.status-upgrading,
.status-deep_upgrading {
  background: rgba(59, 130, 246, 0.2);
  color: var(--c-info);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ==================
   HEADING UTILITIES
   ================== */
.heading-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
}

.heading-close:hover {
  color: var(--accent);
}

.heading-lock {
  font-size: 24px;
}

.heading-refresh {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 24px;
  cursor: pointer;
  padding: 0 10px;
}

.heading-refresh:hover {
  color: var(--accent);
}

.heading-auto-refresh {
  color: var(--accent);
  font-size: 20px;
  animation: spin 2s linear infinite;
  margin-left: auto;
  margin-right: 10px;
}

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

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 768px) {
  .mobile-grid-1 { grid-template-columns: 1fr !important; }
  .mobile-hidden { display: none !important; }
  .mobile-block { display: block !important; }
  .mobile-center { text-align: center !important; }
  .mobile-p-sm { padding: var(--sp-10) !important; }
}

@media (max-width: 1024px) {
  .tablet-grid-1 { grid-template-columns: 1fr !important; }
  .tablet-grid-2 { grid-template-columns: repeat(2, 1fr) !important; }
}
