* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: #f4f4f4;
}

header,
footer {
  position: relative;
  background-color: #333;
  color: white;
  padding: 1rem;
  text-align: center;
}

.back-link {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: white;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.color-picker-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: white;
  border-radius: 5px;
}

#color-picker {
  border: none;
  width: 60px;
  height: 40px;
  cursor: pointer;
}

#color-scheme-mode {
  padding: 0.5rem;
  border-radius: 5px;
  border: 1px solid #ccc;
}

#get-scheme-btn {
  padding: 0.5rem 1rem;
  border-radius: 5px;
  border: none;
  background-color: #333;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#get-scheme-btn:hover {
  background-color: #555;
}

#color-scheme-display {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 400px;
  border-radius: 5px;
  overflow: hidden;
  background-color: white;
}

.color-column {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-in-out;
}

.color-column:hover {
    transform: scale(1.05);
}

.color-block {
  flex-grow: 1;
  transition: background-color 0.5s ease;
}

.color-hex {
  text-align: center;
  padding: 0.5rem;
  margin: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.color-hex:hover {
    background-color: #e0e0e0;
}

@media (max-width: 600px) {
    .color-picker-section {
        flex-direction: column;
        gap: 1rem;
    }

    #color-scheme-display {
        grid-template-columns: 1fr;
        height: auto;
    }

    .color-column {
        flex-direction: row;
        height: 100px;
    }

    .color-block {
        min-width: 0;
    }

    .color-hex {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-basis: 120px; /* Give hex value a fixed width */
        flex-shrink: 0;
    }
}