/* AnyEvent Responsive Framework */
/* Mobile-first approach with consistent breakpoints */

:root {
  /* Responsive breakpoints */
  --mobile-max: 767px;
  --tablet-min: 768px;
  --tablet-max: 1023px;
  --desktop-min: 1024px;
  --desktop-large-min: 1280px;
  
  /* Spacing scale for consistent mobile spacing */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  
  /* Mobile-optimized font sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  
  /* Touch-friendly sizes */
  --touch-target-min: 44px;
  --button-height-mobile: 48px;
  --input-height-mobile: 48px;
}

/* Base mobile styles */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container system */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

/* Responsive grid system */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Mobile-first responsive grid */
@media (max-width: 767px) {
  /* Do not override Tailwind-like grid-cols classes.
     Use explicit mobile utilities instead. */
  .grid-cols-mobile-1 { grid-template-columns: 1fr; }
  .grid-cols-mobile-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-mobile-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-mobile-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .grid-cols-tablet-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-tablet-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-cols-desktop-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cols-desktop-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flexbox utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

/* Mobile-optimized buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target-min);
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-mobile {
  min-height: var(--button-height-mobile);
  width: 100%;
  font-size: var(--text-base);
}

@media (min-width: 768px) {
  .btn-mobile {
    width: auto;
  }
}

/* Mobile-optimized form inputs */
.form-input {
  width: 100%;
  min-height: var(--input-height-mobile);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: var(--text-base);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Remove conflicting utility definitions to avoid Tailwind collisions */
/* Deleted: .container, .grid, .grid-cols-1..4, .flex, .flex-col, .flex-wrap base utilities */
/* Mobile-optimized form inputs and nav styles remain */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-nav.open { transform: translateX(0); }

.mobile-nav-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
}
.mobile-nav-overlay.open { opacity: 1; visibility: visible; }

/* Hamburger menu */
.hamburger { display: flex; flex-direction: column; justify-content: center; }
.hamburger span { display:block; width:24px; height:2px; background:#1f2937; margin:3px 0; transition: all 0.3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Print styles */
@media print {
  .mobile-nav,
  .hamburger,
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* Normalize mobile "screen" height across devices and browsers */
:root { --safe-screen-h: 100vh; }
@supports (height: 100svh) {
  :root { --safe-screen-h: 100svh; }
}
@supports (height: 100dvh) {
  :root { --safe-screen-h: 100dvh; }
}
.h-screen { height: var(--safe-screen-h) !important; }
.min-h-screen { min-height: var(--safe-screen-h) !important; }
/* Optional: ensure hero sections using viewport units don't overflow */
.hero, .section-hero {
  height: var(--safe-screen-h);
  min-height: var(--safe-screen-h);
}