/* Global Styles */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(to bottom, #1a1a1a, #ff7a18); /* Dark grey to orange gradient */
  background-attachment: fixed; /* Fixed gradient for scrolling */
  color: #f0f0f0; /* Light text for contrast */
  min-height: 100vh; /* Ensures full screen height */
  display: flex;
  flex-direction: column; /* Enables footer placement */
}

/* Header */
header {
  background-color: #1a1a1a; /* Matches top of gradient */
  color: white;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* Subtle shadow */
}

header h1 {
  margin: 0;
  font-family: 'Poppins', sans-serif; /* Add a modern font */
  font-size: 2.5rem;
  font-weight: bold;
}

/* Main Section */
main {
  flex: 1; /* Pushes footer down */
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
}

/* Card Styles */
.card {
  background-image: linear-gradient(135deg, #ff5722, #ff9800); /* Orange gradient */
  background-color: transparent; /* Default transparent color */
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin: 1rem;
  padding: 1rem; /* Tighter padding for better spacing */
  width: calc(25% - 2rem); /* Default: 4 cards per row */
  min-height: 180px; /* Ensures consistent height for all cards */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center text vertically */
  text-align: center; /* Center text horizontally */
  transition: background-color 0.3s ease, background-image 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.1); /* Subtle white border */
}

.card.checked {
  background-image: none; /* Remove the gradient */
  background-color: #4caf50; /* Green color for checked state */
  color: white;
  box-shadow: 0 8px 16px rgba(76, 175, 80, 0.5); /* Green glow */
}

.card:hover {
  transform: translateY(-10px); /* Elevation effect */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5); /* Elevated shadow */
}

/* Card Content */
.card h2 {
  margin: 0 0 0.5rem; /* Compact spacing */
  font-size: 1.3rem; /* Slightly larger for emphasis */
}

.card p {
  margin: 0.5rem 0; /* Compact spacing */
  font-size: 1rem; /* Adjusted for better readability */
}

.card .button-container {
  margin-top: auto; /* Pushes the button to the bottom of the card */
  display: flex; /* Aligns the content within */
  justify-content: center; /* Centers the button horizontally */
}

.card .button-container a {
  color: black; /* Base link color */
  text-decoration: none; /* Remove underline */
  font-weight: bold;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card .button-container a:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: white;
}


/* Responsive Adjustments */
@media (max-width: 1024px) {
  .card {
    width: calc(45% - 2rem); /* 2 cards per row */
    min-height: 160px; /* Slightly reduced height for smaller screens */
  }
}

@media (max-width: 768px) {
  .card {
    width: calc(100% - 2rem); /* 1 card per row */
    min-height: 150px; /* Smaller height for mobile */
  }
}

/* Footer */
footer {
  background-color: #ff7a18; /* Matches bottom of gradient */
  text-align: center;
  padding: 1rem;
  color: white;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.5); /* Subtle shadow */
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease-out;
}

#rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Centers the cards horizontally */
  gap: 20px; /* Adds spacing between the cards */
  margin-bottom: 40px; /* Adds space between rules and indicators */
}

#indicators {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Centers the cards horizontally */
  gap: 20px; /* Adds spacing between the cards */
  margin-top: 40px; /* Ensures separation from the rules section */
}

/* Default card image styling */
.card img {
  max-width: 100%;
  border-radius: 10px;
  cursor: pointer; /* Show pointer to indicate it's clickable */
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth scaling and shadow effect */
}

/* Expanded image styling */
.card img.expanded {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1000;
  border-radius: 0;
  box-shadow: none;
  background-color: rgba(0, 0, 0, 0.8);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body {
  transition: overflow 0.3s ease; /* Smooth enable/disable of scrolling */
}


/* Backdrop styling (optional if you want a dimmed background) */
body.expanded-mode {
  overflow: hidden; /* Disable scrolling */
  background-color: rgba(0, 0, 0, 0.8); /* Darken the background */
}
