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

/* Prevent horizontal scroll on small viewports */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #16213e;
  margin: 0;
  padding: 2rem 1rem 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.instructions {
  max-width: 500px;
  margin: 0 auto 1rem;
  background: #fff3cd;
  color: #856404;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ffeeba;
  font-size: .95rem;
  line-height: 1.4;
  text-align: left;
}

/* Container with different background */
.container {
  background: #f0f2f5;
  padding: 2rem 1.5rem;
  box-shadow: 0 0 15px rgba(0,0,0,.05);
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  margin-bottom: 40px;
}

h1 {
  color: #fff;
  font-size: 1.7rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.instructions {
  font-size: 1rem;
  color: #444;
  margin-bottom: 1rem;
  text-align: center;
  max-width: 100%;
  align-self: center;
}

/* Controls layout */
.controls {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

@media (min-width: 850px) {
  .controls {
    flex-wrap: nowrap;
  }
}

input[type='text'], input[type='file'] {
  padding: .5rem;
  font-size: 1rem;
  border-radius: 5px;
  border: 1px solid #ccc;
  flex: 1 1 auto;
  min-width: 150px;
}

input[type='file'] {
  max-width: 250px;
  flex: none;
}

.drop-zone {
  width: 100%;
  max-width: 500px;
  border: 2px dashed #aaa;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  color: #555;
  background: white;
  margin-bottom: 1rem;
  cursor: pointer;
  user-select: none;
  align-self: center;
}

.file-list {
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0,0,0,.05);
  overflow-y: auto;
  max-height: 300px;
  margin-bottom: 1rem;
  align-self: center;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.file-item:last-child {
  border-bottom: none;
}

.thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.info {
  flex: 1;
}

.buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: center;
}

button.download-all, button.reset-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #08c;
  color: white;
  border: none;
  padding: .6rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color .3s ease, color .3s ease;
}

button.reset-btn {
  background: #d44;
  gap: .25rem;
}

button.download-all:hover:not(.loading):not(.done) {
  background: #0072aa;
}

button.reset-btn:hover {
  background: #b33;
}

.icon {
  display: inline-block;
  font-size: 1.4rem;
  user-select: none;
  line-height: 1;
  transition: color .3s ease;
}

.rotating {
  animation: spin 1.5s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.done {
  background-color: #28a745 !important;
  color: white !important;
}

.done .icon {
  font-weight: bold;
  font-size: 1.4rem;
  color: white !important;
}

/* Footer full width with centered content */
footer {
  width: 100vw;
  background: #1a1a2e;
  border-top: 1px solid #3a3a5e;
  padding: 1rem 0;
  box-sizing: border-box;
  border-radius: 0;
  user-select: none;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  box-sizing: border-box;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .9rem;
  color: #333;
}

footer a {
  color: #0dcaf0;
  text-decoration: none;
  transition: color .3s ease;
  white-space: nowrap;
}

footer a:hover, footer a:focus {
  color: #0dcaf0;
  text-decoration: none;
}

.footer-left {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-start;
}

.footer-right {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}

@media (max-width: 500px) {
  .footer-content {
    flex-direction: column;
    gap: .75rem;
    font-size: .85rem;
    text-align: center;
    padding: 0 1rem;
  }

  .footer-left, .footer-right {
    justify-content: center !important;
    flex: none;
  }

  .footer-right {
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  .controls {
    flex-wrap: wrap;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
  }

  .drop-zone {
    padding: 1rem;
  }

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

  .thumb {
    width: 100%;
    max-width: 120px;
    height: auto;
  }

  .buttons {
    flex-direction: column;
    width: 100%;
  }
}

header {
  width: 100%;
  max-width: 100%;
  background: #1a1a2e;
  border-bottom: 1px solid #3a3a5e;
  padding: 12px 24px;
  text-align: center;
  font-family: 'Nova Flat', cursive;
  font-size: 22px;
  color: #ffd700;
  text-decoration: none;
  margin-top: -30px;
}

header a {
  color: #ffd700;
  text-decoration: none;
}
