@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96%;
    --secondary-foreground: 222.2 84% 4.9%;
    --muted: 210 40% 96%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96%;
    --accent-foreground: 222.2 84% 4.9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 0.5rem;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 217.2 91.2% 59.8%;
    --primary-foreground: 222.2 84% 4.9%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 224.3 76.3% 94.1%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

/* Custom KVHV styles */
@layer components {
  .kvhv-button {
    @apply bg-kvhv-blue text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors;
  }
  
  .kvhv-card {
    @apply bg-white rounded-lg shadow-md p-6 border border-gray-200;
  }
  
  .kvhv-shield {
    @apply w-32 h-32 object-contain rounded-lg shadow-lg hover:shadow-xl transition-shadow;
  }
  
  /* Chapter ribbon styles */
  .chapter-ribbon {
    @apply absolute top-0 right-0 w-16 h-16 overflow-hidden;
  }
  
  .chapter-ribbon::before {
    content: '';
    @apply absolute top-0 right-0 w-16 h-16 transform rotate-45 translate-x-8 -translate-y-8;
  }
  
  .chapter-ribbon::after {
    content: '';
    @apply absolute top-0 right-0 w-16 h-16 transform rotate-45 translate-x-8 -translate-y-8;
  }
  
  /* Three-color ribbon implementation */
  .chapter-ribbon-three-color {
    @apply absolute top-0 right-0 w-20 h-20 overflow-hidden;
  }
  
  .chapter-ribbon-three-color::before {
    content: '';
    @apply absolute top-0 right-0 w-20 h-20 transform rotate-45 translate-x-10 -translate-y-10;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 20px solid var(--ribbon-color-1);
  }
  
  .chapter-ribbon-three-color::after {
    content: '';
    @apply absolute top-0 right-0 w-20 h-20 transform rotate-45 translate-x-10 -translate-y-10;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 20px solid var(--ribbon-color-2);
    transform: rotate(45deg) translate(10px, -10px) translateX(10px);
  }
  
  /* Alternative approach using pseudo-elements for three colors */
  .chapter-ribbon-alt {
    @apply absolute top-0 right-0 w-24 h-24 overflow-hidden;
  }
  
  .chapter-ribbon-alt::before {
    content: '';
    @apply absolute top-0 right-0 w-24 h-24;
    background: linear-gradient(45deg, 
      var(--ribbon-color-1) 0%, 
      var(--ribbon-color-1) 33%, 
      var(--ribbon-color-2) 33%, 
      var(--ribbon-color-2) 66%, 
      var(--ribbon-color-3) 66%, 
      var(--ribbon-color-3) 100%);
    transform: rotate(45deg) translate(12px, -12px);
  }
  
  /* Simple three-stripe ribbon */
  .chapter-ribbon-simple {
    @apply absolute top-0 right-0 w-20 h-20 overflow-hidden;
  }
  
  .chapter-ribbon-simple::before {
    content: '';
    @apply absolute top-0 right-0 w-20 h-20;
    background: linear-gradient(45deg, 
      var(--ribbon-color-1) 0%, 
      var(--ribbon-color-1) 33%, 
      var(--ribbon-color-2) 33%, 
      var(--ribbon-color-2) 66%, 
      var(--ribbon-color-3) 66%, 
      var(--ribbon-color-3) 100%);
    transform: rotate(45deg) translate(10px, -10px);
  }
}
