* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #ddd;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-top: 90px;
}

.canvas-container {
  position: relative;
  aspect-ratio: 16/9;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}

.image-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#bgImage {
  z-index: 1;
}

#textLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

#fgImage {
  z-index: 3;
}

.text-element {
  position: absolute;
  cursor: move;
  user-select: none;
  white-space: nowrap;
}

.controls-panel {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.text-control {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.control-group {
  margin-bottom: 12px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  color: #666;
  font-size: 14px;
  margin-bottom: 4px;
}

.control-group select,
.control-group input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.control-group input[type="range"] {
  width: 100%;
  margin: 8px 0;
}

.control-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.duplicate-btn {
  background: #2c3e50;
  color: white;
}

.duplicate-btn:hover {
  background: #34495e;
}

.remove-btn {
  background: #e74c3c;
  color: white;
}

.remove-btn:hover {
  background: #c0392b;
}

.add-text-btn {
  width: 100%;
  padding: 12px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  margin-bottom: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.add-text-btn:hover {
  background: #2980b9;
}

.save-btn {
  width: 100%;
  padding: 12px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  margin-top: 20px;
  cursor: pointer;
}

.save-btn:hover {
  background: #219a52;
}

.refresh-btn {
  width: 100%;
  padding: 12px;
  background: #020202;
  color: white;
  border: none;
  border-radius: 4px;
  margin-bottom: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.refresh-btn:hover {
  background: #2980b9;
}

/* welcome */
.welcome {
  position: relative; /* Important to set context */
  height: 25vh;
}
.centered_div_welcome {
  position: absolute;
  top: 20%; /* Move to middle vertically */
  left: 50%; /* Move to middle horizontally */
  transform: translate(-50%, -50%); /* Perfectly center by offsetting */
  font-size: x-large;
}

/* Upload Button */
.upload_text_behind_button {
  position: relative;
  width: 10rem;
  height: 3rem;
  cursor: pointer;
  border: none;
  background: none;
  margin-top: 10%;
}

.upload_text_behind_button svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.border {
  width: 100%;
  height: 100%;
  stroke: black;
  stroke-width: 2px;
  fill: #0000;
  rx: 1em;
  ry: 1em;
  stroke-dasharray: 25;
  transition: fill 0.25s;
  animation: 4s linear infinite stroke-animation;
}

.upload_text_behind_button:hover .border {
  fill: #0001;
}

.upload_text_behind_button:focus .border {
  transition: fill 0.25s 7.75s;
  fill: #0000;
}

@keyframes stroke-animation {
  0% {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.txt-upload {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.txt-upload::after {
  content: "";
}

.upload_text_behind_button:focus .rect {
  stroke-dasharray: 50;
}
.upload_text_behind_button:focus .border {
  stroke: #0000;
}

.upload_text_behind_button:focus .txt-upload {
  opacity: 0;
  transition: opacity 0.25s 8s;
}

.upload_text_behind_button:focus .txt-upload::after {
  animation: 0.66666s anim step-end forwards,
    1.33333s 0.6666s anim2 linear infinite alternate;
}

@keyframes anim {
  0% {
    content: "i";
  }
  50% {
    content: "in";
  }
  to {
    content: "ing";
  }
}

@keyframes anim2 {
  0% {
    content: "ing";
  }
  33% {
    content: "ing.";
  }
  66% {
    content: "ing..";
  }
  to {
    content: "ing...";
  }
}

.loading {
  width: 100%;
  height: 100%;
  stroke: #0055d4;
  stroke-width: 2px;
  fill: none;
  rx: 1em;
  ry: 1em;
  stroke-dasharray: 0 100;
}

.upload_text_behind_button:focus .loading {
  transition: stroke 0.5s 7.5s, stroke-dasharray 8s 0.5s ease-out;
  stroke: #08ca08;
  stroke-dasharray: 100 0;
}

.done {
  fill: none;
  stroke: #000;
  stroke-dasharray: 0 100;
}

.upload_text_behind_button:focus .done-cloud {
  transition: stroke-dasharray 0.75s 8.5s ease-out;
  stroke-dasharray: 100 0;
}

.upload_text_behind_button:focus .done-check {
  transition: stroke-dasharray 0.5s 9.2s ease-out;
  stroke: #08ca08;
  stroke-dasharray: 100 0;
}

/* image gallary css */

.gallery {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  overflow: hidden;
  max-width: 1300px;
  margin: auto;
}
.gallery__strip {
  min-height: 100vh;
}
.gallery__strip__wrapper {
  flex: 0 0 100%;
  justify-content: flex-end;
  border-right: 2px solid #333;
  position: relative;
}

@media (min-width: 500px) {
  .gallery__strip__wrapper {
    flex: 0 0 50%;
  }
}
@media (min-width: 950px) {
  .gallery {
    height: 100vh;
  }
  .gallery__strip.one {
    animation: 60s move-it ease alternate infinite 5s;
    transform: translateY(2%);
  }
  .gallery__strip.three {
    animation: 70s move-it ease alternate infinite 6s;
    transform: translateY(2%);
  }
  .gallery__strip.two {
    animation: 58s move-it-2 ease alternate infinite 5s;
    transform: translateY(-50%);
  }
  .gallery__strip.four {
    animation: 65s move-it-2 ease alternate infinite 5.5s;
    transform: translateY(-50%);
  }
  .gallery__strip:hover {
    animation-play-state: paused;
  }
  .gallery__strip__wrapper {
    flex: 0 0 25%;
  }
}
.photo {
  position: relative;
  text-align: right;
  padding-bottom: 3rem;
}
.photo__image img {
  width: 90%;
  transform: translateX(30%);
  transition: 1s cubic-bezier(0.19, 1, 0.22, 1) 0.2s;
}
.photo:hover .photo__image img {
  transform: translateX(0%);
}

@keyframes move-it {
  0%,
  90%,
  100% {
    transform: translateY(2%);
  }
  45% {
    transform: translateY(-50%);
  }
}
@keyframes move-it-2 {
  0%,
  90%,
  100% {
    transform: translateY(-50%);
  }
  45% {
    transform: translateY(5%);
  }
}
