* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: url("../images/bg2.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  padding-top: 25px;
  overflow-x: hidden;
}

/* Chrome, Edge, Safari */
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.no-spinner {
  -moz-appearance: textfield;
}


.logo {
  width: 33vw;
}

.header {
  width: 100%;
  max-width: 1600px;
  margin-bottom: 20px;
  text-align: center;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.search-container {
  margin: auto;
  gap: 12px;
  z-index: 1001;
  background: #0000006b;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  /* background: rgba(255, 255, 255, 0.03); */
  /* border-radius: 16px; */
  /* border: 1px solid rgba(255, 255, 255, 0.06); */
  /* backdrop-filter: blur(10px); */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  flex-direction: row;
  BORDER-RADIUS: 10px;
  /* background: rgba(255, 255, 255, 0.03); */
  /* border-radius: 16px; */
  /* border: 1px solid rgba(255, 255, 255, 0.06); */
  /* backdrop-filter: blur(10px); */
  /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); */
}

/* 
.search-input {
  width: 100px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 15px;

  outline: none;
}

.search-input {
  transform-origin: right center;
  transition: transform 0.3s ease;
}

.search-input:focus {
  transform: scaleX(1);
}

.search-input:focus {
  width: 100%;


  border-color: #667eea;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
} */

.search-input {

  right: 70px;
  /* button width */

  width: 90px;
  padding: 9px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 15px;

  outline: none;
  transition: width 0.3s ease;
}

.search-input:focus,
.search-input.expanded {
  width: 180px;
  border-color: #667eea;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}


.search-input::placeholder {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.canvas-container {
  position: relative;
  border-radius: 18%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #00000080;
}

canvas {
  display: block;
  /* max-width: 98vw;
  max-height: 90vh; */
  cursor: pointer;
  backface-visibility: hidden;
  border-radius: 18%;
  touch-action: none;
  width: 41vw;
  height: auto;
}

/* Modal Styles */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.5s ease, backdrop-filter 0.5s ease;
}

.modal-overlay.active {
  display: flex;
  /* background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px); */
}

.modal-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #ffffffe0 0%, #47f35ca6 100%);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.8);
  opacity: 0;
  color: black;
  /* ✅ RESPONSIVE MAGIC */
  width: min(305px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 2s ease,
    left 2s cubic-bezier(0.16, 1, 0.3, 1),
    top 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-title {
  font-size: clamp(1.1rem, 4vw, 1rem);
  font-weight: 600;
}

/*
.modal-title {
  font-size: 1.5rem;
    font-weight: 600;
    color: black;
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6fffa9 0%, #74ff0a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text; 
}*/

.close-btn {
  width: 29px;
  height: auto;
  border-radius: 50%;
  border: none;
  background: rgb(255 255 255 / 91%);
  color: black;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-image-container {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-image {
  width: 100%;
  height: auto;
  max-height: 60vh;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}


.highlight-box {
  position: absolute;
  border: 3px solid #667eea;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
    inset 0 0 20px rgba(102, 126, 234, 0.2);
  pointer-events: none;
  animation: pulse 2s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
      inset 0 0 20px rgba(102, 126, 234, 0.2);
  }

  50% {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.9),
      inset 0 0 30px rgba(102, 126, 234, 0.3);
  }
}

.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}

.status-message {
  margin-top: 15px;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(213, 216, 231, 0.555);
  border: 1px solid rgba(234, 172, 102, 0.3);
  color: #000000;
  text-align: center;
  font-size: 14px;
  display: none;
}

.status-message.show {
  display: block;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zoom-controls {
  margin-top: 15px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.zoom-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.zoom-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 28px rgba(102, 126, 234, 0.6);
}

.zoom-btn:active {
  transform: scale(0.95);
}

.canvas-container {
  /* user-select: none; */
  /* touch-action: none; prevent touch scrolling on mobile */
}

.download-btn {
  padding: 5px 16px;
  font-size: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6fffa9, #74ff0a);
  color: #000;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.993);
}

.download-btn:hover {
  transform: translateY(-2px);
}

.btn_conatiners {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  gap: 5px;
}

@media (max-width: 768px) {
  canvas {
    width: 70vw;
  }

  .modal-content {
    width: 94vw;
    max-height: 92vh;
    padding: 12px;
  }

  .modal-image {
    max-height: 55vh;
  }

  .logo {
    width: 70vw;
  }

  .close-btn {
    font-size: 1rem;
    width: 20px;
  }

  .download-btn {
    padding: 5px 15px;
    font-size: 12px;
  }

}

@media (max-width: 480px) {
  canvas {
    width: 86vw;
  }

  .modal-content {
    width: 38vw;
    padding: 7px;
    border-radius: 14px;
  }

  .logo {
    width: 70vw;
  }

  .modal-image {
    max-height: 50vh;
    border-radius: 12px;
  }

  .download-btn {
    width: 100%;
    text-align: center;
    padding: 5px 15px;
    font-size: 10px;
  }

  .btn_conatiners {
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
  }

  .modal-title {
    /* font-size: clamp(1.1rem, 4vw, 1.5rem); */
    font-weight: 600;
    font-size: 0.6rem;
  }
}

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: none;
  z-index: 10;
}

.loader-gif {
  width: clamp(50px, 20vw, 150px);
  display: block;
  margin: 0 auto 10px;
}

.loader-main-text {
  color: white;
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: bold;
  margin-bottom: 5px;
}

.loader-sub-text {
  color: white;
  font-size: clamp(0.9rem, 3vw, 1.4rem);
}