/* ============================================
   SOLFACIL Admin Portal — Base Styles
   CSS Reset + Global styles + Skeleton loading
   ============================================ */

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Data values — tabular-nums for aligned numbers */
.data-value {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Positive / Negative helpers */
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.warning { color: var(--amber); }
.neutral-color { color: var(--neutral); }

.positive::before { content: '+'; }
.negative::before { content: '-'; }

/* When used inside KPI cards, don't add prefix */
.kpi-value.positive::before,
.kpi-value.negative::before,
.no-prefix::before {
  content: '';
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-online {
  background: var(--positive-bg);
  color: var(--positive);
}

.status-offline {
  background: var(--negative-bg);
  color: var(--negative);
}

.status-warning {
  background: var(--amber-bg);
  color: var(--amber);
}

.status-neutral {
  background: var(--neutral-bg);
  color: var(--neutral);
}

/* Skeleton Loading */
@keyframes skeleton-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}

.skeleton {
  background: var(--border);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-heading {
  height: 32px;
  margin-bottom: 12px;
  width: 50%;
}

.skeleton-chart {
  height: 300px;
  width: 100%;
}

/* Control-row skeleton sizes — replaces inline style="width/height" (CSP fix) */
.skeleton-ctrl-sm {
  width: 200px;
  height: 32px;
}

.skeleton-ctrl-md {
  width: 300px;
  height: 36px;
}

.skeleton-kpi {
  height: 100px;
  width: 100%;
}

.skeleton-table-row {
  height: 44px;
  margin-bottom: 4px;
  width: 100%;
}

/* Page transition */
.page-fade-enter {
  opacity: 0;
  transform: translateY(8px);
}

.page-fade-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

/* Utility classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.font-data { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Scrollbar styling (dark theme) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Selection color */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--text);
}
