/* ============================================================
   ROYALO — Design System & Global Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Design Tokens ── */
:root {
  /* Colors */
  --bg-primary:     #0a0a0f;
  --bg-secondary:   #12121a;
  --bg-card:        #1a1a28;
  --bg-card-hover:  #222236;
  --bg-glass:       rgba(26, 26, 40, 0.75);

  --accent-primary:   #00ffcc;
  --accent-secondary: #7c3aed;
  --accent-danger:    #ff4757;
  --accent-warning:   #ffd93d;
  --accent-info:      #4d96ff;

  --text-primary:   #f0f0f5;
  --text-secondary: #8888a8;
  --text-muted:     #55556a;

  --gradient-primary: linear-gradient(135deg, #00ffcc 0%, #7c3aed 100%);
  --gradient-warm:    linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
  --gradient-cool:    linear-gradient(135deg, #4d96ff 0%, #00ffcc 100%);
  --gradient-bg:      linear-gradient(180deg, #0a0a0f 0%, #0f0f1e 50%, #12121a 100%);

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(0, 255, 204, 0.15);

  /* Borders */
  --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --border-accent: 1px solid rgba(0, 255, 204, 0.3);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
a:hover { color: #66ffd9; }

/* ── Utilities ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--border-subtle);
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s;
}
.btn:hover::after {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #0a0a0f;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 255, 204, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 255, 204, 0.35);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--accent-danger);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: var(--border-subtle);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* ── Inputs ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  transition: all 0.3s var(--ease-out);
  outline: none;
}

.input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.1);
}

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

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s var(--ease-out);
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(0, 255, 204, 0.15);
  color: var(--accent-primary);
}

.badge-danger {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-danger);
}

.badge-warning {
  background: rgba(255, 217, 61, 0.15);
  color: var(--accent-warning);
}

.badge-info {
  background: rgba(77, 150, 255, 0.15);
  color: var(--accent-info);
}

/* ── Animated Background Orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: float 20s ease-in-out infinite;
}

.bg-orbs .orb:nth-child(1) {
  width: 500px; height: 500px;
  background: var(--accent-primary);
  top: -100px; left: -100px;
  animation-delay: 0s;
}

.bg-orbs .orb:nth-child(2) {
  width: 400px; height: 400px;
  background: var(--accent-secondary);
  bottom: -50px; right: -50px;
  animation-delay: -7s;
}

.bg-orbs .orb:nth-child(3) {
  width: 300px; height: 300px;
  background: var(--accent-info);
  top: 40%; left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(40px, -30px) scale(1.05); }
  50%      { transform: translate(-20px, 50px) scale(0.95); }
  75%      { transform: translate(30px, 20px) scale(1.02); }
}

/* ── Toast / Notification ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: var(--border-subtle);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: slideIn 0.4s var(--ease-out);
  max-width: 380px;
}

.toast-success { border-left: 3px solid var(--accent-primary); }
.toast-error   { border-left: 3px solid var(--accent-danger); }
.toast-info    { border-left: 3px solid var(--accent-info); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ── Loading Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 9999;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  animation: fadeIn 0.3s var(--ease-out);
}

.modal {
  background: var(--bg-card);
  border: var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s var(--ease-bounce);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Page Transition ── */
.page-enter {
  animation: pageEnter 0.5s var(--ease-out);
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .btn-lg { padding: 14px 28px; font-size: 1rem; }
  .modal { padding: 24px; }
}
