* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #10101c, #24143d);
  color: white;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 600px;
  margin: auto;
  padding: 18px;
}

header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 25px;
}

.logo {
  width: 55px;
  height: 55px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: linear-gradient(135deg, #ffcf40, #ff7b00);
}

h1 {
  margin: 0;
  font-size: 25px;
}

header p {
  margin: 5px 0 0;
  color: #bbb;
}

.card,
.result {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
}

textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 0;
  outline: none;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  background: #151522;
  color: white;
}

textarea::placeholder {
  color: #777;
}

button,
.download {
  width: 100%;
  margin-top: 15px;
  padding: 15px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffcc33, #ff7a00);
  color: #111;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}

button:disabled {
  opacity: 0.6;
}

.loading {
  text-align: center;
  padding: 25px 0 5px;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: auto;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

.result {
  margin-top: 20px;
}

.result h2 {
  margin-top: 0;
}

.result img {
  width: 100%;
  border-radius: 15px;
  display: block;
}

.download {
  background: #fff;
  color: #111;
}

footer {
  text-align: center;
  color: #777;
  padding: 25px 0;
  font-size: 13px;
}

/* ===== AI PHOTO RESULT ===== */

.result {
  margin-top: 24px;
  padding: 18px;
  border-radius: 20px;
  text-align: center;
}

.result h2 {
  margin-bottom: 16px;
}

.image-box {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #111;
  margin-bottom: 16px;
}

.image-box img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 18px;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download,
.again {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.again {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

@media (min-width: 600px) {
  .result {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }

  .result-buttons {
    flex-direction: row;
  }

  .download,
  .again {
    flex: 1;
  }
}

/* RESULT PHOTO FINAL DESIGN */

.result {
  margin-top: 25px;
  padding: 18px;
  border-radius: 20px;
}

.result h2 {
  text-align: center;
  margin-bottom: 15px;
}

.image-box {
  width: 100%;
  background: #111;
  border-radius: 18px;
  overflow: hidden;
  text-align: center;
}

.image-box img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.result-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.result-buttons .download,
.result-buttons .again {
  flex: 1;
  min-width: 0;
  padding: 13px 8px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  box-sizing: border-box;
}

@media (max-width: 420px) {
  .result-buttons {
    gap: 8px;
  }

  .result-buttons .download,
  .result-buttons .again {
    font-size: 13px;
    padding: 12px 5px;
  }
}

/* ===== PHOTO UPLOAD ===== */

#photoInput {
  display: block;
  width: 100%;
  margin: 10px 0 18px;
  padding: 12px;
  border: 1px dashed #aaa;
  border-radius: 12px;
  box-sizing: border-box;
}

#photoPreview {
  display: none;
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 16px;
  margin: 10px 0 18px;
}

#photoInput {
  margin: 10px 0;
  width: 100%;
}

#photoPreview {
  display: none;
  width: 100%;
  max-height: 350px;
  object-fit: contain;
  border-radius: 15px;
  margin: 10px 0 15px;
}

