@layer base, components, utilities;

@layer base {
  :root {
    /* Color Palette - Taekwondo Inspired */
    --color-hong: #ef4444; /* Red */
    --color-chung: #3b82f6; /* Blue */
    --color-bg-dark: #0f172a;
    --color-bg-light: #f8fafc;
    --color-text-dark: #1e293b;
    --color-text-light: #f1f5f9;
    --color-surface: #ffffff;
    --color-surface-dark: #1e293b;
    
    /* Effects */
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-deep: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --glow-hong: 0 0 15px rgba(239, 68, 68, 0.5);
    --glow-chung: 0 0 15px rgba(59, 130, 246, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif; /* Could be Oswald if imported */
  }

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

  body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    align-items: center; /* Center horizontally */
  }

  #app {
    width: 100%;
    display: flex;
    justify-content: center;
    flex: 1;
  }

  /* Subtle Noise Texture Background */
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 1000;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.025em;
    text-transform: uppercase;
  }
}

@layer components {
  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
  }

  .btn-primary {
    background: linear-gradient(135deg, var(--color-hong), #dc2626);
    color: white;
    box-shadow: var(--glow-hong);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
  }

  .btn-secondary {
    background: linear-gradient(135deg, var(--color-chung), #2563eb);
    color: white;
    box-shadow: var(--glow-chung);
  }

  .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.7);
  }

  .card {
    background: var(--color-surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-deep);
    transition: all 0.3s ease;
  }

  .input-group {
    margin-bottom: var(--spacing-md);
  }

  .input-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-xs);
    opacity: 0.8;
    text-transform: uppercase;
  }

  .input-field {
    width: 100%;
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
  }

  .input-field:focus {
    border-color: var(--color-chung);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  }
}

@layer utilities {
  .text-hong { color: var(--color-hong); }
  .text-chung { color: var(--color-chung); }
  .bg-hong { background-color: var(--color-hong); }
  .bg-chung { background-color: var(--color-chung); }
  
  .glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .text-center { text-align: center; }
  .flex-center { display: flex; align-items: center; justify-content: center; }
}
