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

/* Enhanced performance optimizations */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  visibility: visible;
  font-display: swap;
}

/* Optimized rendering and performance */
* {
  will-change: auto;
}

.hover\:scale-105:hover {
  will-change: transform;
}

/* Image optimization classes */
.responsive-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Performance-optimized animations */
@media (prefers-reduced-motion: no-preference) {
  .smooth-transition {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* Critical loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Mobile touch optimizations */
@media (hover: none) and (pointer: coarse) {
  * {
    /* Remove persistent hover states on touch devices */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  
  input, textarea, [contenteditable], button, a {
    -webkit-user-select: auto;
    user-select: auto;
  }
  
  button, a, [role="button"] {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
  }
  
  /* Ensure buttons maintain their appearance on touch */
  button, a[href], [role="button"] {
    cursor: pointer;
  }
  
  /* Active states for touch feedback */
  button:active,
  [role="button"]:active,
  a:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
}

/* Definition of the design system. All colors, gradients, fonts, etc should be defined here. 
All colors MUST be HSL.
*/

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 215 50% 18%;  /* #002359 */

    --card: 0 0% 100%;
    --card-foreground: 215 25% 27%;

    --popover: 0 0% 100%;
    --popover-foreground: 215 25% 27%;

    --primary: 205 100% 53%;  /* #0088FF */
    --primary-foreground: 0 0% 100%;

    --secondary: 210 24% 96%;  /* #F5F7FA */
    --secondary-foreground: 215 50% 18%;  /* #002359 */

    --muted: 210 24% 96%;  /* #F5F7FA */
    --muted-foreground: 215 40% 35%;

    --accent: 142 76% 36%;
    --accent-foreground: 0 0% 100%;

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

    --border: 214 32% 91%;
    --input: 214 32% 91%;
    --ring: 210 100% 45%;

    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;

    --trust: 210 100% 45%;
    --trust-light: 210 100% 95%;
    
    --gradient-primary: linear-gradient(135deg, hsl(210 100% 45%), hsl(210 100% 55%));
    --gradient-accent: linear-gradient(135deg, hsl(142 76% 36%), hsl(142 76% 46%));
    --gradient-hero: linear-gradient(135deg, hsl(210 100% 97%), hsl(210 40% 98%));
    
    --shadow-soft: 0 4px 6px -1px hsl(210 100% 45% / 0.1);
    --shadow-medium: 0 10px 15px -3px hsl(210 100% 45% / 0.1);
    --shadow-strong: 0 20px 25px -5px hsl(210 100% 45% / 0.15);

    --radius: 0.5rem;

    --sidebar-background: 0 0% 98%;

    --sidebar-foreground: 240 5.3% 26.1%;

    --sidebar-primary: 240 5.9% 10%;

    --sidebar-primary-foreground: 0 0% 98%;

    --sidebar-accent: 240 4.8% 95.9%;

    --sidebar-accent-foreground: 240 5.9% 10%;

    --sidebar-border: 220 13% 91%;

    --sidebar-ring: 217.2 91.2% 59.8%;
  }

  .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: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --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: 212.7 26.8% 83.9%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
  }

  html {
    scroll-padding-top: 6rem; /* Altura do header sticky */
    scroll-behavior: smooth;
  }
}