/* ===================================
   NineSec Design System
   Version 1.0.0
   =================================== */

/* ===================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   =================================== */

:root {
  /* Product Palette - premium trust & safety */
  --color-primary-h: 35;
  --color-primary-s: 72%;
  --color-primary-l: 66%;
  --color-primary: hsl(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l));
  --color-primary-light: hsl(var(--color-primary-h), var(--color-primary-s), 78%);
  --color-primary-dark: hsl(var(--color-primary-h), var(--color-primary-s), 56%);

  --color-secondary-h: 176;
  --color-secondary-s: 45%;
  --color-secondary-l: 67%;
  --color-secondary: hsl(var(--color-secondary-h), var(--color-secondary-s), var(--color-secondary-l));
  --color-secondary-light: hsl(var(--color-secondary-h), var(--color-secondary-s), 78%);
  --color-secondary-dark: hsl(var(--color-secondary-h), var(--color-secondary-s), 52%);

  --color-accent-h: 12;
  --color-accent-s: 74%;
  --color-accent-l: 66%;
  --color-accent: hsl(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l));
  --color-accent-glow: hsl(var(--color-accent-h), var(--color-accent-s), 74%);

  --color-danger-h: 0;
  --color-danger-s: 82%;
  --color-danger-l: 63%;
  --color-danger: hsl(var(--color-danger-h), var(--color-danger-s), var(--color-danger-l));

  --color-success-h: 149;
  --color-success-s: 63%;
  --color-success-l: 48%;
  --color-success: hsl(var(--color-success-h), var(--color-success-s), var(--color-success-l));

  --color-warning-h: 40;
  --color-warning-s: 96%;
  --color-warning-l: 58%;
  --color-warning: hsl(var(--color-warning-h), var(--color-warning-s), var(--color-warning-l));

  --color-info-h: 201;
  --color-info-s: 88%;
  --color-info-l: 60%;
  --color-info: hsl(var(--color-info-h), var(--color-info-s), var(--color-info-l));

  /* Dark Theme Colors */
  --color-bg-dark: hsl(208, 44%, 8%);
  --color-bg-darker: hsl(210, 41%, 6%);
  --color-surface: hsl(209, 38%, 12%);
  --color-surface-elevated: hsl(208, 34%, 15%);
  --color-surface-hover: hsl(208, 30%, 18%);
  --color-surface-glass: hsla(208, 33%, 12%, 0.82);
  --color-surface-soft: hsla(208, 30%, 16%, 0.76);

  --color-text-primary: hsl(36, 38%, 94%);
  --color-text-secondary: hsl(37, 18%, 74%);
  --color-text-muted: hsl(34, 11%, 58%);

  --color-border: hsla(36, 31%, 80%, 0.12);
  --color-border-light: hsla(36, 40%, 86%, 0.28);
  --color-ring: rgba(217, 163, 95, 0.22);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #d9a35f 0%, #f0d5ab 42%, #8ed9d1 100%);
  --gradient-accent: linear-gradient(135deg, #132130 0%, #1b2f42 58%, #d9a35f 100%);
  --gradient-surface: linear-gradient(180deg, rgba(13, 24, 35, 0.98) 0%, rgba(7, 17, 27, 0.98) 100%);
  --gradient-mesh:
    radial-gradient(circle at top left, rgba(142, 217, 209, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(217, 163, 95, 0.1), transparent 24%),
    radial-gradient(circle at bottom center, rgba(255, 255, 255, 0.04), transparent 28%);

  /* Spacing Scale (8px base) */
  --spacing-xs: 0.25rem;    /* 4px */
  --spacing-sm: 0.5rem;     /* 8px */
  --spacing-md: 1rem;       /* 16px */
  --spacing-lg: 1.5rem;     /* 24px */
  --spacing-xl: 2rem;       /* 32px */
  --spacing-2xl: 3rem;      /* 48px */
  --spacing-3xl: 4rem;      /* 64px */

  /* Typography */
  --font-family-heading: 'Cormorant Garamond', Georgia, serif;
  --font-family-body: 'Manrope', 'Segoe UI', sans-serif;
  --font-family-mono: 'IBM Plex Mono', 'Consolas', monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.875rem;  /* 14px */
  --radius-xl: 1.125rem;  /* 18px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 38px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.34);
  --shadow-xl: 0 34px 82px rgba(0, 0, 0, 0.42);
  --shadow-glow: 0 0 24px rgba(217, 163, 95, 0.14);
  --shadow-glow-primary: 0 24px 52px rgba(217, 163, 95, 0.16);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===================================
   2. GLOBAL STYLES
   =================================== */

* {
  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-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-dark);
  background-image: var(--gradient-mesh);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 100%);
  opacity: 0.34;
}

body::after {
  background:
    radial-gradient(circle at 18% 0%, rgba(142, 217, 209, 0.1), transparent 24%),
    radial-gradient(circle at 84% 10%, rgba(217, 163, 95, 0.12), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.04), transparent 26%);
}

::selection {
  background: rgba(217, 163, 95, 0.22);
  color: var(--color-text-primary);
}

/* ===================================
   3. TYPOGRAPHY
   =================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 600;
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

/* ===================================
   4. GLASSMORPHISM COMPONENTS
   =================================== */

.glass-card {
  background: var(--color-surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius-2xl) + 2px);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
}

.glass-card:hover {
  background: hsla(208, 30%, 16%, 0.92);
  border-color: var(--color-border-light);
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}

.glass-surface {
  background: linear-gradient(
    135deg,
    hsla(220, 15%, 15%, 0.9) 0%,
    hsla(220, 15%, 12%, 0.9) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ===================================
   5. BUTTONS
   =================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width var(--transition-base), height var(--transition-base);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #101419;
  box-shadow: var(--shadow-md), var(--shadow-glow-primary);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(217, 163, 95, 0.14);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--color-border-light);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-bg-dark);
  box-shadow: 0 0 24px rgba(243, 179, 74, 0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
}

/* ===================================
   6. CARDS
   =================================== */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-border-light);
}

.rz-button {
  border-radius: 999px !important;
  font-family: var(--font-family-body) !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.rz-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.rz-button.rz-primary {
  background: var(--gradient-primary) !important;
  color: #101419 !important;
}

.rz-button.rz-secondary,
.rz-button.rz-info,
.rz-button.rz-light {
  border: 1px solid var(--color-border-light) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--color-text-primary) !important;
}

.rz-badge {
  border-radius: 999px !important;
  font-family: var(--font-family-body) !important;
  letter-spacing: 0.12em;
  padding-inline: 0.7rem !important;
}

.card-header {
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  margin-bottom: var(--spacing-md);
}

.card-footer {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

/* ===================================
   7. INPUTS
   =================================== */

.input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-h), var(--color-primary-s), var(--color-primary-l), 0.2);
}

.input::placeholder {
  color: var(--color-text-muted);
}

/* Floating Label */
.input-group {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.input-group label {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: all var(--transition-fast);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: 0;
  font-size: var(--font-size-xs);
  background: var(--color-bg-dark);
  padding: 0 var(--spacing-xs);
  color: var(--color-primary);
}

/* ===================================
   8. UTILITIES
   =================================== */

/* Spacing */
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

/* Text utilities */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Background utilities */
.bg-primary { background-color: var(--color-primary); }
.bg-surface { background-color: var(--color-surface); }
.bg-glass { background: var(--color-surface-glass); backdrop-filter: blur(20px); }

/* Gradient text */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glow effect */
.glow {
  box-shadow: var(--shadow-glow);
}

.glow-primary {
  box-shadow: var(--shadow-glow-primary);
}

/* ===================================
   9. ANIMATIONS
   =================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.animate-fadeIn {
  animation: fadeIn var(--transition-base);
}

.animate-slideUp {
  animation: slideUp var(--transition-slow);
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===================================
   10. RESPONSIVE
   =================================== */

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 1.875rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
  }

  .glass-card {
    padding: var(--spacing-md);
  }
}

/* ===================================
   11. ACCESSIBILITY
   =================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================================
   UI Migration - Utility Classes
   Added: 2025-12-18
   =================================== */

/* Background Gradients */
.bg-gradient-primary {
    background: var(--gradient-primary);
    color: white;
}

.bg-gradient-accent {
    background: var(--gradient-accent);
    color: white;
}

.bg-gradient-success {
    background: var(--gradient-success);
    color: white;
}

.bg-gradient-info {
    background: var(--gradient-info);
    color: white;
}

/* Typography Hero Styles */
.heading-hero {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
}

.heading-large {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
}

/* Icon Sizes */
.icon-hero {
    font-size: 5rem;
    opacity: 0.9;
}

.icon-large {
    font-size: 3.5rem;
}

.icon-medium {
    font-size: 2.5rem;
}

.icon-glow {
    filter: drop-shadow(0 0 10px currentColor);
}

/* Text Colors */
.text-white {
    color: white;
}

.text-white-90 {
    color: rgba(255, 255, 255, 0.9);
}

.text-white-80 {
    color: rgba(255, 255, 255, 0.8);
}

/* Flex Utilities */
.flex-1 {
    flex: 1;
}

/* Width Utilities */
.w-100 {
    width: 100%;
}

/* Height Utilities */
.h-100 {
    height: 100%;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

/* Margin Top */
.mt-2 {
    margin-top: 0.5rem;
}

/* Border */
.border-none {
    border: none;
}

/* Animation Delays */
.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

/* Vertical Align */
.v-align-middle {
    vertical-align: middle;
}

/* Opacity */
.opacity-30 {
    opacity: 0.3;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-90 {
    opacity: 0.9;
}

/* Text Accent Color */
.text-accent {
    color: var(--color-accent);
}
