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

/* Mobile: make images break out of container padding for full-width display */
@media (max-width: 767px) {
  img:not(nav img):not(header img):not(footer img) {
    max-width: 100vw;
  }
  .container img:not([class*="w-"]):not([class*="h-"]):not([class*="rounded-full"]) {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  .container > img,
  .container .full-bleed-mobile,
  .container .full-bleed-mobile > img {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0 !important;
  }
}


@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 273 66% 10%;

    --card: 0 0% 100%;
    --card-foreground: 273 66% 10%;

    --popover: 0 0% 100%;
    --popover-foreground: 273 66% 10%;

    --primary: 273 66% 32%;
    /* purple-900: #581C87 */
    --primary-foreground: 0 0% 100%;

    --secondary: 210 20% 98%;
    /* Gray-50: #F9FAFB */
    --secondary-foreground: 273 66% 10%;

    --muted: 210 20% 98%;
    --muted-foreground: 273 20% 45%;

    --accent: 24 95% 53%;
    /* Orange-500: #f97316 */
    --accent-foreground: 0 0% 100%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    --border: 210 20% 98%;
    --input: 210 20% 98%;
    --ring: 273 66% 32%;

    --radius: 0.75rem;

    --sidebar-background: 273 66% 32%;
    --sidebar-foreground: 0 0% 100%;
    --sidebar-primary: 24 95% 53%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 273 66% 40%;
    --sidebar-accent-foreground: 0 0% 100%;
    --sidebar-border: 273 66% 25%;
    --sidebar-ring: 24 95% 53%;

    /* Custom tokens */
    --hero-gradient: linear-gradient(135deg, hsl(273 66% 32%), hsl(273 66% 20%));
    --card-shadow: 0 1px 3px 0 hsl(273 66% 10% / 0.06), 0 1px 2px -1px hsl(273 66% 10% / 0.06);
    --card-shadow-lg: 0 10px 25px -5px hsl(273 66% 10% / 0.08), 0 8px 10px -6px hsl(273 66% 10% / 0.04);
    --card-shadow-xl: 0 20px 40px -10px hsl(273 66% 32% / 0.15);

    --success: 152 69% 45%;
    --success-foreground: 0 0% 100%;
    --warning: 24 95% 53%;
    --warning-foreground: 0 0% 100%;
    --info: 210 20% 98%;
    --info-foreground: 273 66% 10%;
  }

  html {
    font-size: 80%;
    overflow-x: clip;
  }

  .dark {
    --background: 217 33% 8%;
    --foreground: 215 20% 96%;
    --card: 217 33% 11%;
    --card-foreground: 215 20% 96%;
    --popover: 217 33% 11%;
    --popover-foreground: 215 20% 96%;
    --primary: 217 91% 60%;
    --primary-foreground: 0 0% 100%;
    --secondary: 217 30% 18%;
    --secondary-foreground: 215 20% 96%;
    --muted: 217 30% 18%;
    --muted-foreground: 215 16% 60%;
    --accent: 217 30% 18%;
    --accent-foreground: 215 20% 96%;
    --destructive: 0 62% 30%;
    --destructive-foreground: 215 20% 96%;
    --border: 217 30% 20%;
    --input: 217 30% 20%;
    --ring: 217 91% 60%;
  }
}

@layer base {
  body {
    @apply bg-background text-foreground font-sans antialiased;
    overflow-x: clip;
  }

  body.hide-cursor,
  body.hide-cursor * {
    cursor: none !important;
  }

  .container {
    @apply px-6 md:px-12 lg:px-20 mx-auto w-full max-w-[1400px];
  }
}

@layer utilities {
  .text-gradient {
    @apply bg-clip-text text-transparent;
    background-image: var(--hero-gradient);
  }

  .shadow-card {
    box-shadow: var(--card-shadow);
  }

  .shadow-card-lg {
    box-shadow: var(--card-shadow-lg);
  }

  .shadow-card-xl {
    box-shadow: var(--card-shadow-xl);
  }

  .bg-hero-gradient {
    background-image: var(--hero-gradient);
  }

  .bg-subtle-grid {
    background-image: radial-gradient(circle, hsl(210 20% 90%) 1px, transparent 1px);
    background-size: 24px 24px;
  }

  .thin-scrollbar::-webkit-scrollbar {
    width: 1px;
  }
  
  .thin-scrollbar::-webkit-scrollbar-thumb {
    background: #581C87;
    border-radius: 10px;
  }
  
  .thin-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #581C87 transparent;
  }

  .section-lazy {
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
  }
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #f97316;
  border-radius: 10px;
}

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: #581C87 transparent;
}

body.purple-scroll::-webkit-scrollbar-thumb {
  background: #581C87;
}

body.orange-scroll::-webkit-scrollbar-thumb {
  background: #f97316;
}

body.purple-scroll * {
  scrollbar-color: #581C87 transparent;
}

body.orange-scroll * {
  scrollbar-color: #f97316 transparent;
}

/* Responsive Table - Stack labels on mobile */
@media (max-width: 768px) {
  .responsive-table thead {
    display: none;
  }

  .responsive-table tr {
    display: block;
    margin-bottom: 1.5rem;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  }

  .responsive-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f9fafb;
    text-align: right;
  }

  .responsive-table td:last-child {
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 700;
    text-align: left;
    color: #581C87;
  }
}

/* Micro-interactions */
.card-hover-effect {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover-effect:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(88, 28, 135, 0.15);
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

.tap-effect:active {
  transform: scale(0.95);
}