/** NavBar **/
.navbar {
  background-color:rgba(0, 0, 0, 0.5);
  position: fixed;
  z-index: 1000;
  top: 0px;
  width: 100%;
  height: 80px;
  justify-content: space-between;
  align-items: center;
  display: flex;
}

a.navbar-menu {
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
}

.navbar ul li {
  list-style-type: none;
  float: left;
  margin: 0px 10px;
  padding: 15px;
}

.navbar ul li a {
  margin-top: 25px;
  color: #ffffff;
  display: flex;
  text-decoration: none;
  text-align: center;
  width: 80px;
  height: 100%;
  transition: all 0.3s ease;
}

.navbar ul li a:hover {
  text-decoration: underline;
  transition: all 0.3s ease;
}

.navbar ul li a.donate {
  background-color: #abcade;
  color: #0d1117;
  margin-top: 17px;
  padding: 8px 5px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar ul li a.donate:hover {
  text-decoration: none;
  color: #ffffff;
  background-color: var(--accent-color-dark);
  transform: scale(1.05);
}

/*** body ***
 Purpose:
 - Add style rules for the body of your webpage
 - This is useful if you want a rule to apply to EVERYTHING on your page
 - (Tip: You can always override these rules later in the stylesheet)
***/
body {
  /* Dark starry background */
  background-color: #0d1117;
  background-image: url('img/stars-background.png');
  background-attachment: fixed;
  /* Customize the default size, color, and font for text*/
  font-size: 16px;
  color: #ffffff;
  font-family: Jost, sans-serif;
  /* Put space around the edges of the webpage */
  margin: 0;
  padding: 0;
  line-height: 1.6;
  transition: background-color 0.5s ease, background-image 0.5s ease;
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 50px;
}

/* Dark mode is the default */
body.light-mode {
  background-color: #606060;
  background-image: linear-gradient(to bottom, #75625e, #e1ba8d);
  color: #333333;
  padding-top: 90px;
}

body.light-mode .switch{
  border-color: var(--accent-color-darkest);
}

body.light-mode .light-pollution-img{
  border-color: var(--accent-color-darkest);
}

body.light-mode .slider:before{
  background-color: var(--accent-color-darkest);
}

.switch {
  position: relative;
  display: inline-block;
  width: 2vw;  /* Width of the switch container */
  height: 4vw; /* Height of the switch container */
  border-radius: 50px; /* Rounded corners for the rectangle */
  border: 2px solid white; /* White border around the switch */
  background-color: transparent; /* No fill inside the switch */
}



.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
  border-radius: 50px; /* Rounded edges for the slider */
}

.slider:before {
  position: absolute;
  content: "";
  width: 1.8vw;  /* Circle width */
  height: 1.8vw; /* Circle height */
  left: 0.1vw;    /* Ensure it's aligned from the left */
  top: 0.1vw;     /* Ensure it's aligned from the top */
  border-radius: 50%; /* Makes the circle shape */
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: var(--accent-color-dark);
}

body.light-mode input:checked + .slider {
  background-color: var(--accent-color-light);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-color-dark);
}

input:checked + .slider:before {
  transform: translateY(2vw); /* Move the circle down */
}

/* Optional: Rounded sliders */
.slider.round {
  border-radius: 1vw; /* Rounded corners for the slider */
}

.slider.round:before {
  border-radius: 50%;
}

.light-pollution-box{
  display: flex;
  flex-direction: row;
  gap: 1vw;
  align-items: end;
}


/*** Header image ***
 - Full width with blurred bottom edge
***/
.header-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  margin: 0;
  padding: 0;
  display: block; /* Ensure it's visible by default */
}


p {
  font-size: 1.2vw;
  font-weight: 200;
}

h1,
h2,
a {
  font-family: Jost;
}


.toggle {
  width: 9vw;
  height: 9vw;
  align-self:flex-end;
  cursor: pointer;
}

.light-pollution-img {
  width: 25vw;
  height: 25vw;
  border-radius: 5%;
  border-color: #ffffff;
  border-style: solid;
  border-width: 0.2vw;
  margin: 0; /* Ensure no margin/padding around the image */
  padding: 0; /* Ensure no padding around the image */
  object-fit: cover; /* Ensure the image fills the container without distortion */
}
  

.hero {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 3vw;
  align-items: top;
  margin-top: -12vw;
  margin-bottom: 10vw;
}

body.light-mode .hero{
  margin-top: 10vw;
}

.hero-text {
  display: flex;
  width: 30vw;
  flex-direction: column;
  align-items: start;
}

.hero-p {
  font-size: 1.5vw
}

#catch-phrase {
  font-weight: bold;
}

.header-blur {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40vw;
  background: linear-gradient(to bottom, rgba(13, 17, 23, 0), rgba(13, 17, 23, 1));
}

body.light-mode .header-blur {
  background: linear-gradient(to bottom, rgba(216, 153, 153, 0), rgba(96, 96, 96, 1));
}
body.light-mode .header-container {
  display: none; /* Hide in light mode */
}

/*** Text ***
 Purpose:
 - Add style rules for headings (h1-6),
 paragraphs (p), links (a), and buttons
***/
h1 {
  font-size: 4vw;
  color: #ffffff;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

body.light-mode h1 {
  color:var(--accent-color-dark);
  text-shadow: none;
}

h2 {
  font-size: 3vw;
  color: #ffffff;
  padding-top: 90px;
  margin-top: -70px;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--accent-color-medium);
  padding-bottom: 8px;
}

body.light-mode h2 {
  color: var(--accent-color-dark);
}

h3 {
  font-size: 2.5vw;
  color: #ffffff;
  margin-top: 30px;
  margin-bottom: 15px;
  text-align: center;
}

body.light-mode h3 {
  color: var(--accent-color-medium);
}

h4 {
  font-size: 1.5vw;
  color: #ffffff;
  margin-top: 20px;
  margin-bottom: 10px;
}

body.light-mode h4 {
  color: var(--accent-color-medium);
}

p {
  font-weight: 300;
  margin-bottom: 20px;
  line-height: 1.6;
}

a,
a * {
  color: var(--accent-color-light);
  text-decoration: none;
  transition: all 0.3s ease;
}

body.light-mode a,
body.light-mode a * {
  color: var(--accent-color-dark);
}

a:hover {
  color: var(--accent-color-green);
  text-decoration: underline;
}

/* Button container for centered buttons */
.button-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0 40px 0;
}

.about{
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  width: 60vw;
  gap: 0.5vw;
}

.impact {
  margin-top: 10vw;
}

.news {
  margin-top: 10vw;
}

.facts {
  margin-top: 10vw;
}




/* Light switch button */
#light-switch {
  position: fixed;
  top: 1.5vw;
  left: 1.5vw;
  background-color: var(--accent-color-medium);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 5px;
}

#light-switch:hover {
  background-color: var(--accent-color-dark);
}

/* Other buttons */
button {
  background-color: var(--accent-color-medium);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

button:hover {
  background-color: var(--accent-color-green);
  transform: scale(1.05);
}

/* Lists */
ul {
  margin-bottom: 20px;
  padding-left: 20px;
  list-style-type: disc;
}

li {
  margin-bottom: 8px;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.header-image {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* iframe for YouTube videos */
iframe {
  display: block;
  margin: 30px auto;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* News articles */
article {
  background-color: rgba(35, 25, 66, 0.7);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid var(--accent-color-medium);
}

body.light-mode article {
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid #ccc;
}

article:hover {
  box-shadow: 0 8px 16px rgba(104, 79, 181, 0.3);
  transform: translateY(-5px);
}

article h3 {
  margin-top: 0;
  color: #ffffff;
  text-align: left;
  font-size: 2vw

}

body.light-mode article h3 {
  color: #333;
}

/* Connect Section */
#connect {
  background-color: rgba(35, 25, 66, 0.7);
  padding: 30px;
  border-radius: 10px;
  margin-top: 10vw;
  margin-bottom: 50px;
  border: 1px solid var(--accent-color-medium);
}

body.light-mode #connect {
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid #ccc;
  margin-top: 100px; /* Adjust margin-top in light mode if needed */
}

.connect-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
  padding-bottom: 50px;
}

.connect-para {
  width: 55%;
  padding-right: 10px;
}

.connect-participants {
  width: 45%;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
}

body.light-mode .connect-participants {
  background-color: rgba(255, 255, 255, 0.5);
}

.connect-participants p {
  margin-bottom: 10px;
}

#connect-count {
  font-weight: bold;
  margin-top: 20px;
}

.form-container {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
}

body.light-mode .form-container {
  background-color: rgba(255, 255, 255, 0.5);
}

#connect-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 2vw;
  padding-right: 20px;
}

#connect-form label {
  font-size: 1.5vw;
  font-weight: bold;
  margin-bottom: -5px;
}

#connect-form input {
  padding: 10px;
  font-size: 1.5vw;
  border: 1px solid var(--accent-color-medium);
  border-radius: 5px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.8);
}

#connect-form button {
  padding: 12px 25px;
  font-size: 1.5vw;
  margin-top: 15px;
  width: 30%;
  align-self: center;
}


/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .navbar-container {
    display: flex;
    justify-content: space-between;
    height: 80px;
    z-index: 1;
    width: 100%;
    max-width: 1300px;
    padding: 0;
  }

  .navbar-menu {
    display: grid;
    grid-template-columns: auto;
    margin: 0;
    width: 200px;
    position: absolute;
    top: -1000px;  /* drop down effect */
    opacity: 1;
    transition: all 0.5s ease;
    z-index: 1;
  }

  .navbar-menu.active {
    background-color: rgba(0, 0, 0, 0.8);
    top: 100%;
    right: 0;
    opacity: 1;
    transition: all 0.5 ease;
    z-index: 99;
    height: 250px;
    font-size: 1rem;
  }

  .navbar-toggle .bar {
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background: #fff;
  }

  .navbar ul li {
    width: 50%;
  }

  .navbar ul li a {
    text-align: center;
    padding: 0;
    margin: 0 15px;
    width: 100%;
    display: table;
  }

  .navbar ul li a.donate {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 20px;
    margin: 0 20px;
  }

  #mobile-menu {
    position: absolute;
    top: 20%;
    right: 5%;
    transform: translate(5%, 20%);
  }

  .navbar-toggle .bar {
    display: block;
    cursor: pointer;
  }

  /* menu bar animation with three lines (childs) */
  #mobile-menu.is-active .bar:nth-child(2) {
    opacity: 0;
  }
  #mobile-menu.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  #mobile-menu.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .content-container {
    padding: 0 15px;
  }
  
  .header-container {
    height: 250px;
  }
  
  h3 {
    font-size: 22px;
  }
  
  .button-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .connect-container {
    flex-direction: column;
  }
  
  .connect-para, .connect-participants {
    width: 93%;
  }
  
  #connect-form {
    flex-direction: column;
  }
  
  #light-switch {
    top: 4vw;
    left: 3vw;
    padding: 8px 12px;
    font-size: 12px;
  }
}

/*** Custom Colors (OPTIONAL) ***
 Purpose:
 - Use CSS variables to define custom colors for your website
 - To reference a color variable in your css, use var(--variable-name) in place of a color value
***/
:root {
  /* Light Mode */
  --bg-color: #808080;
  --text-color: #333333;
  /* Dark Mode */
  --bg-color-dark-mode: #0d1117;
  --text-color-dark-mode: #fff;
  /* Accent Colors */
  --accent-color-light: #abcade;
  --accent-color-medium: #011722;
  --accent-color-dark: #124164;
  --accent-color-darkest: #192742;
  --accent-color-green: #146ec7;
  /* Error Colors */
  --error-color: #f8bbd0;
  --error-color-border: #e63946;
}

/* Stars animation */
@keyframes twinkle {
  0% {opacity: 0.5;}
  50% {opacity: 1;}
  100% {opacity: 0.5;}
}

.star {
  position: fixed;
  background-color: #fff;
  border-radius: 50%;
  z-index: -1;
}

body.light-mode .star {
  display: block; /* Change from 'none' to 'block' */
  /* You might want to adjust color for better visibility in light mode */
  background-color: #011722; /* Darker star color for light mode */
}

details {
  background: rgba(50, 50, 50, 0.8);
  color: white;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

details[open] {
  background: rgba(80, 80, 80, 0.9);
  padding-bottom: 20px;
}

.impact h3 {
  text-align: left;
  padding-left: 5px;
  color: var(--accent-color-light);
  font-size: 2.2vw
}

summary {
  font-size: 1.5vw;
  font-weight: 400;
  cursor: pointer;
  list-style: none;
}

summary:hover {
  color: #146ec7;
}

/* Card layout for causes of light pollution */
.causes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Two equal columns */
  grid-template-rows: repeat(2, 1fr); /* Two equal rows */
  gap: 1vw; /* Space between grid items */
  margin: 2vw auto;
}

.causes {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 10vw;
}

.cause-card {
  background-color: rgba(35, 25, 66, 0.7);
  border: 1px solid var(--accent-color-medium);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.3s ease;
}

body.light-mode .cause-card {
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid #ccc;
}

.cause-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(104, 79, 181, 0.3);
}

.cause-card h5 {
  font-size: 20px;
  color: var(--accent-color-light);
  margin-top: 0;
  margin-bottom: 10px;
}

body.light-mode .cause-card h5 {
  color: var(--accent-color-dark);
}

.cause-card p {
  margin-bottom: 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .causes-grid {
    grid-template-columns: 1fr;
  }
}

/*** Animations  ***
  Purpose:
  - Add style rules to enable scroll animations for your website
***/

.revealable {
  --reveal-distance: 100px; /* CSS Variable */
  scroll-margin-top: var(--reveal-distance);
  opacity: 0;
  transition: all 2s ease;
  position: relative;
  transform: translateY(var(--reveal-distance));
}

.active {
  scroll-margin-top: 0;
  transform: translateY(0);
  opacity: 1;
}