/**
 * ST77 Design System - Based on Next.js/React Design
 * Modern waste management platform styling
 */

/* ============================================
   CSS CUSTOM PROPERTIES (COLOR SYSTEM)
   ============================================ */

:root {
  /* Color System - OKLch format converted to HSL for broader browser support */
  --background: #f5f4f0;
  --foreground: #2d2e2e;
  --card: #fafaf8;
  --card-foreground: #2d2e2e;
  --primary: #383939;
  --primary-foreground: #f5f4f0;
  --secondary: #efefed;
  --secondary-foreground: #383939;
  --muted: #e8e8e6;
  --muted-foreground: #737373;
  --accent: #3da88a;
  --accent-foreground: #fafaf8;
  --border: #e0e0dd;
  --input: #e0e0dd;
  --ring: #3da88a;

  /* Chart colors */
  --chart-1: #3da88a;
  --chart-2: #5eb3d9;
  --chart-3: #4a5c8a;
  --chart-4: #f4c542;
  --chart-5: #e88d4b;

  /* Border radius */
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-serif: 'Outfit', Georgia, serif;
  --font-mono: 'Monaco', 'Courier New', monospace;

  /* Spacing scale */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.5;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: 1.5rem;
}

p {
  line-height: 1.625;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 1024px) {
  .section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all var(--transition-base);
}

.site-header.scrolled {
  background-color: rgba(245, 244, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar {
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  transition: transform var(--transition-fast);
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--primary);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 12px rgba(61, 168, 138, 0.2);
  transition: box-shadow var(--transition-fast);
}

.navbar-brand:hover .brand-icon {
  box-shadow: 0 6px 16px rgba(61, 168, 138, 0.3);
}

.brand-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary-foreground);
}

.navbar-nav {
  display: none;
  list-style: none;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .navbar-nav {
    display: flex;
  }
}

.navbar-nav a {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.navbar-nav a:hover {
  color: var(--foreground);
  background-color: rgba(239, 239, 237, 0.5);
}

.navbar-cta {
  display: none;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .navbar-cta {
    display: flex;
  }
}

/* Mobile menu */
.mobile-menu-toggle {
  display: block;
  padding: 0.625rem;
  background: none;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-toggle:hover {
  background-color: var(--secondary);
}

.mobile-menu {
  display: block;
  padding: 1.5rem 0;
  background-color: rgba(245, 244, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 1rem 1rem;
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none;
  }
}

.mobile-menu-hidden {
  display: none;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.mobile-menu a:hover {
  color: var(--foreground);
  background-color: var(--secondary);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 4px 12px rgba(56, 57, 57, 0.2);
}

.btn-primary:hover {
  background-color: rgba(56, 57, 57, 0.9);
  box-shadow: 0 6px 16px rgba(56, 57, 57, 0.25);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--card);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 4px 12px rgba(61, 168, 138, 0.2);
}

.btn-accent:hover {
  background-color: rgba(61, 168, 138, 0.9);
  box-shadow: 0 6px 16px rgba(61, 168, 138, 0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background-color: rgba(239, 239, 237, 0.5);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  height: 3.5rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-description {
  color: var(--muted-foreground);
  line-height: 1.625;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-accent {
  background-color: rgba(61, 168, 138, 0.1);
  color: var(--accent);
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-success {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */

.decorative-blur {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}

.decorative-blur-accent {
  background-color: rgba(61, 168, 138, 0.15);
}

.decorative-blur-primary {
  background-color: rgba(56, 57, 57, 0.1);
}

.grid-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fillRule='evenodd'%3E%3Cg fill='%23000000' fillOpacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ============================================
   RESPONSIVE GRID
   ============================================ */

.grid-cols-1 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted-foreground);
}

.text-accent {
  color: var(--accent);
}

.relative {
  position: relative;
}

.overflow-hidden {
  overflow: hidden;
}

.transition-all {
  transition: all var(--transition-base);
}

/* Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}
