html, body {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: #f6f7fb;
  color: #2a3267;
  box-sizing: border-box;
}

body.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  background: linear-gradient(90deg, #323a46 0%, #43495a 100%);
  box-shadow: 0 4px 24px rgba(50,60,80,.09);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-sizing: border-box;
}

/* Logo styles */
.navbar .logo {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(90deg,#03dec0,#625fff 85%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  white-space: nowrap;
}

/* Navbar links container */
.navbar-links {
  display: flex;
  align-items: center;
}

/* About Us button styling */
.about-btn {
  background: #625fff;
  color: #fff;
  border: none;
  padding: 0.6em 1.5em;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(98,95,255,0.09);
  white-space: nowrap;
}

.about-btn:hover,
.about-btn:focus {
  background: #03dec0;
  color: #222;
}

/* Mobile responsiveness - fixed alignment */
@media (max-width: 600px) {
  .navbar {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.7rem 3vw;
    height: auto;
  }
  .navbar .logo {
    font-size: 1.15rem;
    letter-spacing: -1px;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    text-align: left;
    padding-right: 0.4em;
  }
  .navbar-links {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  .about-btn {
    padding: 0.36em 1em;
    font-size: 0.97rem;
    border-radius: 5px;
    margin: 0;
    align-self: center;
    white-space: nowrap;
  }
}

/* Main landing section */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.landing-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 40px;
  padding: 3.2rem 1rem 2.1rem 1rem;
  flex: 1;
  box-sizing: border-box;
}
.landing-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 510px;
  flex: 1.2;
  z-index: 2;
}
.landing-left h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  line-height: 1.2;
  color: #232c4b;
  letter-spacing: -.5px;
  background: linear-gradient(90deg,#074539,#2f319f 75%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-left p {
  color: #495086;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  max-width: 96vw;
}
.landing-left .highlight, .landing-left a {
  color: #6557ff;
  font-weight: 600;
  text-decoration: none;
}
.upload-box {
  background: #f6f7fb;
  box-shadow: 0 8px 24px rgba(93,125,255,0.08);
  padding: 1.2rem 1.1rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  max-width: 380px;
}
.upload-btn {
  background: linear-gradient(90deg, #5a78f9 5%, #6a87ff 70%);
  border: none;
  min-width: 150px;
  color: white;
  font-size: 1.09rem;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(75,90,255,0.08);
  margin-bottom: 0.1rem;
  transition: box-shadow .18s,transform .13s;
}
.upload-btn:hover, .upload-btn:focus {
  background: linear-gradient(90deg,#625fff,#03dec0 98%);
  box-shadow: 0 8px 24px rgba(50,73,190,0.13);
  transform: translateY(-1.5px) scale(1.018);
}

.landing-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  z-index: 1;
}
.landing-image {
  background: #0f5170;
  max-width: 540px;
  width: 100%;
  min-width: 270px;
  height: auto;
  object-fit: contain;
  border-radius: 1.5rem;
  box-shadow: 0 16px 36px 0 rgba(33,40,92,0.23);
  margin: 0 8px 0 0;
  filter: drop-shadow(0 16px 44px rgba(2,23,45,0.08));
}
.landing-image:hover {
  transform: scale(1.02) translateY(-5px);
  box-shadow: 0 14px 38px rgba(41,58,195,0.08);
}


/* Footer */
.legal-footer {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(90deg, #323a46 0%, #43495a 100%);
  color: #e5ebf3;
  font-family: 'Inter', sans-serif;
  padding: 1.1rem 1.2rem 1.2rem 1.2rem;
  border-top: 1px solid #505a6f;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.7;
  margin-top: auto;
}

/* Footer links/buttons row */
.footer-links {
  display: flex;
  gap: 2em;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.6em;
}

/* Button links in the footer for navigation */
.footer-link {
  background: none;
  border: none;
  color: #57f7df;
  font-size: 1.06rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin: 0 0.15em;
  text-decoration: underline;
  transition: color 0.18s, text-decoration-color 0.18s;
  outline: none;
}

.footer-link:hover,
.footer-link:focus {
  color: #38e3c2;
  text-decoration: underline;
}

/* Copyright or additional info row */
.footer-copy {
  color: #e5ebf3;
  font-size: 1.02rem;
  margin-top: 0.8em;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

.legal-footer p {
  margin: 0;
  color: white;
  font-size: 1.05rem;
}

/* Hyperlinks, if any, inside legal-footer */
.legal-footer a {
  color: #57f7df;
  text-decoration: underline;
  transition: color 0.22s;
  word-break: break-all;
}

.legal-footer a:hover,
.legal-footer a:focus {
  color: #38e3c2;
  text-decoration: underline;
}

/* Responsive font, line and padding for small screens */
@media (max-width: 600px) {
  .legal-footer {
    padding: 0.8rem 0.4rem 1rem 0.4rem;
    font-size: 0.96rem;
  }
  .legal-footer p,
  .footer-copy {
    font-size: 0.97rem;
  }
  .footer-links {
    gap: 1.05em;
    font-size: 0.98rem;
    flex-wrap: wrap;
  }
}

/* ========== Responsive Styles ========== */
@media (max-width: 900px) {
  .landing-container {
    flex-direction: column-reverse;
    gap: 1.2rem;
    padding: 2rem 4vw 1.2rem 4vw;
    align-items: stretch;
  }
  .landing-left, .landing-right {
    max-width: 100vw;
    width: 100%;
  }
  .landing-left h1 {
    font-size: 2.1rem;
    line-height: 1.18;
    margin-bottom: 0.7rem;
    text-align: left;
  }
  .upload-box {
    width: 100%;
    padding: 1.1rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 14px;
  }
  .landing-image {
    max-width: 85vw;
    min-width: 0;
    margin: 0 auto 1.3rem auto;
    display: block;
    border-radius: 1rem;
  }
}

@media (max-width: 600px) {
  .landing-container {
    flex-direction: column-reverse;
    gap: 0.8rem;
    padding: 1.2rem 3vw 0.8rem 3vw;
  }
  .landing-left h1 {
    font-size: 1.33rem;
    margin-bottom: 0.44rem;
    line-height: 1.23;
    text-align: left;
    letter-spacing: -1px;
  }
  .landing-left p {
    font-size: 1.04rem;
    margin-bottom: 0.97rem;
    line-height: 1.42;
  }
  .upload-box {
    padding: 0.7rem 0.2rem;
    border-radius: 8px;
    margin: 0.5rem 0 0 0;
    width: 100%;
  }
  .upload-btn {
    width: 100%;
    padding: 0.7rem 0.6rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  .landing-image {
    max-width: 99vw;
    width: 100%;
    min-width: 0;
    margin: 0 auto 1.05rem auto;
    display: block;
    border-radius: 13px;
  }
  .footer-container {
    font-size: 0.92rem;
    padding: 1.05rem 2vw 0.7rem 2vw;
  }
}

.upload-btn:focus {
  outline: 2px solid #6557ff;
  outline-offset: 2px;
}




----------------------------------------------------------------------------------------------------------




html, body {
   min-height: 100vh;
   width: 100%;
   overflow-x: hidden;
   padding: 0;
   margin: 0;
   box-sizing: border-box;
}

body.converter {
   font-family: 'Inter', sans-serif;
   background: linear-gradient(135deg, #667788, #346b93);
   color: #222;
   min-height: 100vh;
   display: block;
}

/* Center the content horizontally, allow vertical scroll if needed */
.page-wrapper {
   background: whitesmoke;
   max-width: 960px;
   width: 100%;
   border-radius: 18px;
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
   padding: 3rem 2.5rem;
   margin: 3vh auto 3vh auto;
   animation: fadeInUp 0.8s ease forwards;
   box-sizing: border-box;
}

/* Header */
.header {
   text-align: center;
   margin-bottom: 2.5rem;
}

.title {
   font-size: 2.3rem;
   font-weight: 900;
   background: linear-gradient(90deg, #4f5eff, #351a88);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   letter-spacing: -0.5px;
   margin-bottom: 0.75rem;
   line-height: 1.2;
   transition: transform 0.3s;
}

.title:hover {
   transform: scale(1.02);
}

.subtitle {
   font-size: 1.12rem;
   color: #0f0101;
   max-width: 700px;
   margin: 0 auto 0 auto;
   line-height: 1.6;
   text-align: center;
}

/* Upload Form */
.upload-form {
   display: flex;
   flex-direction: column;
   align-items: center;
   margin-bottom: 2.2rem;
   gap: 1rem;
}

.upload-label {
   background: #eef1f5;
   border: 2px dashed #bbb;
   padding: 0.85rem 1.7rem;
   border-radius: 12px;
   font-size: 1rem;
   cursor: pointer;
   transition: background 0.3s;
}

.upload-label:hover {
   background: #e1e6ec;
}

.file-input {
   display: none;
}

.btn-submit, .btn-download {
   background: linear-gradient(90deg, #585d93, #b527ab);
   border: none;
   color: white;
   font-size: 1rem;
   padding: 0.8rem 2rem;
   border-radius: 10px;
   cursor: pointer;
   font-weight: 600;
   box-shadow: 0 6px 18px rgba(79, 94, 255, 0.18);
   transition: all 0.3s;
   margin-top: 0.7rem;
}

.btn-submit:hover,
.btn-download:hover {
   background: linear-gradient(90deg, #3c46f0, #5564ff);
   transform: translateY(-2px) scale(1.03);
   box-shadow: 0 12px 30px rgba(79, 94, 255, 0.18);
}

/* Preview Section */
/* Preview Section Wrapper */
/* Preview Section */
/* Preview Section Wrapper */
.preview-section {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2.2rem;
}

/* Each Box (Original / Result) */
.preview-box {
  background: transparent; /* Let JS set the background */
  padding: 1.5rem;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  position: relative;
  overflow: visible;

  width: 100%;
  max-width: 420px;
  min-width: 260px;
  min-height: 280px;

  transition: transform 0.27s ease-in-out;
  text-align: center;
}

/* Image Styling */
.preview-image {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;

  background: transparent;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

  margin-top: 0.5rem;
  transition: transform 0.23s ease, box-shadow 0.2s ease;
}

.preview-box:hover {
  transform: translateY(-3px) scale(1.012);
}

.preview-box h3 {
  font-size: 1.22rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 1rem;
  letter-spacing: -0.25px;
}

.preview-image:hover {
  transform: scale(1.025);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.11);
}

.btn-download {
  display: inline-block;
}

/* 🔁 Mobile-Friendly Enhancements */
@media (max-width: 600px) {
  .preview-section {
    flex-direction: column;
    gap: 1.5rem;
  }

  .preview-box {
    padding: 1rem;
    min-width: auto;
    max-width: 100%;

    /* Ensure the background color set by JS is visible on mobile */
    background-color: unset; /* fallback to parent bg */
  }

  .preview-image {
    max-height: 250px;
    margin-top: 0.6rem;

    /* Ensure image background is transparent */
    background: transparent;
  }

  .btn-download,
  .edit-button {
    width: 100%;
    margin-top: 0.8rem;
  }
}

/* Footer */
.footer {
   text-align: center;
   margin-top: 3rem;
   color: #01031e;
   font-size: 1.4rem;
}

/* Spinner */
.spinner {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 12px;
   margin: 24px 0;
}
.spin {
   width: 28px;
   height: 28px;
   border: 4px solid #eee;
   border-top: 4px solid #270967;
   border-radius: 50%;
   animation: spin 1s linear infinite;
}
@keyframes spin {
   0% { transform: rotate(0deg);}
   100% { transform: rotate(360deg);}
}
.hidden { display: none !important; }

/* Responsive Design */
@media (max-width: 1024px) {
   .page-wrapper {
      padding: 2rem 1vw;
   }
   .preview-section {
      gap: 1rem;
   }
}

@media (max-width: 800px) {
   .page-wrapper {
      padding: 1.2rem 0.3rem;
      border-radius: 0;
      box-shadow: none;
   }
   .header {
      padding: 0 10px;
   }
   .preview-section {
      flex-direction: column;
      gap: 1.1rem;
      align-items: stretch;
   }
   .preview-box {
      max-width: 98vw;
      min-width: 0;
      width: 99vw;
      margin: 0 auto 0 auto;
      padding: 1rem .35rem 1.05rem .35rem;
      min-height: 200px;
   }
   .preview-image {
      max-height: 45vw;
      min-height: 120px;
      border-radius: 11px;
   }
   .title {
      font-size: 1.4rem;
   }
   .subtitle {
      font-size: 1rem;
      padding: 0 8px;
      line-height: 1.4;
   }
   .btn-submit, .btn-download {
      font-size: 0.97rem;
      padding: 0.69rem 1.1rem;
      border-radius: 7px;
   }
   .upload-label {
      font-size: 0.97rem;
      padding: 0.6rem 0.8rem;
      border-radius: 7px;
   }
}

/* Mobile (fully tuned) */
@media (max-width: 500px) {
   .page-wrapper {
      border-radius: 0;
      box-shadow: none;
      padding: 0.4rem 0.01rem 0.6rem 0.01rem;
   }
   .header {
      margin-bottom: 0.7rem;
      padding: 0 2vw;
   }
   .preview-section {
      gap: 0.7rem;
   }
   .preview-box {
      width: 99vw;
      max-width: 99vw;
      min-width: 0;
      padding: 0.7rem 0.2rem 1rem 0.2rem;
      border-radius: 10px;
      margin: 0 auto 0 auto;
      min-height: 180px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
   }
   .preview-box h3 {
      font-size: 1rem;
      margin-bottom: 0.5rem;
   }
   .preview-image {
      width: 96vw;
      max-width: 96vw;
      min-width: 0;
      max-height: 45vw;
      min-height: 94px;
      border-radius: 8px;
      margin-top: 0.2em;
      margin-left: auto;
      margin-right: auto;
      background: transparent;
   }
   .title {
      font-size: 1.01rem;
      margin-bottom: 0.28rem;
      line-height: 1.17;
   }
   .subtitle {
      font-size: 0.9rem;
      padding: 2px 4px;
      letter-spacing: 0.02em;
      line-height: 1.17;
   }
   .btn-submit, .btn-download {
      padding: 0.53rem 0.5rem;
      font-size: 0.95rem;
      border-radius: 6px;
   }
   .upload-label {
      padding: 0.44rem 0.59rem;
      font-size: 0.91rem;
      border-radius: 5px;
   }
}

/* Animation */
@keyframes fadeInUp {
   from {
      opacity: 0;
      transform: translateY(30px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}



/* Edit Button Group */
.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.btn-edit {
 background: linear-gradient(90deg, #585d93, #b527ab);
   border: none;
   color: white;
   font-size: 1rem;
   padding: 0.8rem 2rem;
   border-radius: 10px;
   cursor: pointer;
   font-weight: 600;
   box-shadow: 0 6px 18px rgba(79, 94, 255, 0.18);
   transition: all 0.3s;
   margin-top: 0.7rem;
}

.btn-edit:hover {
  background: linear-gradient(90deg, #3c46f0, #5564ff);
   transform: translateY(-2px) scale(1.03);
   box-shadow: 0 12px 30px rgba(79, 94, 255, 0.18);
}
@media (max-width: 600px) {
  .btn-edit {
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
}
/* Edit Section */
.edit-section {
  display: none;
  margin-top: 3rem;
  background: #f5f5f5;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  animation: fadeInUp 0.6s ease;
}

.edit-section h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  font-weight: bold;
  text-align: center;
}

/* Color Buttons */
.edit-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1.4rem;
}

.edit-buttons button,
.edit-buttons input[type="color"] {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #e0e0e0;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.25s;
}

.edit-buttons button:hover {
  background: #cfcfcf;
}

/* Preview Area */
.preview-container {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Container that holds the background */
#resultWrapper {
  position: relative;
  padding: 20px;
  border-radius: 10px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Image inside the preview */
.preview-container img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: transparent;
  background-color: transparent;
  z-index: 1;
  position: relative;
}

/* Download Edited Image Button */
.download-edited-btn {
  margin-top: 1.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, #4CAF50, #2eaa2e);
  color: white;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s, box-shadow 0.25s;
}

.download-edited-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive: Edit Section */
@media (max-width: 600px) {
  .edit-buttons {
    flex-direction: column;
    align-items: center;
  }

  .edit-buttons button,
  .edit-buttons input[type="color"] {
    width: 90%;
    text-align: center;
  }

  .edit-section {
    padding: 1rem;
  }
}
