/* 
   1. VARIABLES & GLOBAL STYLES
    */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  --primary-blue: #1877f2;
  --primary-blue-hover: #166fe5;
  --primary-blue-light: rgba(24, 119, 242, 0.1);
  --secondary-gray: #42526e;
  --light-gray: #f0f2f5;
  --border-gray: #e4e6ea;
  --text-primary: #1c1e21;
  --text-secondary: #65676b;
  --success-green: #42b883;
  --warning-orange: #ff6b35;
  --error-red: #e74c3c;
  --white: #ffffff;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-large: 0 8px 32px rgba(0, 0, 0, 0.12);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-hero: linear-gradient(135deg, rgba(24, 119, 242, 0.9) 0%, rgba(102, 126, 234, 0.9) 100%);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--light-gray);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.page { display: none; }
.page.active { display: block; }
.hidden { display: none !important; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* 
   2. BUTTONS & UTILITIES
    */
.btn-primary {
  background: var(--gradient-primary); color: white; border: none; padding: 12px 24px;
  border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background-color: var(--white); color: var(--text-primary); border: 2px solid var(--border-gray);
  padding: 12px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px;
}
.btn-secondary:hover { border-color: var(--primary-blue); color: var(--primary-blue); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-urgent {
  background: linear-gradient(135deg, var(--error-red), #c0392b); color: white; border: none;
  padding: 16px 32px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-size: 16px;
}
.btn-urgent:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4); }

.btn-large { padding: 16px 32px; font-size: 16px; border-radius: 12px; }
.btn-full { width: 100%; justify-content: center; }
.nav-btn { padding: 10px 20px; font-size: 14px; border-radius: 8px; }

/* Premium Button Effects */
.glow-btn { box-shadow: 0 0 20px rgba(24, 119, 242, 0.4); }
.glow-btn:hover { box-shadow: 0 0 30px rgba(24, 119, 242, 0.6); }

.pulse-btn { animation: pulse-glow 2s infinite; }
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* 
   3. ANIMATIONS
    */
.animate-slide-up { animation: slideUp 1s ease-out both; }
.animate-slide-left { animation: slideLeft 1s ease-out both; }
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes float { 0%, 100% { transform: translateY(0px) rotate(0deg); } 33% { transform: translateY(-20px) rotate(120deg); } 66% { transform: translateY(10px) rotate(240deg); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* 
   4. LANDING PAGE: HERO SECTION
    */
.hero-container { position: relative; min-height: 100vh; overflow: hidden; }

.mesh-gradient {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: 
    radial-gradient(circle at 15% 50%, rgba(24, 119, 242, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(118, 75, 162, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(102, 126, 234, 0.3) 0%, transparent 50%);
  z-index: 1;
}

.hero-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--gradient-hero); z-index: 1; }
.floating-shapes { position: absolute; width: 100%; height: 100%; overflow: hidden; }
.shape { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.1); animation: float 6s ease-in-out infinite; }
.shape-1 { width: 80px; height: 80px; top: 20%; left: 10%; }
.shape-2 { width: 120px; height: 120px; top: 60%; right: 15%; animation-delay: 2s; }
.shape-3 { width: 60px; height: 60px; bottom: 30%; left: 20%; animation-delay: 4s; }

.landing-header { position: relative; z-index: 100; backdrop-filter: blur(10px); background: rgba(255, 255, 255, 0.1); border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.nav-brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-icon { width: 48px; height: 48px; background: rgba(255, 255, 255, 0.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.brand-text { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.nav-actions { display: flex; gap: 16px; align-items: center; }

.hero-section { position: relative; z-index: 2; display: flex; align-items: center; padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; gap: 4rem; min-height: calc(100vh - 80px); flex-wrap: wrap; }
.hero-content { flex: 1; color: white; min-width: 300px; }

.trust-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.15); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3); padding: 8px 16px;
  border-radius: 50px; color: white; font-size: 0.9rem; font-weight: 600; margin-bottom: 1.5rem;
}
.trust-badge i { color: var(--success-green); }

.hero-title { font-size: 4rem; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -1px; color: white; }
.title-accent { background: linear-gradient(135deg, #ffd700, #ffed4e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-description { font-size: 1.2rem; line-height: 1.7; margin-bottom: 2rem; opacity: 0.9; max-width: 600px; }

/* Update your .hero-stats to use Grid for perfect 3-column layout */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Forces exactly 3 equal columns */
  gap: 1rem; /* Reduced gap slightly so they fit better side-by-side */
  margin-bottom: 3rem;
  width: 100%;
}

/* Update .stat-card to allow shrinking */
.stat-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.25rem 0.5rem; /* Slightly adjusted padding */
  border-radius: 16px;
  text-align: center;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 0; /* CRITICAL: This allows the card to shrink instead of wrapping */
  width: 100%;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: #ffd700;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem; /* Slightly smaller text to fit better */
  opacity: 0.8;
  font-weight: 500;
  line-height: 1.2;
}

.hero-actions { display: flex; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }

.hero-visual { flex: 1; position: relative; min-width: 300px; }
.hero-image-container { position: relative; }
.hero-image { width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow-large); }
.floating-cards { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.floating-card { position: absolute; background: white; padding: 0.75rem 1rem; border-radius: 12px; box-shadow: var(--shadow-hover); display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; animation: float 3s ease-in-out infinite; white-space: nowrap; }
.floating-card i { color: var(--primary-blue); }
.card-1 { top: 15%; right: -5%; }
.card-2 { bottom: 25%; left: -10%; animation-delay: 1s; }
.card-3 { top: 55%; right: -8%; animation-delay: 2s; }

/* 
   5. LANDING PAGE: SECTIONS
    */
.trust-bar {
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-gray); padding: 1.5rem 0; position: relative; z-index: 10;
}
.trust-items { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 0.75rem; color: var(--text-primary); font-weight: 600; font-size: 0.95rem; }
.trust-item i { color: var(--primary-blue); font-size: 1.2rem; }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-tag {
  display: inline-block; background: var(--primary-blue-light); color: var(--primary-blue);
  padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1rem;
}
.section-title { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; color: var(--text-primary); }
.section-subtitle { font-size: 1.2rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

.features-section { padding: 6rem 0; background: white; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; margin-top: 3rem; }
.feature-card {
  background: white; padding: 2rem; border-radius: 16px; border: 1px solid var(--border-gray);
  text-align: center; transition: all 0.3s ease; position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: var(--gradient-primary); transform: scaleX(0); transition: transform 0.3s ease;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-large); border-color: transparent; }
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon-wrapper {
  width: 70px; height: 70px; background: var(--primary-blue-light); border-radius: 20px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
  font-size: 1.8rem; color: var(--primary-blue); transition: all 0.3s ease;
}
.feature-card:hover .feature-icon-wrapper { background: var(--primary-blue); color: white; transform: scale(1.1) rotate(5deg); }
.feature-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-primary); }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

.success-stories { padding: 6rem 0; background: var(--light-gray); }
.stories-carousel { display: flex; gap: 2rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }
.story-card { 
  background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); 
  max-width: 350px; width: 100%; transition: all 0.3s ease; border: 1px solid var(--border-gray);
}
.story-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-large); }
.story-image { height: 220px; overflow: hidden; position: relative; }
.story-image::after {
  content: '\f10d'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 15px; right: 15px; font-size: 2rem;
  color: rgba(255, 255, 255, 0.8); text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.story-image img { width: 100%; height: 100%; object-fit: cover; }
.story-content { padding: 1.5rem; }
.story-content h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.story-content p { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; font-style: italic; }
.story-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.story-location { color: var(--primary-blue); font-weight: 600; }

.cta-section { padding: 6rem 0; background: var(--gradient-primary); color: white; text-align: center; }
.cta-content h2 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; }
.cta-content p { font-size: 1.2rem; margin-bottom: 2rem; opacity: 0.9; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.landing-footer { background: #0f172a; color: white; padding: 5rem 0 2rem; }
.footer-content { display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; margin-bottom: 2rem; }
.footer-brand p { margin-top: 1.5rem; opacity: 0.7; line-height: 1.6; max-width: 300px; }
.social-links { display: flex; gap: 1rem; margin-top: 1.5rem; }
.social-links a {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center; color: white;
  text-decoration: none; transition: all 0.3s ease;
}
.social-links a:hover { background: var(--primary-blue); transform: translateY(-3px); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer-column h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }
.footer-column a {
  display: block; color: rgba(255, 255, 255, 0.6); text-decoration: none; margin-bottom: 0.75rem;
  cursor: pointer; transition: all 0.2s ease;
}
.footer-column a:hover { color: white; padding-left: 5px; }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.1); opacity: 0.8; }

/* 
   6. DASHBOARD: LAYOUT & NAVIGATION
    */
.main-header { background: white; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.5rem; position: sticky; top: 0; z-index: 100; flex-wrap: wrap; gap: 0.5rem; }
.header-left { display: flex; align-items: center; gap: 1.5rem; flex: 1; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; font-weight: 800; color: var(--primary-blue); flex-shrink: 0; }
.search-container { display: flex; align-items: center; position: relative; flex: 1; max-width: 400px; }
.search-input { width: 100%; padding: 10px 16px; border: 2px solid var(--border-gray); border-radius: 25px; background-color: var(--light-gray); font-size: 14px; }
.search-input:focus { outline: none; border-color: var(--primary-blue); background-color: white; }
.header-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.profile-dropdown { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 25px; cursor: pointer; }
.profile-dropdown:hover { background-color: var(--light-gray); }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border-gray); object-fit: cover; }
.profile-arrow { color: var(--text-secondary); font-size: 12px; }

.header-btn { background: none; border: none; padding: 10px; border-radius: 50%; cursor: pointer; position: relative; color: var(--text-secondary); font-size: 1.1rem; }
.header-btn:hover { background-color: var(--light-gray); color: var(--primary-blue); }
.notification-badge { position: absolute; top: 2px; right: 2px; background: var(--error-red); color: white; border-radius: 50%; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.main-nav { background: white; display: flex; justify-content: center; box-shadow: var(--shadow); border-bottom: 1px solid var(--border-gray); overflow-x: auto; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 1rem 2rem; background: none; border: none; cursor: pointer; color: var(--text-secondary); border-bottom: 3px solid transparent; font-weight: 500; white-space: nowrap; }
.nav-item:hover, .nav-item.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); background-color: var(--primary-blue-light); }
.nav-item i { font-size: 1.2rem; }

.main-content { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.content-layout { display: grid; grid-template-columns: 280px 1fr 280px; gap: 1.5rem; align-items: start; }

/* 
   7. DASHBOARD: SIDEBARS & FEED
    */
.sidebar-left, .sidebar-right { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-section { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border-gray); }
.sidebar-section h3 { margin-bottom: 1rem; color: var(--text-primary); font-weight: 700; font-size: 1.1rem; }
.sidebar-btn { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 12px 16px; background: none; border: 2px solid var(--border-gray); border-radius: 8px; cursor: pointer; margin-bottom: 0.75rem; font-weight: 500; color: var(--text-primary); text-align: left; }
.sidebar-btn:hover { border-color: var(--primary-blue); background-color: var(--primary-blue-light); color: var(--primary-blue); }

.emergency-contacts { display: flex; flex-direction: column; gap: 0.75rem; }
.contact-item { display: flex; flex-direction: column; gap: 0.25rem; padding: 12px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border-gray); }
.contact-item:hover { background-color: var(--light-gray); border-color: var(--primary-blue); }
.contact-item strong { color: var(--text-primary); font-weight: 600; }
.contact-item span { color: var(--primary-blue); font-weight: 600; font-size: 1.1rem; }

.main-feed { display: flex; flex-direction: column; gap: 1.5rem; }
.post-creator { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border-gray); }
.post-creator-header { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border-gray); object-fit: cover; }
.post-input { flex: 1; padding: 14px 20px; border: 2px solid var(--border-gray); border-radius: 25px; background: var(--light-gray); text-align: left; cursor: pointer; color: var(--text-secondary); font-size: 16px; }
.post-input:hover { border-color: var(--primary-blue); background-color: white; }

.status-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
.status-tab { display: flex; align-items: center; gap: 0.5rem; padding: 10px 16px; border-radius: 25px; cursor: pointer; white-space: nowrap; border: 2px solid transparent; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.9rem; }
.status-tab.active { background: var(--primary-blue); color: white; }
.status-tab.urgent { background: rgba(231, 76, 60, 0.1); border-color: var(--error-red); color: var(--error-red); }
.status-tab.missing { background: rgba(255, 193, 7, 0.1); border-color: var(--warning-orange); color: var(--warning-orange); }
.status-tab.found { background: rgba(66, 184, 131, 0.1); border-color: var(--success-green); color: var(--success-green); }
.status-tab.all { background: var(--primary-blue-light); border-color: var(--primary-blue); color: var(--primary-blue); }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.urgent-indicator { background: var(--error-red); }
.missing-indicator { background: var(--warning-orange); }
.found-indicator { background: var(--success-green); }

.feed-posts { display: flex; flex-direction: column; gap: 1.5rem; }
.post-card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border-gray); }
.post-card:hover { box-shadow: var(--shadow-hover); }
.post-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.post-info h4 { margin: 0; color: var(--text-primary); font-weight: 700; }
.post-time { color: var(--text-secondary); font-size: 0.9rem; }
.post-status { padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; margin-left: auto; text-transform: uppercase; letter-spacing: 0.5px; }
.post-status.urgent, .post-status.pending { background: var(--error-red); color: white; }
.post-status.found { background: var(--success-green); color: white; }
.post-content { margin-bottom: 1rem; line-height: 1.6; }
.missing-person-details { display: flex; gap: 1rem; margin-top: 1rem; padding: 1.5rem; background: var(--light-gray); border-radius: 12px; border: 1px solid var(--border-gray); flex-wrap: wrap; }
.missing-photo { width: 150px; height: 200px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border-gray); flex-shrink: 0; }
.details { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; min-width: 200px; }
.detail-item { display: flex; gap: 0.5rem; }
.detail-item strong { min-width: 120px; color: var(--text-primary); font-weight: 600; }
.post-actions { display: flex; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-gray); flex-wrap: wrap; }
.action-btn { display: flex; align-items: center; gap: 0.5rem; padding: 10px 16px; background: none; border: none; border-radius: 8px; cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.action-btn:hover { background-color: var(--light-gray); color: var(--primary-blue); }

.groups-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.groups-header h2 { font-size: 2rem; font-weight: 800; color: var(--text-primary); }

/* 
   8. MODALS & FORMS
    */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal.hidden { display: none; }
.modal-content { background: white; border-radius: 16px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-large); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem; border-bottom: 1px solid var(--border-gray); background: var(--light-gray); border-radius: 16px 16px 0 0; position: sticky; top: 0; z-index: 10; }
.modal-header h3 { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-secondary); padding: 8px; border-radius: 50%; }
.modal-close:hover { background-color: var(--border-gray); color: var(--error-red); }

.post-form { padding: 1.5rem; }
.form-section { margin-bottom: 2rem; }
.form-section h4 { margin-bottom: 1rem; color: var(--text-primary); font-weight: 700; font-size: 1.1rem; }
.form-group { flex: 1; margin-bottom: 1rem; position: relative; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-secondary); font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 2px solid var(--border-gray); border-radius: 8px; font-size: 14px; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 3px var(--primary-blue-light); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto !important; }

.photo-upload { border: 2px dashed var(--border-gray); border-radius: 12px; padding: 2rem; text-align: center; cursor: pointer; position: relative; transition: all 0.3s ease; }
.photo-upload.compact { padding: 1rem; }
.photo-upload:hover { border-color: var(--primary-blue); background-color: var(--primary-blue-light); }
.photo-upload input { display: none; }
.upload-label { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--text-secondary); }
.upload-label i { font-size: 2.5rem; color: var(--primary-blue); }
.photo-preview { position: relative; display: inline-block; }
.photo-preview img { max-width: 200px; max-height: 200px; border-radius: 8px; border: 2px solid var(--border-gray); object-fit: cover; }
.remove-photo { position: absolute; top: -10px; right: -10px; background: var(--error-red); color: white; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.remove-photo:hover { background: #c0392b; }

.form-actions { display: flex; gap: 1rem; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid var(--border-gray); }
.form-status { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.form-status.error { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }
.form-status.success { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }

.settings-content { padding: 0; }
.settings-section { margin-bottom: 2rem; padding: 1.5rem; border-bottom: 1px solid var(--border-gray); }
.settings-section:last-child { border-bottom: none; }
.settings-section h4 { margin-bottom: 1rem; color: var(--primary-blue); font-weight: 700; font-size: 1.2rem; }

.profile-photo-upload-container { position: relative; display: inline-block; margin-bottom: 1.5rem; }
.profile-photo-preview { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; border: 4px solid var(--primary-blue); box-shadow: var(--shadow); }
.profile-photo-btn { position: absolute; bottom: 5px; right: 5px; background: var(--primary-blue); color: white; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; border: 3px solid white; box-shadow: var(--shadow); transition: transform 0.2s; }
.profile-photo-btn:hover { transform: scale(1.1); }

/* 
   9. ADMIN DASHBOARD
    */
#admin-tab .sidebar-section { margin-bottom: 2rem; overflow: hidden; }
#admin-tab h3 { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.admin-row { background: white; border: 1px solid var(--border-gray); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; transition: box-shadow 0.2s; }
.admin-row:hover { box-shadow: var(--shadow-hover); }
.admin-row-info { flex: 1; min-width: 200px; display: flex; align-items: flex-start; gap: 1rem; }
.admin-row-photo { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; border: 2px solid var(--border-gray); flex-shrink: 0; }
.admin-row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; flex-shrink: 0; }
.admin-note-box { background: var(--light-gray); padding: 0.75rem; border-radius: 6px; margin-top: 0.5rem; font-size: 0.9rem; border-left: 3px solid var(--primary-blue); color: var(--text-secondary); }
.audit-log-item { padding: 0.75rem; border-bottom: 1px solid var(--border-gray); font-size: 0.9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.audit-log-item:last-child { border-bottom: none; }
#admin-analytics svg text { font-family: inherit; }

/* 
   10. NOTIFICATIONS & TOASTS
    */
.notification-item { display: flex; gap: 1rem; padding: 1.25rem; background: white; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-gray); margin-bottom: 1rem; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.notification-item.unread { border-left: 4px solid var(--primary-blue); background: var(--primary-blue-light); }
.notification-content { flex: 1; min-width: 200px; }
.notification-content p { margin-bottom: 0.5rem; line-height: 1.5; }
.notification-time { color: var(--text-secondary); font-size: 0.9rem; }

.user-role-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; margin-left: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.role-admin { background: var(--error-red); color: white; }
.role-user { background: var(--success-green); color: white; }

.notification-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 12px; max-width: 400px; }
.notification { background: white; border-radius: 12px; box-shadow: var(--shadow-large); border-left: 4px solid var(--primary-blue); animation: slideInRight 0.3s ease-out; overflow: hidden; }
.notification.notification-success { border-left-color: var(--success-green); }
.notification.notification-error { border-left-color: var(--error-red); }
.notification.notification-warning { border-left-color: var(--warning-orange); }
.notification .notification-content { display: flex; align-items: center; gap: 1rem; padding: 1rem; }
.notification-icon { font-size: 1.5rem; min-width: 30px; }
.notification-text { flex: 1; }
.notification-message { font-weight: 500; color: var(--text-primary); line-height: 1.4; }
.notification-close { background: none; border: none; font-size: 1.2rem; color: var(--text-secondary); cursor: pointer; padding: 4px; border-radius: 50%; }
.notification-close:hover { background-color: var(--light-gray); color: var(--error-red); }

.dashboard-welcome { background: var(--gradient-primary); color: white; padding: 2rem; border-radius: 16px; margin-bottom: 2rem; text-align: center; }
.dashboard-welcome h2 { margin-bottom: 0.5rem; font-weight: 800; }
.dashboard-welcome p { opacity: 0.9; font-size: 1.1rem; }

/* 
   11. HAMBURGER MENU
    */
.hamburger-menu { position: fixed; top: 0; right: 0; width: 320px; height: 100vh; background: white; box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15); z-index: 1000; transform: translateX(100%); transition: transform 0.3s ease; border-left: 1px solid var(--border-gray); overflow-y: auto; }
.hamburger-menu:not(.hidden) { transform: translateX(0); }
.menu-header { padding: 2rem 1.5rem; border-bottom: 1px solid var(--border-gray); display: flex; align-items: center; gap: 1rem; background: var(--light-gray); }
.menu-avatar { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--border-gray); object-fit: cover; }
.menu-user-info h3 { margin: 0; font-weight: 700; color: var(--text-primary); }
.menu-user-info p { color: var(--text-secondary); margin: 0; font-size: 0.9rem; }
.menu-items { padding: 1rem 0; }
.menu-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; color: var(--text-primary); text-decoration: none; font-weight: 500; cursor: pointer; }
.menu-item:hover { background-color: var(--light-gray); color: var(--primary-blue); }
.menu-item.logout-item:hover { background-color: rgba(231, 76, 60, 0.1); color: var(--error-red); }
.menu-item i { width: 20px; color: var(--text-secondary); font-size: 1.1rem; }
.menu-item:hover i { color: inherit; }

/* 
   12. COMPREHENSIVE RESPONSIVE DESIGN
    */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar-left, .sidebar-right { display: none; }
}

@media (max-width: 768px) {
  /* Hero Fixes */
  .hero-section { 
    flex-direction: column; 
    text-align: center; 
    padding: 5rem 1rem 2rem; 
    gap: 2rem; 
    min-height: auto; 
  }
  .hero-title { font-size: 2.5rem; line-height: 1.2; }
  .hero-description { max-width: 100%; font-size: 1rem; }
  .hero-stats { justify-content: center; gap: 1rem; }
  .stat-card { min-width: 90px; padding: 1rem 0.5rem; }
  .stat-number { font-size: 1.8rem; }
  .stat-label { font-size: 0.75rem; }
  .hero-actions { flex-direction: column; width: 100%; align-items: stretch; }
  .hero-actions .btn-large { width: 100%; justify-content: center; }
  
  /* Hide floating cards on mobile to prevent horizontal overflow */
  .floating-cards { display: none !important; }
  .hero-visual { width: 100%; margin-top: 1rem; }
  .hero-image { border-radius: 12px; }

  /* Navbar Fixes */
  .navbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .nav-brand { gap: 8px; }
  .brand-icon { width: 36px; height: 36px; font-size: 18px; }
  .brand-text { font-size: 20px; }
  .nav-actions { width: 100%; justify-content: center; margin-top: 0.5rem; }
  .nav-btn { padding: 10px 16px; font-size: 14px; flex: 1; max-width: 150px; justify-content: center; }

  /* Trust Bar */
  .trust-items { gap: 1rem; }
  .trust-item { font-size: 0.8rem; flex: 1 1 40%; justify-content: center; }

  /* Dashboard Header */
  .main-header { padding: 0.75rem 1rem; flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .header-left { gap: 0.5rem; width: 100%; flex-wrap: wrap; }
  .search-container { flex: 1; min-width: 200px; }
  .search-input { width: 100%; max-width: 100%; font-size: 14px; padding: 10px 16px; }
  .header-right { width: 100%; justify-content: space-between; margin-top: 0.25rem; }

  /* General Layout */
  .section-title { font-size: 2rem; }
  .features-grid { grid-template-columns: 1fr; }
  .admin-row { flex-direction: column; align-items: flex-start; }
  .admin-row-actions { width: 100%; justify-content: flex-end; margin-top: 0.5rem; }
  .footer-content { grid-template-columns: 1fr; gap: 2rem; }
  .footer-links { grid-template-columns: 1fr; }
  .hamburger-menu { width: 100%; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .cta-content h2 { font-size: 1.8rem; }
  .main-content { padding: 0.75rem; }
  .post-actions { flex-direction: column; }
  .action-btn { width: 100%; justify-content: center; }
  .form-row { flex-direction: column; gap: 0; }
  .modal-content { width: 95%; margin: 1rem; max-height: 95vh; }
  
  .missing-person-details { padding: 1rem; }
  .missing-photo { width: 100%; height: 200px; }
  .detail-item { flex-direction: column; gap: 0.25rem; }
  .detail-item strong { min-width: auto; font-size: 0.85rem; }
  .detail-item { font-size: 0.9rem; }
  
  .nav-btn { font-size: 13px; padding: 8px 12px; }
}

/* 
   13. GLOBAL ACCESSIBILITY & PRINT
    */
button:focus, input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-blue); outline-offset: 2px; }
img { max-width: 100%; height: auto; }

@media print {
  .main-header, .main-nav, .hamburger-menu, .notification-container, .landing-header, .hero-actions, .cta-section, .footer-links { display: none !important; }
  .hero-section { min-height: auto; padding: 2rem 0; }
}
/* =========================================
   MOBILE HEADER & ACTION BUTTON FIXES
   ========================================= */

@media (max-width: 768px) {
  
  /* 1. Fix Header Layout */
  .main-header {
    display: grid;
    grid-template-columns: auto 1fr auto; /* Logo | Search (hidden/moved) | Icons */
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
  }

  /* Force Logo and Icons to stay on the top row */
  .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-column: 1 / 2; /* Logo on left */
  }
  
  .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    grid-column: 3 / 4; /* Icons on right */
    margin-top: 0; /* Remove previous margin */
  }

  /* Move Search bar to a second row so it doesn't squish the logo */
  .search-container {
    grid-column: 1 / -1; /* Span full width */
    grid-row: 2; /* Move to second row */
    width: 100%;
    margin-top: 5px;
  }
  
  .search-input {
    width: 100%;
    font-size: 14px;
    padding: 8px 15px;
  }

  /* Make the Logo text smaller on mobile to save space */
  .logo span {
    font-size: 1.2rem; 
  }

  /* 2. Fix Action Buttons (Share, Print, etc.) */
  .post-actions {
    display: flex;
    flex-direction: row; /* Force horizontal */
    flex-wrap: wrap; /* Allow wrapping to next line */
    justify-content: space-between;
    gap: 5px;
    padding-top: 1rem;
  }

  .action-btn {
    flex: 1 1 30%; /* Make buttons take up ~30% width (3 per row) */
    justify-content: center;
    padding: 8px 5px;
    font-size: 0.85rem; /* Smaller text */
    background: #f8f9fa; /* Light background for better touch target */
    border-radius: 8px;
  }
  
  .action-btn i {
    margin-right: 5px;
    font-size: 1rem;
  }
}

/* For very small screens (like the screenshot you showed) */
@media (max-width: 400px) {
  .action-btn {
    flex: 1 1 45%; /* 2 buttons per row on tiny screens */
  }
  .logo span {
    display: none; /* Hide "FindMe" text, keep only icon */
  }
}