body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #1e1e1e, #006400, #00bfff, #00ff80);
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

table {
  width: 100%;
  border-collapse: collapse;
}

table, th, td {
  border: 1px solid black;
  padding: 0.5rem;
  text-align: left;
}

th {
  background-color: #4CAF50;
  color: white;
}

input[type="submit"] {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  cursor: pointer;
}

input[type="submit"]:hover {
  background-color: #45a049;
}

button {
  background-color: #008CBA;
  color: white;
  padding: 0.5rem 0.75rem;
  border: none;
  cursor: pointer;
  text-align: center;
}

button:hover {
  background-color: #007B9E;
}

input,
select,
button {
  font-size: 1rem;
  max-width: 100%;
  box-sizing: border-box;
}

input[type="text"],
input[type="time"],
select {
  width: 100%;
  padding: 0.5rem;
  min-height: 2.5rem;
}

#add-schedule-form .form-group input,
#add-schedule-form .form-group select {
  max-width: 100%;
}

.form-input {
  width: 100%;
}

.form-submit {
  width: auto;
  display: inline-block;
  margin-top: 0.625rem;
}

.centered-content > form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#schedule-data {
  margin-top: 1.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#schedule-data > * {
  max-width: 100%;
}

#schedule-data table {
  width: auto;
  margin-left: auto;
  margin-right: auto;
}

td:nth-child(4) input[type="checkbox"] {
  display: block;
  margin: 0 auto;
}

th:nth-child(5) {
  min-width: 7.5rem;
}

/* Name column */
th:nth-child(1), td:nth-child(1) {
  width: 20%;
}

/* Scene column */
th:nth-child(2), td:nth-child(2) {
  width: 29%;
}

/* Activation Time and Days column */
th:nth-child(3), td:nth-child(3) {
  width: 27%;
}

/* Status column */
th:nth-child(4), td:nth-child(4) {
  width: 5%;
}

/* Change Time column */
th:nth-child(5), td:nth-child(5) {
  width: 9%;
}

/* Action column */
th:nth-child(6), td:nth-child(6) {
  width: 5%;
}

/* Delete column */
th:nth-child(7), td:nth-child(7) {
  width: 5%;
}

.day-selection-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
  justify-items: center;
}

.container {
  width: min(95vw, 1200px);
  padding: clamp(1rem, 4vw, 2rem);
  text-align: center;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 0.9375rem;
  position: relative;
  margin: clamp(1rem, 4vw, 2rem) auto;
}

h1 {
  font-size: clamp(2rem, 4vw, 3em);
  margin-bottom: 1.25rem;
  color: #00ff80;
}

.tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2rem);
}

a {
  text-decoration: none;
  color: #00ff80;
}

/* Logout icon */
.logout-icon {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  font-size: 1.5em;
  cursor: pointer;
  background: none;
  border: none;
  color: #ff4d4d;
  transition: color 0.3s ease;
}

.logout-icon:hover {
  color: #cc0000;
}

/* Hue page layout overrides */
.hue-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  width: 100%;
}

.hue-page .centered-content {
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: center;
}

.hue-page table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

/* Ensure action column text is white */
.hue-page td.action-cell,
.hue-page .clickable-action {
  color: #ffffff;
}

/* Optional: keep the Action column header readable on dark bg */
.hue-page th.action-col {
  color: #ffffff;
}

.centered-content > #schedule-data {
  width: 100%;
  margin: 1.25rem auto 0;
}

@media (max-width: 768px) {
  body .container,
  .hue-page .centered-content {
      max-width: none;
      width: 95vw;
      margin: 0 auto;
  }

  .tiles {
      flex-direction: column;
      align-items: center;
  }

  .tile {
      width: 100%;
      height: auto;
      padding: 1.25rem;
      margin-bottom: 0.625rem;
  }

  #schedule-data {
      width: 100%;
      overflow-x: auto;
  }

  input,
  select,
  button {
      width: 100%;
      max-width: none;
  }

  body,
  h1,
  h2 {
      font-size: 90%;
  }
}
