/* ==========================================================
   Science Fair Projects Showcase
   MOBILE-FIRST PRIORITY DESIGN & LIGHT THEME SYSTEM
   ========================================================== */

/* ----------------------------------------------------------
   1. Design Tokens & Theme Variables (Default Light Theme)
   ---------------------------------------------------------- */
:root {
  /* Light Theme (Primary Default) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fcfdfe;
  --bg-muted: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-focus: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Brand Accents */
  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);
  --accent-blue: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  /* WhatsApp Brand Color */
  --whatsapp-green: #25D366;
  --whatsapp-hover: #20bd5a;
  --whatsapp-bg-light: #ecfdf5;
  --whatsapp-border: #a7f3d0;
  --whatsapp-glow: rgba(37, 211, 102, 0.3);

  /* Specific Category Badges (Light Mode) */
  --cat-agri-bg: #ecfdf5;
  --cat-agri-text: #047857;
  --cat-agri-border: #a7f3d0;

  --cat-waste-bg: #fffbeb;
  --cat-waste-text: #b45309;
  --cat-waste-border: #fde68a;

  --cat-health-bg: #f0f9ff;
  --cat-health-text: #0369a1;
  --cat-health-border: #bae6fd;

  --cat-tech-bg: #f5f3ff;
  --cat-tech-text: #6d28d9;
  --cat-tech-border: #ddd6fe;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 32px rgba(15, 23, 42, 0.12);
  --shadow-bottom-sheet: 0 -8px 30px rgba(0, 0, 0, 0.15);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides (Secondary Toggle) */
body.dark-theme {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-surface: #172033;
  --bg-card: #131b2e;
  --bg-card-hover: #1a253d;
  --bg-muted: #1e293b;
  --bg-glass: rgba(17, 24, 39, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-focus: #818cf8;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);

  --cat-agri-bg: rgba(16, 185, 129, 0.15);
  --cat-agri-text: #34d399;
  --cat-agri-border: rgba(16, 185, 129, 0.3);

  --cat-waste-bg: rgba(245, 158, 11, 0.15);
  --cat-waste-text: #fbbf24;
  --cat-waste-border: rgba(245, 158, 11, 0.3);

  --cat-health-bg: rgba(6, 182, 212, 0.15);
  --cat-health-text: #38bdf8;
  --cat-health-border: rgba(6, 182, 212, 0.3);

  --cat-tech-bg: rgba(168, 85, 247, 0.15);
  --cat-tech-text: #c084fc;
  --cat-tech-border: rgba(168, 85, 247, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-bottom-sheet: 0 -8px 30px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------------------------
   2. Base & Typography
   ---------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 14.5px;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

/* Ambient glow subtle effects */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -80px;
  right: -80px;
}

.orb-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #10b981, transparent 70%);
  bottom: 5%;
  left: -100px;
}

.orb-3 {
  display: none;
}

/* ----------------------------------------------------------
   3. Mobile-First Navigation Header
   ---------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-normal);
}

.nav-container {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  max-width: 1320px;
  margin: 0 auto;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
}

.logo-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.logo-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.sub-logo {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  min-width: 40px;
  padding: 0.45rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.nav-btn .btn-label {
  display: none;
}

.nav-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.nav-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.nav-badge {
  background: var(--accent-primary);
  color: white;
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.nav-btn.active .nav-badge {
  background: #ffffff;
  color: var(--accent-primary);
}

.theme-icon-light {
  display: inline-block;
  color: #f59e0b;
}

.theme-icon-dark {
  display: none;
  color: #818cf8;
}

body.dark-theme .theme-icon-light {
  display: none;
}

body.dark-theme .theme-icon-dark {
  display: inline-block;
}

/* ----------------------------------------------------------
   4. Mobile Hero Section
   ---------------------------------------------------------- */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1rem 1rem;
  text-align: center;
}

.hero-content {
  max-width: 780px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

body.dark-theme .hero-badge {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.22;
  margin-bottom: 0.5rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.80rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

/* Touch-Optimized Search Input */
.search-bar-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.6rem 0.35rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.search-input-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), var(--shadow-md);
  background: #ffffff;
}

body.dark-theme .search-input-box:focus-within {
  background: var(--bg-card-hover);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1rem;
  margin-right: 0.6rem;
}

.search-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  height: 38px;
}

.search-input-box input::placeholder {
  color: var(--text-subtle);
  font-size: 0.88rem;
}

.clear-search-btn {
  background: var(--bg-muted);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

/* ----------------------------------------------------------
   5. Filter & Controls Section (Category Dropdown & Sort)
   ---------------------------------------------------------- */
.main-container {
  padding: 0.5rem 1rem 3.5rem;
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.filter-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.filter-controls-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.category-dropdown-group,
.sort-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-label i {
  color: var(--accent-primary);
  font-size: 0.82rem;
}

/* Modern Select Box */
.custom-select-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.custom-select-box:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: #ffffff;
}

body.dark-theme .custom-select-box:hover {
  background: var(--bg-card-hover);
}

.custom-select-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: #ffffff;
}

body.dark-theme .custom-select-box:focus-within {
  background: var(--bg-card-hover);
}

.category-icon-indicator {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  color: var(--accent-primary);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.select-arrow {
  position: absolute;
  right: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
}

.custom-select-box select {
  width: 100%;
  min-height: 46px;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.65rem 2.2rem 0.65rem 2.6rem;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.sort-select-box select {
  padding-left: 1rem;
}

.custom-select-box select option {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.6rem;
}

.controls-right-group {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
}

.controls-right-group .sort-dropdown-group {
  flex: 1;
}

.view-mode-toggle {
  display: none; /* Auto-enabled on larger screens */
}

/* Stats Bar */
.results-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0.25rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.highlight-stat {
  color: var(--text-primary);
  font-weight: 700;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 0.3rem;
}

body.dark-theme .active-filter-pill {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.4);
}

.info-tag {
  display: none; /* Hide helper note on mobile */
}

/* ----------------------------------------------------------
   6. Mobile Project Cards (Primary Touch UI)
   ---------------------------------------------------------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-card:active {
  transform: scale(0.99);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.project-id-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.card-category-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68%;
}

.cat-badge-agri {
  background: var(--cat-agri-bg);
  color: var(--cat-agri-text);
  border: 1px solid var(--cat-agri-border);
}

.cat-badge-waste {
  background: var(--cat-waste-bg);
  color: var(--cat-waste-text);
  border: 1px solid var(--cat-waste-border);
}

.cat-badge-health {
  background: var(--cat-health-bg);
  color: var(--cat-health-text);
  border: 1px solid var(--cat-health-border);
}

.cat-badge-tech {
  background: var(--cat-tech-bg);
  color: var(--cat-tech-text);
  border: 1px solid var(--cat-tech-border);
}

.id-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.special-flag-badge {
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  color: #db2777;
  border: 1px solid #fbcfe8;
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  letter-spacing: 0.02em;
}

body.dark-theme .special-flag-badge {
  background: rgba(219, 39, 119, 0.18);
  color: #f472b6;
  border-color: rgba(219, 39, 119, 0.35);
}

.cat-badge-special {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

body.dark-theme .cat-badge-special {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.3);
}

.project-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.problem-snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
  line-height: 1.4;
  position: relative;
  padding-left: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2rem;
}

.problem-snippet::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-rose);
  font-size: 1rem;
  line-height: 1;
}

.card-tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  min-height: 1.6rem;
}

.tech-chip {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.tech-chip i {
  color: var(--accent-primary);
  font-size: 0.6rem;
}

/* Card Touch Actions */
.card-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-details {
  flex: 1;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
  transition: all var(--transition-fast);
}

.btn-details:active {
  background: var(--accent-primary-hover);
  transform: scale(0.98);
}

.btn-quick-price {
  min-width: 40px;
  min-height: 40px;
  background: var(--whatsapp-bg-light);
  border: 1px solid var(--whatsapp-border);
  color: #047857;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

body.dark-theme .btn-quick-price {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: #25D366;
}

.btn-quick-fav {
  min-width: 38px;
  min-height: 40px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  cursor: pointer;
}

.btn-quick-fav.favorited {
  color: var(--accent-rose);
  background: #fff1f2;
  border-color: #fecdd3;
}

body.dark-theme .btn-quick-fav.favorited {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
}

/* ----------------------------------------------------------
   7. Mobile Bottom Sheet / Modal Details Card
   ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-end; /* Bottom sheet on mobile */
  justify-content: center;
  padding: 0;
  animation: modalFadeIn 0.2s forwards ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-bottom-sheet);
  animation: slideUpMobile 0.28s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpMobile {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Top bar with drag-handle feel */
.modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-muted);
  gap: 0.5rem;
  position: relative;
}

.modal-top-bar::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-subtle);
}

.modal-id-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  background: var(--accent-gradient);
  color: #ffffff;
}

.modal-category-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  margin-right: auto;
  margin-left: 0.35rem;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-action-btn, .close-modal-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
}

.close-modal-btn {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

body.dark-theme .close-modal-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.icon-action-btn.favorited {
  color: var(--accent-rose);
  background: #fff1f2;
  border-color: #fecdd3;
}

/* Modal Scrollable Body */
.modal-body {
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
}

.modal-sub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-muted);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
}

.detail-box {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

.detail-box-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.box-icon {
  font-size: 0.85rem;
}

.problem-box .box-icon {
  color: var(--accent-rose);
}

.tech-box .box-icon {
  color: var(--accent-blue);
}

.box-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.box-desc {
  font-size: 0.80rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.tech-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.tech-tag-badge {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

body.dark-theme .tech-tag-badge {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

.pricing-notice-box {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.74rem;
}

body.dark-theme .pricing-notice-box {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.pricing-notice-box i {
  font-size: 1.15rem;
  color: #059669;
}

.pricing-notice-box strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.pricing-notice-box p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.76rem;
}

/* Modal Bottom Sticky Actions */
.modal-footer {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-nav-buttons {
  display: flex;
  gap: 0.4rem;
}

.btn-secondary {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  min-height: 48px;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-whatsapp {
  flex: 1;
  min-height: 48px;
  background: var(--whatsapp-green);
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 4px 12px var(--whatsapp-glow);
  transition: all var(--transition-fast);
}

.btn-whatsapp:active {
  background: var(--whatsapp-hover);
  transform: scale(0.98);
}

.btn-whatsapp i {
  font-size: 1.25rem;
}

/* ----------------------------------------------------------
   8. WhatsApp Config Modal
   ---------------------------------------------------------- */
.config-card {
  max-width: 480px;
}

.modal-title-simple {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-green {
  color: #059669;
}

.config-text {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
}

.input-with-icon input {
  width: 100%;
  background: var(--bg-muted);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem 0.65rem 2.4rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.input-with-icon input:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.helper-text {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.message-preview-box {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.preview-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.preview-bubble {
  background: #ecfdf5;
  border-left: 3px solid var(--whatsapp-green);
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #065f46;
  line-height: 1.4;
}

body.dark-theme .preview-bubble {
  background: rgba(37, 211, 102, 0.12);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  min-height: 44px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.justify-end {
  justify-content: flex-end;
}

/* ----------------------------------------------------------
   9. Empty State & Toast Notification
   ---------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.empty-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  z-index: 2000;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 90vw;
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideUp {
  from { transform: translate(-50%, 100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.toast-icon {
  color: #34d399;
  font-size: 1rem;
}

/* ----------------------------------------------------------
   10. Footer
   ---------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.8rem 1rem;
  background: var(--bg-surface);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-content {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-brand-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.footer-brand-link:hover {
  text-decoration: underline;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent-primary);
}

.nav-home-btn {
  text-decoration: none;
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-primary);
  border-color: rgba(79, 70, 229, 0.25);
}

.nav-home-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.footer-stats span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ----------------------------------------------------------
   11. Tablet & Desktop Responsive Scaling (Scale-Up)
   ---------------------------------------------------------- */
@media (min-width: 640px) {
  .filter-controls-row {
    flex-direction: row;
    align-items: flex-end;
    gap: 1rem;
  }

  .category-dropdown-group {
    flex: 1.6;
  }

  .controls-right-group {
    flex: 1.4;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 0.98rem;
  }

  .nav-btn .btn-label {
    display: inline;
  }

  .sub-logo {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
  }
}

@media (min-width: 992px) {
  .hero-section {
    padding: 3rem 1.5rem 1.75rem;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .view-mode-toggle {
    display: flex;
    background: var(--bg-muted);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    padding: 0.15rem;
  }

  .view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.35rem 0.55rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
  }

  .view-btn.active {
    background: var(--accent-primary);
    color: #ffffff;
  }

  .info-tag {
    display: inline-block;
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Center dialog modal on desktop instead of bottom sheet */
  .modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }

  .modal-card {
    border-radius: var(--radius-lg);
    max-height: 85vh;
    animation: modalPopDesktop 0.25s forwards cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes modalPopDesktop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }

  .modal-top-bar::before {
    display: none;
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }

  /* List view styles for desktop */
  .projects-list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .projects-list-view .project-card {
    flex-direction: row;
    align-items: center;
    padding: 0.85rem 1.25rem;
    gap: 1.25rem;
  }

  .projects-list-view .card-main-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .projects-list-view .project-title {
    font-size: 0.98rem;
    margin-bottom: 0;
    flex: 2;
  }

  .projects-list-view .problem-snippet {
    margin-bottom: 0;
    flex: 3;
  }

  .projects-list-view .card-actions-bar {
    padding-top: 0;
    border-top: none;
  }
}
