/* IDF Mobile-First Optimized Theme System */

/* Color Palette - Green & Blue with Complementary Orange */
:root {
  /* Primary Colors */
  --primary-green: #10B981; /* Medium green */
  --primary-blue: #3B82F6;  /* Medium light blue */
  --accent-orange: #FB923C; /* Complementary orange */
  
  /* Extended Palette */
  --green-50: #F0FDF4;
  --green-100: #DCFCE7;
  --green-200: #BBF7D0;
  --green-500: #10B981;
  --green-600: #059669;
  --green-700: #047857;
  --green-900: #064E3B;
  
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-900: #1E3A8A;
  
  --orange-50: #FFF7ED;
  --orange-100: #FFEDD5;
  --orange-200: #FED7AA;
  --orange-500: #FB923C;
  --orange-600: #EA580C;
  
  /* Neutral Colors */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  /* Semantic Colors */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --bg-primary: #FFFFFF;
  --bg-secondary: var(--gray-50);
  --border-light: var(--gray-200);
  
  /* Typography - Mobile First */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Roboto', system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Roboto', system-ui, sans-serif;
  
  /* Font Weights - Lighter for Mobile */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Typography Scale - Mobile First */
  --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 */
  --text-4xl: 2.25rem;   /* 36px */
  
  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  
  /* Spacing Scale */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;
  
  /* Shadows - Subtle for Mobile */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Touch Targets - WCAG 2.1 AA Compliance */
  --touch-target-min: 44px;
  --touch-target-optimal: 48px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset for Mobile */
* {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
  touch-action: manipulation;
}

/* Ensure all interactive elements meet touch target requirements */
button, a, [role="button"], input, select, textarea {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Gradient Classes for Tailwind Compatibility */
.from-primary-blue {
  --tw-gradient-from: var(--primary-blue);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(59, 130, 246, 0));
}

.to-primary-green {
  --tw-gradient-to: var(--primary-green);
}

.from-primary-green {
  --tw-gradient-from: var(--primary-green);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(16, 185, 129, 0));
}

.to-primary-blue {
  --tw-gradient-to: var(--primary-blue);
}

/* Typography Globals */
body {
  font-family: var(--font-primary);
  font-weight: var(--font-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Heading Styles - Lighter Weights for Mobile */
h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-light);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-light);
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-regular);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h4, .h4 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
}

h5, .h5 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
}

h6, .h6 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
}

/* Body Text */
p, .body-text {
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.text-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.text-caption {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

/* Hero Achievement Tiles - Transparent, Borderless */
.hero-stat-tile {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  text-align: center;
  flex: 1;
  min-width: 0;
}

.hero-stat-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--orange-500);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.hero-stat-label {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.2;
}

/* Expandable Testimonial Cards */
.testimonial-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid var(--border-light);
  max-width: 100%;
}

.testimonial-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-xs);
}

.testimonial-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary-green), var(--primary-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}

.testimonial-info {
  flex: 1;
  min-width: 0;
}

.testimonial-name {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.testimonial-role {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.testimonial-preview {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.testimonial-expand-icon {
  color: var(--primary-blue);
  font-size: var(--text-sm);
  margin-left: auto;
}

/* Details/Summary Styles for Testimonials */
.testimonial-card summary {
  cursor: pointer;
  outline: none;
  list-style: none;
}

.testimonial-card summary::-webkit-details-marker {
  display: none;
}

.testimonial-content {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Core Initiative Cards - Compact */
.initiative-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary-green);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.initiative-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-lg);
}

.initiative-content {
  flex: 1;
  min-width: 0;
}

.initiative-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.initiative-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* Hub Architecture - Compact Triangle */
.hub-diagram {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
}

.hub-node {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 280px;
  text-align: center;
  position: relative;
}

.hub-node-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
  font-size: var(--text-2xl);
}

.hub-node-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.hub-node-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Connection Arrow */
.hub-arrow {
  width: 2px;
  height: 24px;
  background: var(--gray-300);
  position: relative;
  margin: var(--space-2) 0;
}

.hub-arrow::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--gray-300);
}

/* Get Involved - Consolidated Actions */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
}

.action-tile {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid var(--border-light);
  min-height: var(--touch-target-min);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.action-tile:active {
  transform: scale(0.97);
  background: var(--gray-50);
}

.action-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.action-tile-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  line-height: 1.2;
}

/* Community Feedback Cards */
.feedback-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  max-width: 100%;
}

.feedback-quote {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  font-style: italic;
  margin-bottom: var(--space-3);
}

.feedback-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.feedback-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  flex-shrink: 0;
}

.feedback-author-info {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.feedback-author-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

/* Responsive Breakpoints */
@media (min-width: 640px) {
  :root {
    --text-3xl: 2.25rem;  /* 36px */
    --text-4xl: 2.75rem;  /* 44px */
  }
  
  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  :root {
    --text-3xl: 2.5rem;   /* 40px */
    --text-4xl: 3rem;     /* 48px */
  }
  
  h1, .h1 {
    font-size: var(--text-4xl);
  }
  
  .action-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .hub-diagram {
    flex-direction: row;
    justify-content: center;
  }
  
  .hub-arrow {
    width: 48px;
    height: 2px;
    margin: 0 var(--space-2);
  }
  
  .hub-arrow::after {
    bottom: auto;
    left: auto;
    right: -8px;
    top: -4px;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--gray-300);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --bg-primary: #1F2937;
    --bg-secondary: #111827;
    --border-light: #374151;
  }
  
  .hero-stat-tile {
    background: rgba(0, 0, 0, 0.2);
  }
  
  .testimonial-card,
  .initiative-card,
  .hub-node,
  .action-tile,
  .feedback-card {
    background: var(--bg-primary);
    border-color: var(--border-light);
  }
}