/* core.css - Global tokens, typography, base elements */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --ht-bg: #02030a;
  --ht-bg-elevated: rgba(8, 10, 25, 0.9);
  --ht-bg-elevated-soft: rgba(14, 17, 40, 0.85);
  --ht-border-subtle: rgba(255, 255, 255, 0.06);
  --ht-border-strong: rgba(255, 255, 255, 0.14);

  --ht-accent: #303f9f;
  --ht-accent-soft: #4f5bd5;
  --ht-accent-alt: #111827;

  --ht-text: #f9fafb;
  --ht-text-muted: #9ca3af;
  --ht-text-soft: #d1d5db;
  --ht-danger: #f97373;
  --ht-success: #4ade80;
  --ht-warning: #facc15;

  --ht-radius-sm: 8px;
  --ht-radius-md: 12px;
  --ht-radius-lg: 18px;
  --ht-radius-full: 999px;

  --ht-shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.7);
  --ht-shadow-subtle: 0 12px 30px rgba(0, 0, 0, 0.45);

  --ht-nav-height: 64px;

  --ht-transition-fast: 150ms ease-out;
  --ht-transition-med: 220ms ease-out;

  --ht-max-width: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

option {
	color: black;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ht-text);
  background:
    radial-gradient(circle at 0% 0%, #111827 0, #020617 45%, #000000 100%);
  -webkit-font-smoothing: antialiased;
}

/* Generic text */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.35em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ht-text);
}

p {
  margin: 0 0 0.75em;
  color: var(--ht-text-soft);
}

strong {
  font-weight: 600;
}

/* Links */

a {
  color: var(--ht-accent-soft);
  text-decoration: none;
  transition: color var(--ht-transition-fast);
}

a:hover,
a:focus-visible {
  color: #9fa8ff;
}

/* Images & media */

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--ht-radius-md);
}

/* Layout shells */

body.app-shell,
body.auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, #111827 0, #020617 45%, #000000 100%);
  color: var(--ht-text);
}

.app-main {
  width: 100%;
  max-width: var(--ht-max-width);
  margin: calc(var(--ht-nav-height) + 24px) auto 32px;
  padding: 0 16px 24px;
}

/* Page header */

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  line-height: 1.25;
}

.page-header p {
  margin-top: 4px;
  font-size: 13px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--ht-radius-full);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  background: transparent;
  color: var(--ht-text);
  transition:
    background-color var(--ht-transition-med),
    color var(--ht-transition-med),
    border-color var(--ht-transition-med),
    box-shadow var(--ht-transition-med),
    transform 120ms ease-out;
  text-decoration: none;
}

.btn i {
  font-size: 13px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--ht-accent) 0%, var(--ht-accent-soft) 60%, #7c3aed 100%);
  border-color: rgba(148, 163, 253, 0.6);
  box-shadow: 0 12px 30px rgba(55, 65, 194, 0.65);
  color: #f9fafb;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #222e7e 0%, var(--ht-accent-soft) 50%, #6d28d9 100%);
  box-shadow: 0 18px 40px rgba(55, 65, 194, 0.85);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.6);
  color: var(--ht-text-soft);
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.98);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: var(--ht-text-soft);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.6);
  color: var(--ht-text);
}

.btn-link {
  border-radius: 0;
  border-color: transparent;
  background: none;
  padding: 0;
  color: var(--ht-accent-soft);
  box-shadow: none;
}

.btn-link:hover {
  color: #a5b4fc;
  background: none;
  transform: none;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-full {
  width: 100%;
}

/* Forms */

.form-group {
  margin-bottom: 14px;
}

.form-group-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ht-text-soft);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--ht-radius-md);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at top, rgba(15,23,42,0.92), rgba(15,23,42,0.98));
  color: var(--ht-text);
  font: inherit;
  outline: none;
  transition:
    border-color var(--ht-transition-fast),
    box-shadow var(--ht-transition-fast),
    background-color var(--ht-transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(129, 140, 248, 0.85);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.65);
  background: radial-gradient(circle at top, rgba(15,23,42,0.98), rgba(15,23,42,1));
}

/* Compact / special form helpers */

.form-compact .form-group {
  margin-bottom: 10px;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Alerts & errors */

.alert {
  border-radius: var(--ht-radius-md);
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.alert-success {
  background: rgba(22, 163, 74, 0.09);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #bbf7d0;
}

.alert-error {
  background: rgba(239, 68, 68, 0.09);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: #fecaca;
}

/* Tables */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table thead {
  background: rgba(15, 23, 42, 0.9);
}

.table th,
.table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(30, 41, 59, 0.9);
}

.table th {
  font-weight: 500;
  color: var(--ht-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.7);
}

.table tbody tr:hover {
  background: rgba(30, 64, 175, 0.28);
}

/* Badges & status chips */

.badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: var(--ht-radius-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.badge-soft {
  background: rgba(148, 163, 184, 0.18);
  color: var(--ht-text-soft);
}

.badge-success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.badge-error {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

/* Order & shipment status variants */

.status-badge {
  border: 1px solid transparent;
}

.status-pending {
  background: rgba(250, 204, 21, 0.09);
  border-color: rgba(250, 204, 21, 0.45);
  color: #facc15;
}

.status-paid,
.status-processing {
  background: rgba(59, 130, 246, 0.09);
  border-color: rgba(59, 130, 246, 0.55);
  color: #bfdbfe;
}

.status-shipped,
.status-in_transit {
  background: rgba(14, 165, 233, 0.09);
  border-color: rgba(14, 165, 233, 0.55);
  color: #bae6fd;
}

.status-completed,
.status-delivered {
  background: rgba(22, 163, 74, 0.09);
  border-color: rgba(34, 197, 94, 0.6);
  color: #bbf7d0;
}

.status-cancelled,
.status-refunded,
.status-returned {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.status-none {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.45);
  color: #e5e7eb;
}

/* Generic cards & glass surfaces */

.glass-panel,
.glass-card {
  position: relative;
  border-radius: var(--ht-radius-lg);
  padding: 16px 18px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.98));
  border: 1px solid var(--ht-border-subtle);
  box-shadow: var(--ht-shadow-soft);
  backdrop-filter: blur(18px) saturate(150%);
}

/* Price formatting */

.price {
  font-weight: 600;
  font-size: 14px;
}

/* Simple utilities */

.text-muted {
  color: var(--ht-text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--ht-radius-full);
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.45);
  font-size: 12px;
}

/* Inline forms */

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Responsive base tweaks */

@media (max-width: 960px) {
  .app-main {
    margin-top: calc(var(--ht-nav-height) + 12px);
  }
}

@media (max-width: 640px) {
  .app-main {
    margin-top: calc(var(--ht-nav-height) + 8px);
    padding: 0 12px 20px;
  }

  .glass-panel,
  .glass-card {
    padding: 14px 14px;
  }

  .page-header h1 {
    font-size: 20px;
  }
}
