/*Melissa Louise Bangloy*/
/* Base Reset and Universal Styles */
* {
  margin: 0;
  padding: 0.5em;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
  font-family: sans-serif;
  font-size: 16px;
  background-color: gainsboro;
}

body {
  display: flex;
  flex-direction: column;
  width: 90%;
  margin: auto;
}

/* Header and Footer */
header,
footer {
  background-color: whitesmoke;
  border: 1px solid grey;
  border-radius: 1.5em;
  text-align: center;
  font-size: 1rem;
  padding: 1em;
  margin-bottom: 1em;
}

/* Main Section */
#main {
  display: flex;
  flex-direction: column;
  background-color: rgb(19, 18, 18);
  border-radius: 1.5em;
  border: 0.6em solid black;
  padding: 1em;
  color: white;
}

/* Sections */
#form_section,
#table_list {
  background-color: gainsboro;
  border-radius: 1.5em;
  padding: 1em;
  margin-bottom: 1em;
  width: 100%;
}

/* Fieldset and Form */
#fieldset_wrapper {
  background-color: antiquewhite;
  border-radius: 1.5em;
  padding: 1em;
  width: 100%;
}

fieldset {
  border: none;
  display: flex;
  flex-direction: column;
  gap: 1em;
}

fieldset legend {
  font-size: 1.5rem;
  color: firebrick;
  background-color: whitesmoke;
  padding: 0.5em;
  border-radius: 0.5em;
  text-align: center;
}

/* Form Layout */
form {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 1em;
  border: 1px solid grey;
  border-radius: 1.5em;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  background-color: whitesmoke;
  border-radius: 1em;
}

.container legend {
  font-size: 1rem;
  font-weight: bold;
  color: black;
}

/* Input and Select */
input,
select {
  padding: 0.8em;
  font-size: 1rem;
  border-radius: 0.8em;
  border: 1px solid #ccc;
  width: 100%;
}

/* Button Styling */
#button_wrap {
  display: flex;
  flex-direction: column; 
  gap: 1em;
  margin-top: 1em; 
}

.buttons {
  background-color: rgb(36, 36, 221);
  color: white;
  font-size: 1rem;
  border-radius: 0.8em;
  padding: 0.8em 1.5em;
  border: none;
  cursor: pointer;
  width: 100%;
  max-width: 200px; 
}

.buttons:hover {
  background-color: rgb(111, 171, 250);
  color: black;
}

/* Table Styling */
#table_list {
  background-color: #40765a;
}

#table_wrap {
  border-radius: 1.5em;
  overflow: hidden;
}

#table_scroll {
  max-height: 350px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  margin-top: 1em;
  font-size: 0.95rem;
  text-align: center;
}

thead {
  background-color: #2b3d2b;
  color: white;
}

th, td {
  border: 1px solid black;
  padding: 0.5em;
}

tbody tr:nth-child(odd) {
  background-color: rgb(159, 169, 179);
  filter: grayscale(80%);
  color: rgb(12, 11, 11);
}
tbody tr:nth-child(even) {
    background-color: rgb(234, 237, 240);
    filter: grayscale(80%);
    color: rgb(12, 11, 11);
  }

/* Responsive Design */
@media (min-width: 600px) {
  form {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .container {
    flex: 1 1 45%;
  }

  #button_wrap {
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: wrap;
  }
}

@media (min-width: 900px) {
  #main {
    flex-direction: column;
    gap: 1em;
  }

  #form_section,
  #table_list {
    flex: 1;
  }

  form {
    flex-wrap: nowrap;
  }
}
