@import url('https://fonts.googleapis.com/css2?family=Nova+Flat&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #16213e;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

header, footer {
  background: #1a1a2e;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

main {
  flex: 1;
  padding: 1rem;
  max-width: 800px;
  margin: auto;
  background: #f0f2f5;
  border: 1px solid #3a3a5e;
}

h1 {
  color: #fff;
  text-align: center;
  margin: 1rem auto;
}

.converter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
  align-items: center;
}

.converter-group input {
  flex: 1 1 240px;
  padding: .6rem;
  font-size: 1rem;
}

#hex, #shortHex {
  letter-spacing: .2em;
}

#resetBtn, #eyedropperBtn, .copyBtn {
  background: #1e40af;
  color: #fff;
  border: none;
  padding: .7rem 1.2rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-right: .5rem;
  flex-shrink: 0;
  height: 2.6rem;
}

.preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

#colorSwatch {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 2px solid #ccc;
}

#colorNameDisplay {
  font-weight: bold;
  font-size: 1.1rem;
}

footer {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

@media (max-width: 500px) {
  .converter-group {
    flex-direction: column;
    height: 50px;
  }

  .preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .copyBtn {
    width: 10%;
    margin-right: 0;
  }

  #resetBtn, #eyedropperBtn {
    width: 100%;
    margin-right: 150px;
  }

  main {
    width: 350px;
  }

  #resetBtn {
    margin-top: 25px;
  }
}

/* Header */
header {
  background: #1a1a2e;
  border-bottom: 1px solid #3a3a5e;
  padding: 12px 24px;
  text-align: center;
}

header a {
  font-family: 'Nova Flat', cursive;
  font-size: 22px;
  color: #ffd700;
  text-decoration: none;
}

/* Main content */
main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 3rem;
  padding: 3rem 1rem;
  background: #f0f2f5;
  color: #000;
  border-radius: 16px;
  border: 1px solid #3a3a5e;
  box-shadow: 0 8px 24px rgb(0 71 171 / .15);
}

header a {
  font-family: 'Nova Flat', cursive;
  font-size: 22px;
  color: #ffd700;
  text-decoration: none;
}

header a:hover {
  text-decoration: none;
}

/* Footer */
footer {
  background: #1a1a2e;
  border-top: 1px solid #3a3a5e;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
  Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

footer .left a, footer .right a {
  color: #0dcaf0;
  text-decoration: none;
  margin: 0 .6rem;
}

footer .left a:hover, footer .right a:hover {
  text-decoration: none;
}

footer .left {
  flex: 1 1 40%;
  text-align: left;
}

footer .right {
  flex: 1 1 50%;
  text-align: right;
}

/* Responsive */

p {
  font-size: 20px;
  text-align: center;
}

@media (max-width: 950px) {
  main {
    flex: 1;
    max-width: 600px;
  }
}

@media (max-width: 650px) {
  main {
    flex: 1;
    max-width: 480px;
  }
}

@media (max-width: 500px) {
  main {
    flex: 1;
    max-width: 480px;
  }
}

@media (max-width: 480px) {
  header a {
    font-size: 22px;
  }

  main {
    flex: 1;
    max-width: 400px;
  }

  footer {
    flex-direction: column;
    gap: .5rem;
    font-size: 13px;
    text-align: center;
  }

  footer .left, footer .right {
    flex: unset;
    text-align: center;
  }

  footer .right a {
    margin: 0 .4rem;
  }
}
