/* ==== Base Layout ==== */
body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f0f4ff, #d9e4ff);
  color: #1a1a1a;
  margin: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.4s ease;
  min-height: 100vh;
}

/* ==== Dark Mode ==== */
body.dark {
  background: linear-gradient(135deg, #121212, #1f1f1f);
  color: #e0e0e0;
}

body.dark a {
  color: #80d0ff;
}

/* ==== Drop Zone ==== */
#dropZone {
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed #1976d2;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 40px;
  margin-top: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#dropZone.dragover {
  background: rgba(25, 118, 210, 0.15);
  border-color: #0d47a1;
}

body.dark #dropZone {
  background: rgba(40, 40, 40, 0.6);
  border-color: #555;
}

body.dark #dropZone.dragover {
  background: rgba(25, 118, 210, 0.25);
}

/* ==== Toggle Label ==== */
#darkModeLabel {
  position: fixed;
  top: 16px;
  right: 20px;
  background-color: #ffffff88;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#darkModeLabel:hover {
  background-color: #ffffffcc;
}

body.dark #darkModeLabel {
  background-color: #33333388;
}

body.dark #darkModeLabel:hover {
  background-color: #444;
}

/* ==== Input & Controls ==== */
input,
select {
  font-size: 1rem;
  padding: 8px 14px;
  margin: 8px;
  border: none;
  border-radius: 8px;
  outline: none;
  box-shadow: 0 0 0 2px #ccc;
  transition: box-shadow 0.3s ease;
}

input:focus,
select:focus {
  box-shadow: 0 0 0 2px #1976d2;
}

input[type="range"] {
  width: 150px;
}

/* ==== Buttons ==== */
button,
input[type="button"],
input[type="submit"] {
  background: linear-gradient(135deg, #1976d2, #0d47a1);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  margin: 1rem;
  box-shadow: 0 6px 18px rgba(25, 118, 210, 0.3);
  transition: all 0.3s ease;
}

button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #1565c0, #0b3d91);
  box-shadow: 0 8px 24px rgba(13, 71, 161, 0.4);
}

/* ==== Preview Area ==== */
.preview {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

.preview div {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 15px 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  width: 100%;
  justify-content: space-between;
  transition: transform 0.3s ease;
}

.preview div:hover {
  transform: scale(1.02);
}

.preview img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid #ccc;
  transition: transform 0.3s ease;
}

.preview img:hover {
  transform: scale(1.1);
}

.preview a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 500;
}

.preview a:hover {
  text-decoration: underline;
}

/* ==== Size Options ==== */
#sizeOptions label {
  margin: 0 8px;
  font-weight: 500;
  display: inline-block;
}

/* ==== Responsive ==== */
@media (max-width: 600px) {
  .preview div {
    flex-direction: column;
    text-align: center;
  }

  .preview img {
    margin-bottom: 10px;
  }
}

/* ==== Full Page Height & Flex Stretch Fix ==== */

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Stretch the body layout */
body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}

/* Main layout section fills screen and centers content */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Make drop zone and preview stretch fully */
#dropZone,
.preview {
  width: 100%;
  max-width: 100%;
}

/* Extra responsive tweaks */
@media (max-width: 600px) {
  button {
    width: 100%;
    max-width: 300px;
  }

  #dropZone {
    padding: 2rem 1rem;
  }

  .preview div {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

