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

/* MTD Reformas Design System */

/* Fonts loaded via index.html <link> to avoid render-blocking */

@layer base {
  :root {
    --primary: 215 50% 15%;
    --primary-foreground: 0 0% 100%;

    --secondary: 0 0% 96%;
    --secondary-foreground: 215 30% 10%;

    --background: 0 0% 100%;
    --foreground: 215 30% 10%;

    --card: 0 0% 100%;
    --card-foreground: 215 30% 10%;

    --popover: 0 0% 100%;
    --popover-foreground: 215 30% 10%;

    --muted: 0 0% 94%;
    --muted-foreground: 215 25% 30%;

    --accent: 24 95% 48%;
    --accent-foreground: 0 0% 0%;

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

    --border: 0 0% 0%;
    --input: 0 0% 0%;
    --ring: 0 0% 0%;

    --radius: 0rem;

    --footer: 215 50% 12%;
    --footer-foreground: 210 20% 90%;

    --sidebar-background: 215 50% 12%;
    --sidebar-foreground: 0 0% 98%;
    --sidebar-primary: 0 0% 98%;
    --sidebar-primary-foreground: 215 50% 12%;
    --sidebar-accent: 0 0% 95%;
    --sidebar-accent-foreground: 215 50% 15%;
    --sidebar-border: 0 0% 85%;
    --sidebar-ring: 215 50% 15%;

    --chart-1: 12 76% 61%;
    --chart-2: 173 58% 39%;
    --chart-3: 197 37% 24%;
    --chart-4: 43 74% 66%;
    --chart-5: 27 87% 67%;
    --sidebar: 0 0% 98%;

    --shadow-2xs: 1px 1px 0px 0px #000000;
    --shadow-xs: 2px 2px 0px 0px #000000;
    --shadow-sm: 3px 3px 0px 0px #000000;
    --shadow: 5px 5px 0px 0px #000000;
    --shadow-md: 8px 8px 0px 0px #000000;
    --shadow-lg: 12px 12px 0px 0px #000000;
    --shadow-xl: 16px 16px 0px 0px #000000;
    --shadow-2xl: 24px 24px 0px 0px #000000;
    --tracking-normal: 0em;
    --spacing: 0.25rem;
  }

  .dark {
    --primary: 0 0% 100%;
    --primary-foreground: 0 0% 0%;

    --secondary: 0 0% 15%;
    --secondary-foreground: 0 0% 100%;

    --background: 0 0% 0%;
    --foreground: 0 0% 100%;

    --card: 0 0% 0%;
    --card-foreground: 0 0% 100%;

    --popover: 0 0% 0%;
    --popover-foreground: 0 0% 100%;

    --muted: 0 0% 15%;
    --muted-foreground: 0 0% 65%;

    --accent: 0 0% 15%;
    --accent-foreground: 0 0% 100%;

    --destructive: 0 62% 30%;
    --destructive-foreground: 0 0% 100%;

    --border: 0 0% 100%;
    --input: 0 0% 100%;
    --ring: 0 0% 100%;

    --footer: 215 50% 6%;
    --footer-foreground: 210 20% 85%;

    --sidebar-background: 215 50% 6%;
    --sidebar-foreground: 0 0% 100%;
    --sidebar-primary: 0 0% 100%;
    --sidebar-primary-foreground: 0 0% 0%;
    --sidebar-accent: 0 0% 15%;
    --sidebar-accent-foreground: 0 0% 100%;
    --sidebar-border: 0 0% 100%;
    --sidebar-ring: 0 0% 100%;

    --chart-1: 220 70% 50%;
    --chart-2: 160 60% 45%;
    --chart-3: 30 80% 55%;
    --chart-4: 280 65% 60%;
    --chart-5: 340 75% 55%;
    --sidebar: 0 0% 5%;
    --radius: 0rem;

    --shadow-2xs: 1px 1px 0px 0px #ffffff;
    --shadow-xs: 2px 2px 0px 0px #ffffff;
    --shadow-sm: 3px 3px 0px 0px #ffffff;
    --shadow: 5px 5px 0px 0px #ffffff;
    --shadow-md: 8px 8px 0px 0px #ffffff;
    --shadow-lg: 12px 12px 0px 0px #ffffff;
    --shadow-xl: 16px 16px 0px 0px #ffffff;
    --shadow-2xl: 24px 24px 0px 0px #ffffff;
  }
}

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

  html {
    scroll-behavior: smooth;
  }

  body {
    @apply bg-background text-foreground font-sans antialiased;
    font-family: 'Open Sans', sans-serif;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    @apply font-bold tracking-tight;
  }
}

@layer components {
  .hero-overlay {
    background: linear-gradient(135deg, hsl(var(--primary) / 0.75), hsl(var(--primary) / 0.6));
  }

  .card-hover {
    @apply transition-all duration-300;
    box-shadow: 0 4px 20px -4px hsla(215, 50%, 23%, 0.15);
  }

  .card-hover:hover {
    box-shadow: 0 12px 40px -8px hsla(215, 50%, 23%, 0.25);
    @apply -translate-y-1;
  }

  .btn-glow {
    box-shadow: 0 4px 20px -4px hsla(24, 95%, 53%, 0.4);
    @apply transition-all duration-300;
  }

  .btn-glow:hover {
    box-shadow: 0 8px 30px -4px hsla(24, 95%, 53%, 0.5);
    @apply -translate-y-0.5;
  }

  .section-padding {
    @apply py-16 md:py-24;
  }

  .container-custom {
    @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8;
  }

  .footer-gradient {
    background: linear-gradient(180deg, hsl(215, 50%, 12%) 0%, hsl(215, 50%, 8%) 100%);
  }

  .service-overlay {
    background: linear-gradient(180deg, transparent 0%, hsla(215, 50%, 12%, 0.9) 100%);
  }

  .text-gradient {
    @apply bg-clip-text text-transparent;
    background-image: linear-gradient(135deg, hsl(24, 95%, 53%) 0%, hsl(24, 90%, 45%) 100%);
  }

  .animated-underline {
    @apply relative;
  }

  .animated-underline::after {
    content: '';
    @apply absolute bottom-0 left-0 w-0 h-0.5 bg-accent transition-all duration-300;
  }

  .animated-underline:hover::after {
    @apply w-full;
  }

  .stats-card {
    @apply bg-card rounded-xl p-6 text-center;
    box-shadow: 0 4px 20px -4px hsla(215, 50%, 23%, 0.15);
  }

  .lang-selector {
    @apply flex items-center gap-1 text-sm font-medium;
  }

  .skeleton-shimmer {
    @apply bg-muted relative overflow-hidden;
  }

  .skeleton-shimmer::after {
    content: '';
    @apply absolute inset-0;
    background: linear-gradient(90deg, transparent 0%, hsl(var(--muted-foreground) / 0.08) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
  }
}

/* Admin Panel - Dark Glassmorphism Theme */
.admin-panel {
  --background: 230 30% 8%;
  --foreground: 0 0% 92%;
  --card: 230 30% 10%;
  --card-foreground: 0 0% 92%;
  --muted: 230 20% 15%;
  --muted-foreground: 220 10% 60%;
  --border: 230 20% 18%;
  --input: 230 20% 18%;
  --ring: 200 80% 55%;
  --accent: 200 80% 55%;
  --accent-foreground: 0 0% 100%;
  --popover: 230 30% 12%;
  --popover-foreground: 0 0% 92%;
  --primary: 200 80% 55%;
  --primary-foreground: 0 0% 100%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;

  --sidebar-background: 230 35% 10%;
  --sidebar-foreground: 0 0% 92%;
  --sidebar-primary: 0 0% 100%;
  --sidebar-primary-foreground: 230 35% 10%;
  --sidebar-accent: 230 30% 18%;
  --sidebar-accent-foreground: 0 0% 100%;
  --sidebar-border: 230 20% 16%;
  --sidebar-ring: 200 80% 55%;

  --shadow-2xs: 0 1px 2px 0 hsl(230 30% 4% / 0.5);
  --shadow-xs: 0 1px 3px 0 hsl(230 30% 4% / 0.5);
  --shadow-sm: 0 2px 4px 0 hsl(230 30% 4% / 0.5);
  --shadow-md: 0 4px 8px 0 hsl(230 30% 4% / 0.4);
  --radius: 0.75rem;
}

.admin-panel .admin-main-content {
  background-image:
    linear-gradient(135deg, hsl(230 30% 8% / 0.92), hsl(230 30% 6% / 0.88)),
    url('/images/admin-bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Glass effect for cards inside admin panel */
.admin-panel [data-slot="card"],
.admin-panel .glass-card {
  background: hsl(230 30% 12% / 0.7) !important;
  backdrop-filter: blur(12px);
  border-color: hsl(0 0% 100% / 0.06) !important;
  box-shadow: 0 4px 24px -4px hsl(230 30% 4% / 0.4);
}

/* Override shadcn select/dialog/popover backgrounds */
.admin-panel [data-radix-popper-content-wrapper] [role="listbox"],
.admin-panel [data-radix-popper-content-wrapper] [role="dialog"],
.admin-panel [data-radix-popper-content-wrapper] [cmdk-root] {
  background: hsl(230 30% 12%) !important;
  border-color: hsl(0 0% 100% / 0.08) !important;
}

/* Admin input styling */
.admin-panel input,
.admin-panel textarea,
.admin-panel select,
.admin-panel [role="combobox"] {
  background: hsl(230 20% 14%) !important;
  border-color: hsl(0 0% 100% / 0.08) !important;
  color: hsl(0 0% 92%);
}

.admin-panel input::placeholder,
.admin-panel textarea::placeholder {
  color: hsl(220 10% 50%);
}

/* Admin header glass */
.admin-panel .admin-header {
  background: hsl(230 30% 10% / 0.85);
  backdrop-filter: blur(16px);
  border-color: hsl(0 0% 100% / 0.06);
}

/* Neon badge highlights */
.admin-panel .badge-neon-cyan { background: hsl(185 80% 45% / 0.15); color: hsl(185 80% 60%); border-color: hsl(185 80% 45% / 0.3); }
.admin-panel .badge-neon-pink { background: hsl(330 80% 55% / 0.15); color: hsl(330 80% 65%); border-color: hsl(330 80% 55% / 0.3); }
.admin-panel .badge-neon-green { background: hsl(155 70% 45% / 0.15); color: hsl(155 70% 55%); border-color: hsl(155 70% 45% / 0.3); }
.admin-panel .badge-neon-amber { background: hsl(45 90% 50% / 0.15); color: hsl(45 90% 60%); border-color: hsl(45 90% 50% / 0.3); }

/* Finance neon summary cards */
.finance-neon .neon-card {
  background: hsl(230 30% 10% / 0.85) !important;
  backdrop-filter: blur(12px);
  border: 1px solid hsl(0 0% 100% / 0.06) !important;
  border-top: 3px solid hsl(185 80% 50%) !important;
  box-shadow: 0 4px 24px -4px hsl(230 30% 4% / 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
.finance-neon .neon-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px -4px hsl(230 30% 4% / 0.6);
}
.finance-neon .neon-card.neon-cyan { border-top-color: hsl(185 80% 50%) !important; }
.finance-neon .neon-card.neon-green { border-top-color: hsl(155 70% 50%) !important; }
.finance-neon .neon-card.neon-pink { border-top-color: hsl(330 80% 55%) !important; }
.finance-neon .neon-card.neon-amber { border-top-color: hsl(45 90% 55%) !important; }
.finance-neon .neon-card.neon-purple { border-top-color: hsl(270 70% 60%) !important; }
.finance-neon .neon-card.neon-blue { border-top-color: hsl(215 80% 55%) !important; }

.finance-neon .neon-value-cyan { color: hsl(185 80% 60%); }
.finance-neon .neon-value-green { color: hsl(155 70% 55%); }
.finance-neon .neon-value-pink { color: hsl(330 80% 65%); }
.finance-neon .neon-value-amber { color: hsl(45 90% 60%); }
.finance-neon .neon-value-purple { color: hsl(270 70% 65%); }
.finance-neon .neon-value-blue { color: hsl(215 80% 60%); }

.finance-neon .neon-label {
  color: hsl(185 60% 55%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.finance-neon .neon-sublabel {
  color: hsl(220 10% 50%);
  font-size: 0.75rem;
}

/* Finance chart cards */
.finance-neon [data-slot="card"] {
  border-color: hsl(0 0% 100% / 0.08) !important;
}

/* Finance tab navigation */
.finance-neon .finance-tab-active {
  background: hsl(185 80% 50% / 0.15);
  color: hsl(185 80% 60%);
  border: 1px solid hsl(185 80% 50% / 0.3);
}
.finance-neon .finance-tab-inactive {
  color: hsl(220 10% 55%);
}
.finance-neon .finance-tab-inactive:hover {
  background: hsl(0 0% 100% / 0.05);
  color: hsl(0 0% 85%);
}

@layer utilities {
  .animate-delay-100 {
    animation-delay: 100ms;
  }
  .animate-delay-200 {
    animation-delay: 200ms;
  }
  .animate-delay-300 {
    animation-delay: 300ms;
  }
  .animate-delay-400 {
    animation-delay: 400ms;
  }
  .animate-delay-500 {
    animation-delay: 500ms;
  }
}
