/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: fa;
  src: url(BoliviaSignature-ZpWnz.ttf);
}

body {
  font-family: Arial, sans-serif;
  background-image: url('images/VCSO_Discord.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  line-height: 1.6;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.7);
  height: 80px;
  padding: 1em 2em;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 0.5em;
  transition: color 0.3s;
}

.navbar a:hover {
  color: #aaa;
}

.brand {
  font-size: 1.2em;
  font-weight: bold;
  padding-left: 10px;
}

.menu-icon {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
}

/* Overlay Menu for Small Screens */
.overlay {
  height: 0;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: height 0.5s ease;
  z-index: 1;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
}

.overlay-content a {
  padding: 15px;
  font-size: 24px;
  color: white;
  text-decoration: none;
  transition: color 0.3s;
}

.overlay-content a:hover {
  color: #f1f1f1;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
  .navbar nav {
    display: none;
  }

  .menu-icon {
    display: block;
  }
}

/* Header Section */
.header {
  background-image: url('images/VSO209.PNG');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 30vh; /* Adjusts height relative to the viewport */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px; /* Adds spacing for small screens */
  box-sizing: border-box; /* Ensures padding doesn't affect dimensions */
  overflow: hidden; /* Prevents any overflow of content */
}

.header h1 {
  font-size: calc(1.5rem + 1vw); /* Dynamically adjusts based on screen width */
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
}

.header p {
  font-size: calc(1rem + 0.5vw); /* Dynamically adjusts based on screen width */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.5;
  margin: 0;
  color: #FFD700;;
}

@media screen and (max-width: 768px) {
  .header {
    height: auto; /* Adjusts height based on content */
    padding: 30px 10px; /* Adds space for smaller screens */
  }

  .header h1 {
    font-size: 1.8em; /* Scales down the header text for smaller screens */
  }

  .header p {
    font-size: 1em; /* Scales down paragraph text */
  }
}

.sheriff {
  height: auto;
  width: 100%;
  max-width: 315px;
  max-height: 300px;
  display: block;
  margin: 0 auto;
}

/* Content Section */
.content-section {
  padding: 20px 20px;
  text-align: center;
}

.bg-light {
  background-color: rgba(255, 255, 255, 0.7);
  color: black;
}

.content-section h1 {
  margin-bottom: 20px;
  font-size: 2.5rem;
}

.content-section p {
  margin-bottom: 20px;
}

.list-unstyled {
  list-style-type: none;
  padding: 0;
}

#about strong {
  font-family: fa;
  font-size: 3.5rem;
}

#about h2 {
  color: #FFD700;
}

#about p {
  padding-bottom: 30px;
}

.divisions a {
  color: black;
  text-decoration: none;
}

.divisions:visited a {
  color: black;
}

.divisions:hover a, .divisions:focus a {
  text-decoration: none;
  cursor: pointer;
}

.stations a {
  color: black;
  text-decoration: none;
}

.stations:visited a {
  color: black;
}

.stations:hover a, .stations:focus a {
  text-decoration: none;
  cursor: pointer;
}

.click-here p {
  display: inline-block;
  font-size: 1rem;
}

.click-here a {
  color: #027a02;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s ease, color 0.2s ease;
}

.click-here a:hover {
  color:#d1983e;
  transform: scale(2.0);
}

.apply-btn {
  background-color: #027a02;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.apply-btn:hover {
  background-color: #d1983e;
  cursor: pointer;
}

.video-grid-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: calc(100% - 10px); /* 5px margin on both sides */
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
  overflow-x: hidden;
}

.video-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1300px;
}

.video-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.video-container {
  width: 400px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: transparent; /* Removes black border */
  border-radius: 8px;
  overflow: hidden;
}

/* Play Button Overlay */
.video-container::after {
  content: "▶"; /* Play icon */
  font-size: 60px;
  color: rgba(255, 255, 255, 0.8);
  position: absolute;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none; /* Prevents interaction */
}

/* Show play icon on hover */
.video-container:hover::after {
  opacity: 1;
}

/* Video Thumbnails */
.video-thumbnail {
  width: 80%;
  height: 80%;
  object-fit: cover;
  cursor: pointer;
  border-radius: 8px;
}

/* Responsive layout */
@media (max-width: 1024px) {
  .video-grid {
      flex-direction: column;
      align-items: center;
  }
  
  .video-row {
      justify-content: center;
  }
}

/* Footer */
footer {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 1em 0;
  text-align: center;
  color: white;
}

.image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.image-container img {
  max-width: 100%; /* Image scales with the container's width */
  height: auto; /* Maintains the aspect ratio */
  display: block;
  margin: 0 auto; /* Centers the image within the container */
}

.rou {
  width: 50%;
  height: auto;
}

/* Additional styling for mobile responsiveness */
@media screen and (max-width: 768px) {
  .content-section img {
    width: 90%; /* Scale down further for smaller screens */
  }
}

.grid-container {
  display: grid;
  background-color: white;
  grid-template-columns: repeat(3, 1fr); /* Fixed 3 columns per row */
  gap: 20px;
  padding: 10px;
}

/* Ensure grid items maintain their aspect ratio */
.grid-item {
  position: relative; /* Enable child elements to position themselves properly */
  width: 100%;
  aspect-ratio: 16 / 9; /* Maintain a consistent aspect ratio (e.g., 16:9) */
  overflow: hidden; /* Prevent image overflow */
  display: flex;
  align-items: center;
  justify-content: center; /* Center images inside the container */
  text-align: center; /* Center caption */
}

/* Ensure the anchor element covers the entire grid item */
.grid-item a {
  display: block;
  width: 100%;
  height: 100%;
}

/* Image styling to fit inside grid items without distortion */
.grid-item img {
  width: 100%; /* Default size */
  height: 100%; /* Maintain aspect ratio */
  object-fit: cover; /* Ensure no distortion */
  transition: transform 0.3s ease-in-out; /* Smooth zoom effect */
  cursor: pointer; /* Indicate interactivity */
}

/* Text alignment for captions */
.grid-item p {
  position: absolute;
  bottom: 0px; /* Position caption at the bottom */
  background-color: rgba(0, 0, 0, 0.5); /* Add a semi-transparent background for better readability */
  color: white;
  font-size: 14px;
  margin: 0;
  width: 100%;
}

.service-fleet-page .content-section {
  padding: 20px; /* Maintain some padding */
  background-color: rgba(240, 240, 240, 0.9); /* Light background */
  border: 1px solid #ddd; /* Subtle border */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow */
  
  display: flex; /* Enable Flexbox */
  flex-direction: column; /* Stack items vertically */
  justify-content: center; /* Center items vertically */
  align-items: center; /* Center items horizontally */
  height: 80px; /* Ensure a fixed height for centering */
  text-align: center; /* Ensure text is centered */
}

.service-fleet-page .content-section h1 {
  font-size: 1.8rem; /* Smaller font size */
  font-weight: 600; /* Semi-bold */
  color: #333; /* Darker for contrast */
  margin: 0; /* Remove default margin */
}

/* Small screens (up to 600px wide) */
@media (max-width: 600px) {
  .grid-container {
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjust grid layout */
  }
  .grid-item p {
      font-size: 14px; /* Smaller font size for captions */
  }
}

/* Large screens (wider than 1200px) */
@media (min-width: 1200px) {
  .grid-container {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Larger grid items */
  }
  .grid-item p {
      font-size: 18px; /* Larger font for captions */
  }
}

.click-here-fleet p {
  display: inline-block;
  font-size: 1rem;
}

.click-here-fleet a {
  color: #027a02;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s ease, color 0.2s ease;
}

.click-here-fleet a:hover {
  color:#d1983e;
  transform: scale(2.0);
}

.fleet-videos .ulc-vids {
  padding: 20px; /* Adjusts dynamically below the header */
  background-color: rgba(240, 240, 240, 0.9);
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.fleet-videos .ulc-vids h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

@media screen and (max-width: 768px) {
  .header {
    height: 25vh; /* Slightly reduce header height for smaller screens */
  }

  .fleet-videos .ulc-vids {
    margin-top: calc(0px); /* Adjust margin relative to smaller header */
  }

  .fleet-videos .ulc-vids h1 {
    font-size: 1.5rem; /* Smaller font for smaller screens */
  }
}

@media screen and (max-width: 480px) {
  .header {
    height: 20vh; /* Reduce header height further for small screens */
  }

  .fleet-videos .ulc-vids {
    margin-top: calc(0px); /* Adjust margin for small screens */
  }

  .fleet-videos .ulc-vids h1 {
    font-size: 1.3rem;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212; /* Dark background */
    color: #e0e0e0; /* Light text */
  }

  .navbar {
    background-color: rgba(0, 0, 0, 0.9); /* Darker navbar */
  }

  .navbar a {
    color: #e0e0e0; /* Light text for links */
  }

  .navbar a:hover {
    color: #aaa; /* Slightly lighter hover */
  }

  .content-section, .fleet-videos .ulc-vids, .service-fleet-page .content-section {
    background-color: rgba(30, 30, 30, 0.9); /* Darker content background */
    color: #e0e0e0; /* Light text */
    border: 1px solid #444; /* Darker border */
  }

  .grid-container {
    background-color: #1e1e1e; /* Dark background for grid */
  }

  .grid-item p {
    background-color: rgba(0, 0, 0, 0.6); /* Slightly transparent background for captions */
    color: #e0e0e0; /* Light text for captions */
  }

  .apply-btn {
    background-color: #444; /* Darker button */
    color: #e0e0e0; /* Light text */
  }

  .apply-btn:hover {
    background-color: #777; /* Lighter on hover */
  }

  footer {
    background-color: transparent; /* Dark footer background */
    color: #e0e0e0;
  }

  .click-here a, .click-here-fleet a {
    color: #8bc34a; /* Light green text for links */
  }

  .click-here a:hover, .click-here-fleet a:hover {
    color: #d1983e; /* Light orange on hover */
  }

  .fleet-videos .ulc-vids h1, .service-fleet-page .content-section h1 {
    color: #e0e0e0; /* Light text for headings */
  }

  .overlay {
    background-color: rgba(0, 0, 0, 0.95); /* Darker overlay background */
  }

  .overlay-content a {
    color: #e0e0e0; /* Light text for overlay links */
  }

  .overlay-content a:hover {
    color: #8bc34a; /* Green hover effect */
  }
}

/* Ensure links in dark mode remain consistent */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #8bc34a;
  text-decoration: underline;
}