@import url("https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Anton&family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Anton&family=Pacifico&family=Prompt:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f4f4f4;
  padding-bottom: 100px;
}

@font-face {
  font-family: "PublicStunt Personal";
  src: url("/assets/fonts/PublicStunt_PERSONAL_USE_ONLY.otf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Roslindale";
  src: url("/assets/fonts/Roslindale-TextRegular-Testing.ttf");
  font-weight: normal;
  font-style: normal;
}

/* @font-face {
  font-family: "AlfaSlabOne";
  src: url("/assets/fonts/AlfaSlabOne-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Anton";
  src: url("/assets/fonts/Anton-Regular.ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Pacifico";
  src: url("/assets/fonts/Pacifico-Regular.ttf");
  font-weight: normal;
  font-style: normal;
} */

h1 {
  padding: 0px 13px;
  margin-top: 25px;
  text-align: center;
}

/* A6 portrait */
#template {
  position: relative;
  width: 90%;
  max-width: 600px;
  aspect-ratio: 105 / 148;
  background: #fff;
  margin: 20px auto;
  border: 1px solid #ccc;
}

.landscape #template {
  aspect-ratio: 148 / 105;
}

.upload-box {
  position: absolute;
  border: 2px dashed #ccc;
  background: rgba(255, 255, 255, 0.224);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  overflow: hidden;
  z-index: 1;
}

.upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.upload-content {
  width: 100%;
  height: 100%;
}

.upload-box.has-image {
  border-style: solid;
  border-color: transparent;
}

.upload-box:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.topText {
  position: absolute;
  z-index: 2;
  font-size: 11px;
  font-family: "Roslindale", Arial, sans-serif;
  text-align: center;
  color: white;
  right: 12%;
  top: 57%;
}

.bottomText {
  z-index: 2;
  font-size: 9px;
  font-family: "Roslindale", Arial, sans-serif;
  text-align: center;
  color: white;

  .text-custom {
    color: #d93668;
    cursor: pointer;
  }

  .text-custom:focus,
  .text-custom.active {
    outline: 2px solid #4caf50;
  }

  .text-custom-v1 {
    position: absolute;
    right: 31%;
    top: 58.8%;
    line-height: 250%;
  }

  .text-custom-and {
    position: absolute;
    margin: 0px 4px;
    right: 28%;
    top: 59.4%;
  }

  .text-custom-v2 {
    position: absolute;
    left: 72.4%;
    top: 58.8%;
    line-height: 250%;
  }
}

.is-none {
  display: none;
}

@media (max-width: 568px) {
  .upload-box {
    top: 35.9% !important;
    left: 49.9%;
    width: 39.5%;
    height: 27.9% !important;
  }

  .text-custom-and {
    right: 27.5% !important;
  }

  .topText {
    font-size: 9px;
  }
  .bottomText {
    font-size: 8px;
  }
}

@media (max-width: 477px) {
  .topText {
    font-size: 8px;
  }

  .text-custom-and {
    right: 27.5% !important;
  }

  .bottomText {
    font-size: 7px;
  }
}

/* .text-box {
  position: absolute;
  z-index: 2; 
  border: 1px dashed transparent;
  padding: 5px;
  color: black;
  background: transparent;
  overflow: hidden;
  font-size: 16px;
  font-family: "Alfa Slab One", Arial, sans-serif;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.3vw;
} */

.text-with-stroke {
  /* font-weight: bold; */
  color: black;
  /* -webkit-text-stroke: .6px white; */
  /* -webkit-text-fill-color: black; */
}

.text-with-stroke.active {
  outline: 2px solid #4caf50;
}

.container {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  background: white;
  border: 1px solid #ccc;
}

.left-text {
  writing-mode: vertical-rl; /* Vertical text direction */
  text-orientation: sideways;
  transform: rotate(180deg); /* Flip to align correctly on the left */
}

.right-text {
  writing-mode: vertical-rl; /* Vertical text direction */
  text-orientation: sideways;
}

.text-box:focus {
  outline: 2px solid #4caf50;
}

.popup {
  position: fixed;
  top: 50%;
  left: 70%;
  min-width: 200px;
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid #ccc;
  padding: 20px 15px 20px 15px;
  /* display: none; */
  z-index: -1000;
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
  border-radius: 16px;
  transition: all 1s ease;
  transition-duration: 250ms;
  opacity: 0;
}

.popup label {
  margin: 0px;
  font-weight: 600;
}

.popup select {
  margin: 5px 0px 15px 0px;
  display: block;
}

.popup input {
  margin: 5px 0px 15px 0px;
  display: block;
}

.btn-close {
  transition: all 0.2s ease;
  transition-duration: 150ms;
  transform: scale(1);
  opacity: 1;
  width: 100%;
  font-size: 16px;
  padding: 10px 20px;
  margin-top: 40px;
}

button {
  cursor: pointer;
}

.btn-close:active {
  transition: all 0.2s ease;
  transition-duration: 150ms;
  transform: scale(0.9);
  opacity: 0.8;
}

.generate {
  margin-top: 20px;
  min-width: 210px;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 20px;
  color: #fff;
  background: #000;
  border: 1px solid #000;
  border-radius: 6px;
  transition: background 150ms ease, opacity 150ms ease, transform 150ms ease;
}

.generate:hover:not(:disabled) {
  background: #222;
}

.generate:active {
  transform: translateY(1px);
}

.generate:disabled {
  cursor: wait;
  opacity: 0.55;
}

.action-sheet {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.action-sheet.show {
  display: flex;
  opacity: 1;
}

.action-sheet-content {
  width: 100%;
  min-width: 100vw;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.action-sheet.show .action-sheet-content {
  transform: translateY(0);
}

.action-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-top: 1px solid #eee;
  background: #fff;
  color: #000;
  font-size: 16px;
  font-weight: 300;
  cursor: pointer;
  transition: background 0.25s ease;
}

.action-btn:hover {
  background: #f9fafb;
}

.action-btn:active {
  background: #f3f4f6;
}

.action-btn.cancel {
  color: #ef4444;
  font-weight: 600;
}

.crop-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crop-modal.show {
  display: flex;
  opacity: 1;
}

.crop-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  max-width: 95%;
  max-height: 95%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: fadeUp 0.3s ease;
}

.crop-modal-content img {
  max-width: 100%;
  max-height: 65vh;
  border-radius: 8px;
}

.crop-actions {
  width: 100%;
  margin-top: 16px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.crop-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#cropSave {
  background: linear-gradient(135deg, #1e1e1f, #000);
}

#cropCancel {
  background: linear-gradient(135deg, #b6b4b4, #7e7e7e);
}

#cropSave:hover,
#cropCancel:hover {
  transform: translateY(-2px);
}

@keyframes fadeUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.image-bottom {
  top: 53.2%;
  left: 14.4%;
  width: 37.3%;
  height: 37.7%;
}

/* Mobile Styles */
@media (max-width: 768px) {
  #template {
    width: 100%; /* Full width on small screens */
  }

  .upload-box {
    font-size: 12px;
  }

  button {
    font-size: 14px;
  }

  .popup {
    top: 45%;
    left: 55%;
  }

  .image-bottom {
    left: 14.1%;
  }
}
