/* ---------------------
   Base Reset & Body Styling
------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  color: #F0F0F0;  /* Light text for contrast on darker backgrounds */
  background: linear-gradient(45deg, #8B0000, #4B0082, #00008B);  /* Dark red to dark blue gradient */
  background-size: 400% 400%;
  animation: gradientBackground 10s ease infinite;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@keyframes gradientBackground {
  0% {
      background-position: 0% 50%;
  }
  50% {
      background-position: 100% 50%;
  }
  100% {
      background-position: 0% 50%;
  }
}

/* ---------------------
 Header Styling
------------------------ */
header {
  color: #F0F0F0;
  padding: 20px;
  text-align: center;
  background: linear-gradient(90deg, #8B0000, #4B0082, #00008B);
  background-size: 400% 400%;
  animation: headerGradient 8s ease infinite;
}

@keyframes headerGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

header h1 {
  margin: 0;
}

header hr {
  margin-top: 15px;
  border: 0;
  border-top: 1px solid rgba(240, 240, 240, 0.3);
}

/* ---------------------
 Navigation (Centered & Styled)
------------------------ */
nav {
  background: linear-gradient(90deg, #3b0069, #5a008d);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  transition: background 0.5s ease;
  text-align: center; /* Center-aligns the inline-block elements */
}

nav:hover {
  background: linear-gradient(90deg, #4c007d, #6b00a1);
}

nav ul {
  list-style: none;
  display: inline-block; /* Allows the ul to be centered */
  padding: 0;
  margin: 0;
}

nav ul li {
  display: inline-block; /* Aligns the list items horizontally */
  margin: 0 5px; /* Adjusts spacing between navigation items */
}

nav ul li a {
  display: block;
  padding: 10px 15px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.2);
  color: #F0F0F0;
  font-size: 1.1em;
  text-decoration: none;
  transition: transform 0.3s ease, background 0.3s ease;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

nav ul li a.active {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* ---------------------
 Main Content Styling
------------------------ */
main {
  flex-grow: 1;
  padding: 20px;
  max-width: 1200px;
  margin: 20px auto;  /* Centers the main content */
  text-align: left;
}

main > * {
  margin-bottom: 20px;
}

h2 {
  font-size: 1.8em;
  margin-bottom: 10px;
}

p {
  font-size: 1.2em;
  margin-bottom: 20px;
}

/* Spacing for table elements */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;  /* Vertical spacing for tables */
}

table, th, td {
  border: 1px solid #555;
}

th, td {
  padding: 8px;
  text-align: left;
}

caption {
  font-weight: bold;
  margin-bottom: 10px;
}

/* Ensure spacing if any element follows a table */
table + * {
  margin-top: 20px;
}

/* ---------------------
 Contact Form Styling
------------------------ */
form {
  background: rgba(0, 0, 0, 0.3);  /* Slight transparent background for form */
  padding: 20px;
  border-radius: 10px;
  max-width: 600px;
  margin: 30px auto;  /* Centers the form */
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

form label {
  display: block;
  margin-bottom: 5px;
  font-size: 1.1em;
}

form input[type="text"],
form input[type="email"],
form textarea {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 1em;
  background-color: #f0f0f0; /* Light background for input fields */
  color: #333; /* Dark text for contrast */
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form textarea:focus {
  outline: none;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

form input[type="submit"] {
  background: #4B0082;
  color: #F0F0F0;
  padding: 10px 20px;
  border: none;
  border-radius: 30px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

form input[type="submit"]:hover {
  background: #8B0000;
  transform: scale(1.05);
}

/* ---------------------
   Footer (Dynamic & Fluid)
------------------------ */
footer {
  background: linear-gradient(90deg, #3b0069, #5a008d);
  color: #F0F0F0;
  text-align: center;
  padding: 40px;  /* Increased padding for more vertical space */
  position: relative;
  border-top: 4px solid rgba(255, 255, 255, 0.3); /* Corrected border-top property */
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.5s ease;
}

footer:hover {
  background: linear-gradient(90deg, #4c007d, #6b00a1);
}

footer hr {
  border: 0;
  border-top: 1px solid rgba(240, 240, 240, 0.3);
  margin-bottom: 20px;
}

footer p {
  margin: 10px 0;
  font-size: 1em;
}

footer a {
  color: #F0F0F0;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #ffcc00;
}

/* ---------------------
   Responsive Design Adjustments
------------------------ */
@media screen and (max-width: 768px) {
  nav ul {
    flex-direction: column;
  }

  nav ul li {
    margin-bottom: 10px;
  }
}
