/* --- CSS Branding Variables (Extracted from Logo) --- */
:root {
  --primary: #2E946A; /* Vibrant Green */
  --primary-dark: #247554;
  --secondary: #1A92D4; /* Deep Sky Blue */
  --secondary-dark: #1576AB;
  --accent: #F97316; /* Energy Orange */
  --bg-main: #FDFDFD;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  --shadow-md: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 35px 60px -15px rgb(0 0 0 / 0.2);
  --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  --glass: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.2);
}

/* --- Dark Theme Variables --- */
body.dark-theme {
  --bg-main: #0B1120;
  --bg-card: #1E293B;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --glass: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.05);
}

body.dark-theme .admin-main {
  background: var(--bg-main);
}
body.dark-theme .data-card,
body.dark-theme .admin-stat-card,
body.dark-theme .auth-card {
  background: var(--bg-card);
  border-color: rgba(255,255,255,0.05);
}
body.dark-theme .admin-header h1,
body.dark-theme .admin-stat-card .value,
body.dark-theme h3 {
  color: var(--text-main);
}
body.dark-theme input, 
body.dark-theme select {
  background: #0F172A;
  color: white;
  border-color: #334155;
}

/* --- Global Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navbar (Glassmorphism) --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

nav.scrolled {
  padding: 12px 0;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 40px;
}

.logo-text {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.nav-links a:hover {
  color: var(--primary);
}

.btn-login {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white !important;
  font-weight: 700;
  box-shadow: 0 8px 16px -4px rgba(0, 168, 107, 0.25);
}



/* --- Hero Section --- */
.hero {
  padding-top: 180px;
  padding-bottom: 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 168, 107, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -150px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 86, 210, 0.1) 0%, transparent 70%);
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 24px;
  color: #0F172A;
}

.hero-content h1 span {
  color: var(--primary);
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 540px;
}

.hero-btns {
  display: flex;
  gap: 16px;
}

.btn-primary {
  padding: 16px 36px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 10px 20px -5px rgba(0, 168, 107, 0.3);
}

.btn-secondary {
  padding: 16px 36px;
  background: white;
  color: var(--text-main);
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-badge {
  position: absolute;
  bottom: 40px;
  left: -20px;
  background: white;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* --- Stats Section --- */
.stats {
  padding: 80px 0;
  background: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  display: block;
}

.stat-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Section Titles --- */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 12px auto 0;
}

/* --- Impact Section --- */
.impact {
  padding: 100px 0;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.impact-card {
  background: white;
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid #F1F5F9;
}

.impact-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.impact-icon {
  width: 64px;
  height: 64px;
  background: rgba(0, 168, 107, 0.1);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.impact-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

/* --- Gallery Section --- */
.gallery {
  padding: 100px 0;
  background: #F1F5F9;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 300px;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h4 {
  color: white;
  font-size: 1.25rem;
}

.gallery-overlay p {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

/* --- Powerful Footer --- */
footer {
  background: #020617;
  color: white;
  padding: 100px 0 40px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 80px;
}

.footer-about .logo-text {
  font-size: 1.8rem;
  margin-bottom: 24px;
  display: block;
}

.footer-about p {
  color: #94A3B8;
  line-height: 1.8;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-links h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #F8FAFC;
}

.footer-links ul li {
  margin-bottom: 16px;
}

.footer-links a {
  color: #94A3B8;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.footer-links a i {
  font-size: 0.8rem;
  opacity: 0.5;
}

.portal-badge {
  background: var(--secondary);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  margin-left: 8px;
}

.footer-social {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.social-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  transition: var(--transition);
  border: 1px solid rgba(255,255,255,0.1);
}

.social-circle:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-5px);
  border-color: var(--primary);
}

.footer-bottom {
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #64748B;
  font-size: 0.85rem;
}

.footer-legal-links {
  display: flex;
  gap: 24px;
}

/* --- Auth (Login) Styles --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: white;
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: auto;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 2rem;
  letter-spacing: -1px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.1);
}

.btn-full {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 12px;
}

/* --- Admin Dashboard Styles --- */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: #0F172A;
  color: white;
  padding: 32px 0;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 32px;
  margin-bottom: 48px;
}

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 32px;
  color: #94A3B8;
  font-weight: 600;
}

.sidebar-links a.active, .sidebar-links a:hover {
  color: white;
  background: rgba(255,255,255,0.05);
  border-left: 4px solid var(--primary);
}

.admin-main {
  flex-grow: 1;
  background: #F8FAFC;
  padding: 40px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.admin-stat-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.admin-stat-card .label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-stat-card .value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 8px;
  display: block;
}

.data-card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.chart-container {
  position: relative;
  height: 350px;
  width: 100%;
}

/* --- Gallery Manager --- */
.gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.gm-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
}

.gm-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gm-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
}

/* --- Modal System --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  position: relative; /* Inside the flex container */
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Highlight unread card (matching others) */
#unread-card .value {
  color: var(--text-main);
}

.admin-modal h2 {
  color: var(--text-main);
}

.admin-modal label {
  color: var(--text-main);
}

.admin-modal input, .admin-modal select {
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

body.dark-theme .admin-modal {
  background: #1E293B;
  border-color: #334155;
}

body.dark-theme .modal-overlay {
  background: rgba(0, 0, 0, 0.8);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-content h1 { font-size: 3rem; }
  .hero-content p { margin: 0 auto 40px; }
  .hero-btns { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .impact-grid, .gallery-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
  
  /* Admin Dashboard Mobile */
  .admin-mobile-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #0F172A;
    color: white;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .admin-menu-toggle { font-size: 1.5rem; cursor: pointer; }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 280px; height: 100vh; position: fixed; top: 0; left: -100%; padding: 32px 0; z-index: 1001; transition: left 0.3s ease; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
  .sidebar.active { left: 0; }
  .sidebar-logo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; text-align: left; }
  .sidebar-close { display: block !important; font-size: 1.5rem; cursor: pointer; color: rgba(255,255,255,0.7); }
  .sidebar-links { display: block; overflow-x: hidden; white-space: normal; padding-bottom: 0; border: none; }
  .sidebar-links a { padding: 12px 32px; font-size: 1rem; }
  .sidebar-links > div { margin-top: 20px !important; padding-top: 12px !important; border-top: 1px solid rgba(255,255,255,0.1) !important; border-bottom: none !important; border-left: none !important; }
  .sidebar-links > a.active { border-bottom: none; border-left: 4px solid var(--primary); background: rgba(255,255,255,0.05); }
  .sidebar-links > a[target="_blank"] { margin-top: 20px !important; padding-top: 20px !important; border-top: 1px solid rgba(255,255,255,0.1) !important; }
  #sidebar-theme-toggle { padding: 12px 20px !important; margin-top: 20px !important; }
  
  .admin-main { padding: 24px 16px; width: 100%; overflow-x: hidden; }
  .admin-header { flex-direction: column; gap: 16px; align-items: stretch; text-align: center; }
  .admin-header button { width: 100%; }
  .admin-stats-grid { grid-template-columns: 1fr; }
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
}
