/* Orca Account Web - Main Styles */
/* Extending the auth-ui design system for account management */

:root {
  /* Color System - Extended from auth-ui */
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Brand Colors */
  --brand-primary: #15a5ff;
  --brand-primary-dark: #0a74db;
  --brand-primary-light: #4fc3ff;
  --brand-accent: #4ef3ff;
  --brand-deep: #02192b;
  --brand-glass: rgba(255, 255, 255, 0.86);
  --border-soft: rgba(255, 255, 255, 0.35);

  /* Text Colors */
  --text-strong: #0f1f32;
  --text-medium: #2c3e50;
  --text-subtle: #4b5c73;
  --text-muted: #6c757d;
  --text-inverse: #ffffff;

  /* Background Colors */
  --surface-primary: #ffffff;
  --surface-secondary: #f8f9fa;
  --surface-muted: rgba(8, 27, 52, 0.08);
  --surface-glass: rgba(255, 255, 255, 0.95);
  --surface-dark: #0c1f33;

  /* Status Colors */
  --success: #16d98b;
  --success-bg: rgba(22, 217, 139, 0.1);
  --warning: #ffa726;
  --warning-bg: rgba(255, 167, 38, 0.1);
  --error: #ff5252;
  --error-bg: rgba(255, 82, 82, 0.1);
  --info: var(--brand-primary);
  --info-bg: rgba(21, 165, 255, 0.1);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(8, 27, 52, 0.1);
  --shadow: 0 4px 16px rgba(8, 27, 52, 0.15);
  --shadow-lg: 0 8px 32px rgba(8, 27, 52, 0.2);
  --shadow-xl: 0 22px 60px rgba(8, 27, 52, 0.32);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 140ms ease;
  --transition: 160ms ease;
  --transition-slow: 220ms ease;

  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --text-strong: #f4fbff;
    --text-medium: #d9f7ff;
    --text-subtle: #b3d9e6;
    --text-muted: #8fb3c7;

    --surface-primary: #0c1f33;
    --surface-secondary: #112840;
    --surface-muted: rgba(255, 255, 255, 0.08);
    --surface-glass: rgba(12, 31, 51, 0.95);

    --brand-glass: rgba(12, 31, 51, 0.86);
    --border-soft: rgba(255, 255, 255, 0.15);
  }
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-strong);
  background: radial-gradient(120% 120% at 10% 10%, #08335a 0%, #051e38 45%, #010f1f 100%);
  min-height: 100vh;
  position: relative;
}

/* Backdrop Animation (from auth-ui) */
.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.backdrop .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.8px);
  opacity: 0.55;
  animation: float 18s linear infinite;
}

.backdrop .orb:nth-child(1) {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(21, 165, 255, 0.58) 0%, rgba(7, 35, 60, 0) 70%);
  top: -140px;
  left: -140px;
  animation-duration: 26s;
}

.backdrop .orb:nth-child(2) {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(78, 243, 255, 0.42) 0%, rgba(7, 35, 60, 0) 75%);
  bottom: -120px;
  right: -80px;
}

.backdrop .orb:nth-child(3) {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, rgba(7, 35, 60, 0) 70%);
  top: 28%;
  right: 12%;
  animation-duration: 22s;
}

@keyframes float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(12px, -16px, 0);
  }
}

/* Layout Components */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.shell {
  position: relative;
  width: min(1120px, 100%);
  z-index: 1;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

/* Navigation */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-lg);
  background: var(--brand-glass);
  border: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-inverse);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(21, 165, 255, 0.45);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  color: var(--text-inverse);
  text-decoration: none;
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  background: rgba(21, 165, 255, 0.22);
  border: 1px solid rgba(21, 165, 255, 0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nav-link:hover,
.nav-link:focus {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(21, 165, 255, 0.28);
  outline: none;
}

/* Cards */
.card {
  background: var(--brand-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-soft);
  display: grid;
  gap: var(--space-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-strong);
}

.card-subtitle {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-medium);
}

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

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

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

/* Eyebrow */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-primary-dark);
  margin-bottom: var(--space-sm);
}

/* Status and Messages */
.status {
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid;
  font-weight: 600;
  display: none;
}

.status.is-visible {
  display: block;
}

.status[data-variant="info"] {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--brand-primary-dark);
}

.status[data-variant="success"] {
  background: var(--success-bg);
  border-color: var(--success);
  color: #135239;
}

.status[data-variant="warning"] {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #8b5a00;
}

.status[data-variant="error"] {
  background: var(--error-bg);
  border-color: var(--error);
  color: #6e1423;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-soft);
  border-top: 2px solid var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Spacing Utilities */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.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); }

.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* Responsive Design */
@media (max-width: 768px) {
  .shell {
    padding: var(--space-lg) var(--space-md);
  }

  .navbar {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .card {
    padding: var(--space-lg);
  }
}

/* Import component styles */
@import url('./forms.css');
@import url('./dashboard.css');
@import url('./modals.css');
@import url('./settings.css');
@import url('./subscriptions.css');