@import "tailwindcss";
@import "./variables.css";
@import "tw-animate-css";

@plugin "tailwindcss-animate";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
  html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
  }
}

/* Full-height sections */
.section-full-height {
  min-height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* Footer should not snap and should be reachable */
footer {
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}

/* Graceful degradation for browsers without scroll snap support */
@supports not (scroll-snap-type: y mandatory) {
  .section-full-height {
    min-height: 100vh;
  }
}

/* Feature card hover effects */
.feature-card {
  transition: all 0.3s ease;
}

.feature-card.hover-active {
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--primary);
}

.feature-card.hover-active .gradient-overlay {
  opacity: 0.05;
}

/* Focus states for keyboard navigation */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.feature-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Hero gradient animation - Grafana-style */
@keyframes gradient-fade-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(0.7);
  }
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes gradient-pulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.35;
  }
}

.hero-gradient {
  animation: gradient-fade-in 2s ease-out forwards,
             gradient-pulse 8s ease-in-out 2s infinite;
  opacity: 0;
}


/* Mobile Menu Animations */
.mobile-menu.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.mobile-menu:not(.hidden) {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu:not(.hidden).mobile-menu-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu-content {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu.mobile-menu-open .mobile-menu-content {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
