/**
 * Auralis AI - Base Styles
 * Foundation styles with design system
 */

/* Import Design System Variables */
@import url('./variables.css');

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&family=Fira+Code:wght@400;500;600&display=swap');

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--line-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 184, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 217, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

#app, main {
  position: relative;
  z-index: 1;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-bold);
  line-height: var(--line-tight);
  letter-spacing: var(--letter-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-semibold);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
}

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--color-signal-live);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-gold);
}

strong, b {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

small {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-elevated);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm {
  max-width: var(--container-sm);
}

.container-md {
  max-width: var(--container-md);
}

.container-lg {
  max-width: var(--container-lg);
}

.section {
  padding: var(--space-16) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

.section-lg {
  padding: var(--space-24) 0;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%);
  color: var(--text-on-gold);
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 2px solid var(--border-default);
}

.btn-secondary:hover {
  border-color: var(--color-gold);
  background: var(--bg-secondary);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
}

.btn-outline:hover {
  background: var(--color-gold);
  color: var(--text-on-gold);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-signal-live);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-error);
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-slow);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-default);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-2);
}

.card-body {
  margin-bottom: var(--space-4);
}

.card-footer {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-wide);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-live {
  background: rgba(0, 217, 255, 0.15);
  color: var(--color-signal-live);
  border: 1px solid var(--color-signal-live);
  animation: pulse-glow 2s ease-in-out infinite;
}

.badge-profit {
  background: rgba(0, 255, 136, 0.15);
  color: var(--color-signal-profit);
}

.badge-alert {
  background: rgba(255, 107, 107, 0.15);
  color: var(--color-signal-alert);
}

.badge-premium {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  color: var(--text-on-gold);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 217, 255, 0.4);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
    opacity: 0.9;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fade-in 0.4s ease-out;
}

.slide-in-right {
  animation: slide-in-right 0.4s ease-out;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-secondary) 50%,
    var(--bg-elevated) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   FOCUS VISIBLE (Accessibility)
   ============================================ */

:focus-visible {
  outline: 2px solid var(--color-signal-live);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: var(--text-4xl);
  }
  
  h2 {
    font-size: var(--text-3xl);
  }
  
  h3 {
    font-size: var(--text-2xl);
  }
  
  .section {
    padding: var(--space-12) 0;
  }
  
  .section-lg {
    padding: var(--space-16) 0;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 var(--space-3);
  }
  
  .btn {
    width: 100%;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
