@import "tailwindcss";

/* Dimension47 Design System */
@theme {
  /* Primary Colors - Dimension47 Magenta */
  --color-primary-50: #fdf2fc;
  --color-primary-100: #fce8fa;
  --color-primary-200: #f9cef4;
  --color-primary-300: #f5a5ea;
  --color-primary-400: #ed6dd9;
  --color-primary-500: #c26dbc;
  --color-primary-600: #9a4a94;
  --color-primary-700: #7a3977;
  --color-primary-800: #5e2e5a;
  --color-primary-900: #4a274a;
  --color-primary-950: #2d0f2c;

  /* Secondary Colors - Dark Purple (47) */
  --color-secondary-50: #f9f5f9;
  --color-secondary-100: #f4eaf3;
  --color-secondary-200: #e7d5e6;
  --color-secondary-300: #d4b4d2;
  --color-secondary-400: #b988b5;
  --color-secondary-500: #9a6495;
  --color-secondary-600: #7d4d79;
  --color-secondary-700: #663d62;
  --color-secondary-800: #542e52;
  --color-secondary-900: #472945;
  --color-secondary-950: #2a1429;

  /* Background Colors (Dark Mode) */
  --color-bg-primary: #0f0f12;
  --color-bg-secondary: #1a1a1f;
  --color-bg-tertiary: #242429;
  --color-bg-elevated: #2a2a30;

  /* Text Colors */
  --color-text-primary: #f5f5f7;
  --color-text-secondary: #a1a1a6;
  --color-text-muted: #6b6b70;
  --color-text-inverse: #0f0f12;

  /* Border Colors */
  --color-border: #2a2a2f;
  --color-border-hover: #3a3a3f;
  --color-border-focus: #c26dbc;

  /* Semantic Colors */
  --color-success-50: #f0fdf4;
  --color-success-500: #22c55e;
  --color-success-600: #16a34a;

  --color-warning-50: #fffbeb;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;

  --color-error-50: #fef2f2;
  --color-error-500: #ef4444;
  --color-error-600: #dc2626;

  --color-info-50: #eff6ff;
  --color-info-500: #3b82f6;
  --color-info-600: #2563eb;

  /* Fonts */
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);

  /* Animations */
  --animate-fade-in: fade-in 0.2s ease-out;
  --animate-slide-up: slide-up 0.3s ease-out;
  --animate-slide-down: slide-down 0.3s ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

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

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

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(194, 109, 188, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(194, 109, 188, 0.7));
  }
}

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

@keyframes twinkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(10px, -10px);
  }
  50% {
    transform: translate(20px, 0);
  }
  75% {
    transform: translate(10px, 10px);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* Auth Page Styles */
.auth-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at bottom, #1a1a2e 0%, #0f0f12 100%);
}

.auth-stars {
  position: absolute;
  inset: 0;
}

.auth-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  animation: drift 20s ease-in-out infinite;
}

.auth-orb-1 {
  width: 400px;
  height: 400px;
  background: var(--color-primary-500);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 300px;
  height: 300px;
  background: var(--color-secondary-500);
  bottom: -50px;
  left: -50px;
  animation-delay: -10s;
}

.auth-orb-3 {
  width: 200px;
  height: 200px;
  background: var(--color-primary-400);
  top: 50%;
  left: 50%;
  animation-delay: -5s;
}

.auth-logo {
  animation: float 4s ease-in-out infinite, pulse-glow 3s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}

@keyframes logo-burst {
  0% {
    filter: drop-shadow(0 0 20px rgba(194, 109, 188, 0.4));
    transform: scale(1);
  }
  30% {
    filter: drop-shadow(0 0 60px rgba(194, 109, 188, 1)) drop-shadow(0 0 100px rgba(194, 109, 188, 0.8));
    transform: scale(1.08);
  }
  100% {
    filter: drop-shadow(0 0 20px rgba(194, 109, 188, 0.4));
    transform: scale(1);
  }
}

.auth-logo-burst {
  animation: logo-burst 0.6s ease-out forwards, float 4s ease-in-out infinite !important;
}

.auth-card {
  position: relative;
  background: rgba(26, 26, 31, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(194, 109, 188, 0.2);
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(
    from 0deg,
    transparent,
    var(--color-primary-500),
    transparent 30%
  );
  animation: gradient-rotate 4s linear infinite;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-card:hover::before {
  opacity: 1;
}

.auth-card::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: rgba(26, 26, 31, 0.95);
  border-radius: inherit;
  z-index: -1;
}

.auth-content {
  animation: slide-up 0.5s ease-out;
}

.auth-input-glow:focus-within {
  box-shadow: 0 0 20px rgba(194, 109, 188, 0.2);
}

/* Logo Text Animations */
@keyframes letter-reveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes text-glow {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(194, 109, 188, 0.3),
      0 0 20px rgba(194, 109, 188, 0.2);
  }
  50% {
    text-shadow:
      0 0 20px rgba(194, 109, 188, 0.5),
      0 0 40px rgba(194, 109, 188, 0.3),
      0 0 60px rgba(194, 109, 188, 0.2);
  }
}

@keyframes number-glow {
  0%, 100% {
    text-shadow:
      0 0 10px rgba(194, 109, 188, 0.5),
      0 0 20px rgba(194, 109, 188, 0.3),
      0 0 30px rgba(194, 109, 188, 0.2);
  }
  50% {
    text-shadow:
      0 0 20px rgba(194, 109, 188, 0.8),
      0 0 40px rgba(194, 109, 188, 0.5),
      0 0 60px rgba(194, 109, 188, 0.3),
      0 0 80px rgba(194, 109, 188, 0.2);
  }
}

.auth-title-letter {
  display: inline-block;
  opacity: 0;
  color: white;
  animation: letter-reveal 0.5s ease-out forwards;
}

.auth-title-dimension {
  animation: text-glow 3s ease-in-out infinite;
}

.auth-title-47 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: #c26dbc;
  animation: number-glow 2s ease-in-out infinite;
}

/* Enter Button Animation */
@keyframes button-pulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(194, 109, 188, 0.4),
      0 10px 40px rgba(194, 109, 188, 0.2);
  }
  50% {
    box-shadow:
      0 0 30px rgba(194, 109, 188, 0.6),
      0 10px 60px rgba(194, 109, 188, 0.4);
  }
}

.auth-enter-button {
  animation: button-pulse 2s ease-in-out infinite;
}

/* Base Styles */
html {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  max-width: 100vw;
}

#root {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Focus Styles */
*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-bg-primary), 0 0 0 4px var(--color-primary-500);
}

/* Selection */
::selection {
  background-color: rgba(194, 109, 188, 0.3);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-border-hover);
}
