@import url('https://fonts.googleapis.com/css2?family=Sen:wght@400;700;800&display=swap');

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

/* Keep browser auto color adjustments aligned with site toggle state. */
html {
  color-scheme: light;
}
html.dark {
  color-scheme: dark;
}

body {
  font-family: 'Sen', sans-serif;
  background: #FAFAFA;
  color: #4b5156;
  font-size: 16px;
  line-height: 1.6;
}

/* Accessibility: allows keyboard users to bypass repeated nav */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #eb796f;
  color: white;
  padding: 12px 20px;
  z-index: 9999;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  top: 0;
}

/* Navbar */
.navbar { position: fixed; top: 0; width: 100%; background-color: rgba(0, 0, 0, 0.75); backdrop-filter: blur(10px); z-index: 999; }
/* Keep nav typography stable even when page-specific frameworks (e.g., Tailwind) load. */
.navbar,
.navbar * { font-family: 'Sen', sans-serif !important; }
.navbar-container { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 2.5rem 0.5rem 0.75rem; flex-wrap: nowrap; }
.nav-logo { display: flex; align-items: center; gap: 1rem; font-weight: bold; font-size: 1.2rem; color: white; text-decoration: none; }
.nav-logo:focus-visible { outline: 3px solid #eb796f; outline-offset: 2px; }
.nav-logo img { max-height: 60px; width: auto; object-fit: contain; }
.nav-toggle { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; color: white; }
.nav-toggle:focus { outline: 3px solid #eb796f; outline-offset: 2px; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: white; font-weight: 300; padding: 8px 12px; transition: 0.3s; }
.nav-links a:hover { color: #eb796f; text-decoration: underline;}
.nav-links a:focus-visible { outline: 3px solid #eb796f; outline-offset: 2px; }
.nav-links .active { border-bottom: 2px solid #eb796f; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .navbar-container { flex-wrap: nowrap; }
  .nav-links { position: absolute; top: 100%; left: 0; width: 100%; flex-direction: column; display: none; background: white; padding: 1rem 2rem; border-top: 1px solid #e0e0e0; list-style: none; }
  .nav-links a { color: #2c3e50; }
  .nav-links.show { display: flex; }
  .dark-mode .nav-links {
    background-color: #34495e;
    border-top-color: #2c3e50;
  }
  .dark-mode .nav-links a { color: #ffffff; }
}

/* Welcome Section */
.hero-container {
  height: 100vh; 
  width: 100%;  
  margin: 0;
  padding: 0;
  background-image: url('https://www.ocf.berkeley.edu/~scmg/static/images/background_new_web.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center; 
  align-items: flex-end; 
  color: white; 
}

.hero-text {
  text-align: left;
  padding-bottom: 8vh; 
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
  font-family: 'Sen', sans-serif;
}

.hero-text h1 { font-weight: bold; font-size: 8.5rem; margin: 0; line-height: 1; }

@media (max-width: 768px) {
  .hero-text h1 { font-size: 4rem; }
}

/* Layout */
.page-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 96px 0 0;
}

/* Data-heavy pages (analytics, map) use more of the screen on large monitors
   instead of leaving big empty margins, while staying padded on smaller ones. */
.page-content--wide {
  max-width: min(2100px, 95vw);
}
@media (max-width: 768px) {
  .page-content--wide { max-width: 100%; }
}

@media (max-width: 768px) {
  .page-content {
    padding-top: 86px;
  }
}

/* Dark Mode */
.dark-mode { background-color: #1f1f1f; color: #ffffff; }
.dark-mode .navbar { background-color: rgba(0, 0, 0, 0.85); border-color: #313715; }
.dark-mode .nav-logo, .dark-mode .nav-links a { color: #ffffff; }
.dark-mode .nav-links .active { border-bottom: 2px solid #9ecbff; }
.dark-mode .nav-links a:hover { color: #eb796f; text-decoration: underline;}

/* Dark Mode Toggle */
.dark-mode-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  background-color: #ffffff;
  color: #4b5156;
  font-size: 14px;
  cursor: pointer;
  z-index: 1000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.dark-mode-toggle:focus { outline: 3px solid #eb796f; outline-offset: 2px; }
.dark-mode .dark-mode-toggle { background-color: #34495e; color: #ffffff; border-color: #2c3e50; }

/* Footer */
.site-footer { background: #f7f7f7; padding: 24px 0; margin-top: 24px; text-align: center; border-top: 1px solid #e0e0e0; }
.footer-logos { display: flex; justify-content: center; align-items: center; gap: 32px; margin-bottom: 12px; }
.footer-logos img { max-height: 40px; width: auto; }
.site-footer p { margin: 0; color: #666; font-size: 14px; }

.dark-mode .site-footer { background: #34495e; border-top-color: #2c3e50; }
.dark-mode .site-footer p { color: #ddd; }

/* Login Card Styles (Scoped) */
.login-container { max-width: 640px; margin: 120px auto 40px; background-color: #fff; box-shadow: 2px 2px 13px -4px rgba(0, 0, 0, 0.21); padding: 20px; border-radius: 8px; }
.header-bar { background-color: #3f4750; padding: 20px; color: #fff; border-radius: 8px 8px 0 0; margin: -20px -20px 20px -20px; text-align: center; }
.header-bar h1 { margin: 0; font-size: 1.5rem; }
.card-body label { display: block; margin-bottom: 5px; font-weight: 600; color: #2c3e50; }
.card-body input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
.card-body input:focus { outline: 3px solid #eb796f; outline-offset: 1px; border-color: #eb796f; }
.button { background-color: #eb796f; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; width: 100%; margin-top: 10px; }
.button:hover { background-color: #d86b60; }
.button:focus { outline: 3px solid #2c3e50; outline-offset: 2px; }

/* Login password toggle */
.password-field-container { position: relative; display: inline-block; width: 100%; }
.password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 18px; color: #666; }
.password-toggle:focus { outline: 3px solid #eb796f; outline-offset: 2px; }

/* Generic dark mode helpers for Tailwind-like utility classes on content pages */
.dark-mode .bg-white, .dark-mode .bg-gray-50, .dark-mode .bg-gray-100 {
  background-color: #262626 !important;
  border-color: #3a3a3a !important;
}
.dark-mode .home-unified-dark,
.dark-mode .home-unified-dark.bg-white,
.dark-mode .home-unified-dark .bg-gray-50,
.dark-mode .home-unified-dark .bg-white {
  background-color: #1f1f1f !important;
}
.dark-mode .text-gray-800, .dark-mode .text-gray-900, .dark-mode .text-gray-700, .dark-mode .text-gray-600, .dark-mode .text-gray-500 { color: #e6edf3 !important; }
.dark-mode .border { border-color: #46627f !important; }

/* Layout Helpers for the Bento Grid */
.bg-cover {background-size: cover; background-position: center; background-repeat: no-repeat;}

/* Ensure smooth hover transitions for the grid cards */
.transition-transform {transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;}

@media (prefers-reduced-motion: reduce) {
  .transition-transform,
  .transition,
  .time-range,
  .corner-button,
  .button {
    transition: none !important;
    animation: none !important;
  }
}

h2.inline-block {padding-bottom: 4px;}

/* Visually hidden utility class for screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* For analytics.html (copied from analytics.css) */
.corner-button {
  right: 20px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-family: sans-serif;
  font-weight: bold;
  transition: background-color 0.2s ease;
  z-index: 1000;
}
.corner-button:hover { background-color: #0056b3; }


.dark-mode button.time-range:hover { background-color: #375a9e !important; }
.dark-mode .bg-white { background-color: #262626 !important; }
.dark-mode select,
.dark-mode input,
.dark-mode button.time-range {
  background-color: #2a2a2a !important; border-color: #444 !important; color: #e5e5e5 !important;
}

/* For login.html */
.dark-mode .card-body label {
    color: white !important;
}
