* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  height: 100%;
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e293b 25%,
    #334155 50%,
    #1e293b 75%,
    #0f172a 100%
  );
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(
    135deg,
    #0f172a 0%,
    #1e293b 25%,
    #334155 50%,
    #1e293b 75%,
    #0f172a 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  height: auto;
  color: #ffffff;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 20%,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(147, 51, 234, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 60%,
      rgba(16, 185, 129, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: -1;
}
.placeholder-container .placeholder-icon {
  font-size: 46px;
}
.loadding_box {
  display: flex;
  justify-content: center;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
}
.sticky_btn {
  display: none;
}
.downloade_sticky {
  display: none;
}
.logo {
  max-height: 80px;
  max-width: 200px;
  height: auto;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
}
header h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.3);
  background: linear-gradient(45deg, #3b82f6, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
header p {
  font-size: 1.2rem;
  opacity: 0.9;
}
.upload-section {
  margin-bottom: 40px;
}
.upload-area {
  border: 3px dashed #3b82f6;
  border-radius: 15px;
  padding: 60px 20px;
  text-align: center;
  background: rgba(59, 130, 246, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  width: 100%;
  max-width: 1140px;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.upload-area:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}
.upload-area i {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
}
.upload-area p {
  font-size: 1.1rem;
}
.gallery-section {
  margin-bottom: 40px;
}
.gallery-section h2 {
  color: white;
  text-align: center;
  margin-bottom: 5px;
  font-size: 2rem;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 15px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.skeleton-item {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-radius: 15px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.skeleton-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: skeleton-shimmer 2s infinite;
}
.skeleton-image {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-radius: 12px;
  animation: skeleton-shimmer 1.5s infinite;
  position: relative;
  z-index: 1;
  margin-bottom: 15px;
}
.skeleton-text {
  width: 100%;
  height: 12px;
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-radius: 6px;
  margin-bottom: 8px;
  animation: skeleton-shimmer 1.5s infinite;
  position: relative;
  z-index: 1;
}
.skeleton-text:nth-child(2) {
  width: 80%;
}
.skeleton-text:nth-child(3) {
  width: 60%;
}
.skeleton-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}
.skeleton-button {
  flex: 1;
  height: 35px;
  background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
  border-radius: 8px;
  animation: skeleton-shimmer 1.5s infinite;
  position: relative;
  z-index: 1;
}
@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.gallery-grid:has(.gallery-item:only-child) {
  grid-template-columns: 1fr;
  justify-items: center;
}
.gallery-grid:has(.gallery-item:only-child) .gallery-item {
  max-width: 400px;
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
}
@media (min-width: 768px) {
  .main-content {
    display: flex !important;
    gap: 20px;
    align-items: flex-start;
    min-height: 600px;
    width: 100%;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }
}
.main-content {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  min-height: 600px;
  width: 100%;
  flex-direction: column;
  flex-wrap: nowrap;
}

@media (min-width: 768px) {
  .gallery-section,
  .content-right {
    display: block !important;
    float: none !important;
    clear: none !important;
  }
}
.main-content::after {
  content: "";
  display: table;
  clear: both;
}
.selected-prompt-container {
  margin: 15px 0;
  min-height: 0;
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
}
.selected-prompt-container.slide-up {
  animation: slideUpFromBottom 0.5s ease-out;
}

@keyframes slideUpFromBottom {
  0% {
    transform: translateY(100vh);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 767px) {
  .selected-prompt-container.slide-up {
    animation: slideUpFromBottomMobile 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  @keyframes slideUpFromBottomMobile {
    0% {
      transform: translateY(100vh);
      opacity: 0;
    }
    30% {
      opacity: 0.7;
    }
    100% {
      transform: translateY(0);
      opacity: 1;
    }
  }
}
@media (min-width: 768px) {
  .selected-prompt-container {
    margin: 10px 0;
  }
  .selected-prompt-container.slide-up {
    animation: slideUpFromBottom 0.6s ease-out;
  }
}
#selectedPromptDisplay {
  background: rgba(59, 130, 246, 0.9) !important;
  border: 3px solid #3b82f6 !important;
  border-radius: 10px;
  padding: 15px;
  padding-bottom: 10px;
  margin: 0;
  color: white !important;
  font-size: 0.9rem;
  line-height: 1.4;
  height: auto;
  overflow: visible;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 999;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(0);
}
#selectedPromptDisplay.slide-up {
  animation: slideUpFromBottom 0.7s ease-out;
}
#selectedPromptDisplay.content-change {
  animation: fadeInContent 0.2s ease-in-out;
}
@keyframes fadeInContent {
  0% {
    opacity: 0.8;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.gallery-section {
  flex: 1;
  width: 100%;
  margin-bottom: 20px;
  padding: 15px;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  height: 600px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .gallery-section {
    width: 50% !important;
    margin-bottom: 0;
    height: 600px !important;
    overflow: hidden;
    box-sizing: border-box;
  }
}
.gallery-section h2 {
  text-align: center;
  font-size: 1.2rem;
  color: white;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .gallery-section h2 {
    text-align: left;
    font-size: 1.4rem;
    margin-bottom: 20px;
  }
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
  gap: 15px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 15px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  width: 100%;
  height: 400px;
  max-height: 400px;
  box-sizing: border-box;
  transition: max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.5) transparent;
}
.gallery-grid.prompt-selected {
  max-height: 280px;
}
.gallery-grid::-webkit-scrollbar {
  width: 6px;
}
.gallery-grid::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}
.gallery-grid::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.5);
  border-radius: 3px;
  transition: background 0.2s ease;
}
.gallery-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.7);
}
@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    padding-right: 15px;
    height: auto;
    max-height: 515px;
    transition: max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.5) transparent;
  }
  .gallery-grid.prompt-selected {
    max-height: 350px;
  }
}
.gallery-item {
  width: 100%;
  height: auto;
  aspect-ratio: 3/2;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  box-sizing: border-box;
  margin: 2px;
}
.gallery-item:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.content-right {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 15px;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
@media (min-width: 768px) {
  .content-right {
    width: 50% !important;
    padding-left: 15px;
    height: 600px;
  }
}
.placeholder-section {
  margin-bottom: 3px;
  width: 100%;
}
.placeholder-container {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 15px;
  padding: 57px 15px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  height: 515px;
}
.preview-heading {
  text-align: left;
  margin-bottom: 15px;
}
@media (max-width: 767px) {
  .preview-heading {
    margin-bottom: 10px;
  }
  .sticky_btn {
    display: block !important;
  }
  .downloade_sticky {
    display: block;
    justify-content: center;
    display: flex;
  }
  .maindownload_sticky {
    display: none;
    justify-content: center;
    position: fixed;
    bottom: 26px;
    gap: 10px;
    z-index: 9999;
  }
  .mobile_sticky {
    display: flex;
    justify-content: center;
  }
  .mobile_sticky .sticky {
    position: fixed;
    bottom: 27px;
    z-index: 9999;
  }
  .placeholder-container {
    margin-top: 10px;
    height: 498px;
  }
  .upload-section {
    margin-bottom: 10px;
  }
}
.placeholder-icon {
  font-size: 4rem;
  color: #ffff;
  margin-bottom: 20px;
  opacity: 0.7;
}
.placeholder-container h3 {
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 15px;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
}
.placeholder-container p {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 30px;
  opacity: 0.9;
  max-width: 300px;
}
.placeholder-features {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  max-width: 250px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
}
.feature-item:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateX(5px);
}
.feature-item i {
  color: #3b82f6;
  font-size: 1.2rem;
  width: 20px;
}
.feature-item span {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
}
.selected-image-section,
.result-section {
  margin-bottom: 20px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.selected-image-container,
.result-container {
  max-width: 100%;
  width: 100%;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 15px;
  padding: 15px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  flex: 1;
}
.result-container img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.selected-image-container img,
.result-container img {
  max-width: 100%;
  max-height: 300px;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 15px;
  object-fit: contain;
}
.gallery-grid::-webkit-scrollbar,
.content-right::-webkit-scrollbar {
  width: 2px;
}
.gallery-grid::-webkit-scrollbar-track,
.content-right::-webkit-scrollbar-track {
  background: rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  margin: 6px;
}
.gallery-grid::-webkit-scrollbar-thumb,
.content-right::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.8);
  border-radius: 8px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  min-height: 40px;
}
.gallery-grid::-webkit-scrollbar-thumb:hover,
.content-right::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 1);
  border: 2px solid rgba(59, 130, 246, 0.5);
}
.gallery-grid::-webkit-scrollbar-thumb:active,
.content-right::-webkit-scrollbar-thumb:active {
  background: rgba(59, 130, 246, 1);
  border: 2px solid rgba(59, 130, 246, 0.7);
}
.gallery-grid {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.8) rgba(59, 130, 246, 0.2);
}
.gallery-item .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .overlay {
  opacity: 1;
}
.gallery-item .overlay i {
  color: white;
  font-size: 2rem;
}
.selected-image-section,
.result-section {
  /*margin-bottom: 40px;*/
  text-align: center;
}
.selected-image-section h2,
.result-section h2 {
  color: white;
  margin-bottom: 12px;
  font-size: 1.4rem;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
}
.selected-image-container,
.result-container {
  background: rgba(59, 130, 246, 0.1);
  border-radius: 15px;
  padding: 30px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: inline-block;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.selected-image-container img,
.result-container img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  
}
.enhancement-preview {
  background: rgba(59, 130, 246, 0.15);
  border: 2px solid #3b82f6;
  border-radius: 10px;
  padding: 5px 15px;
  margin: 15px 0;
  text-align: left;
}
.enhancement-preview h3 {
  color: #3b82f6;
  /*margin: 0 0 10px 0;*/
  font-size: 1.1rem;
}
.enhancement-preview p {
  color: #ffffff;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.image-actions,
.result-actions {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  widows: 100%;
  max-width: 200px;
}
.btn-primary {
  background: linear-gradient(45deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  font-weight: bold;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  background: linear-gradient(45deg, #2563eb, #1e40af);
}
.btn-secondary {
  background: linear-gradient(45deg, #64748b, #475569);
  color: white;
  border: 1px solid rgba(100, 116, 139, 0.3);
  box-shadow: 0 4px 15px rgba(100, 116, 139, 0.2);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(100, 116, 139, 0.4);
  background: linear-gradient(45deg, #475569, #334155);
}
.btn-success {
  background: linear-gradient(45deg, #10b981, #059669);
  color: #ffffff;
  font-weight: bold;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  background: linear-gradient(45deg, #059669, #047857);
}
.btn-info {
  background: linear-gradient(45deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  font-weight: bold;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}
.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  background: linear-gradient(45deg, #1d4ed8, #1e40af);
}
.loading-section {
  text-align: center;
  /* margin: 40px 0; */
  position: relative;
}
.loading-spinner {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15) 0%,
    rgba(147, 51, 234, 0.15) 100%
  );
  border-radius: 20px;
  padding: 127px 40px;
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  display: inline-block;
  border: 2px solid rgba(59, 130, 246, 0.4);
  position: relative;
  overflow: hidden;
  min-width: 300px;
}
.loading-spinner::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
.loading-spinner i {
  font-size: 4rem;
  color: #3b82f6;
  display: block;
  animation: pulse 1.5s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}
.loading-spinner p {
  color: white;
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.loading-steps {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.loading-step {
  display: flex;
  gap: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  opacity: 0;
  margin-bottom: 15px;
  animation: fadeInStep 0.5s ease-in-out forwards;
}
.loading-step:nth-child(1) {
  animation-delay: 0.5s;
}
.loading-step:nth-child(2) {
  animation-delay: 1s;
}
.loading-step:nth-child(3) {
  animation-delay: 1.5s;
}
@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.loading-step i {
  font-size: 1rem;
  color: #10b981;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 1023px) and (min-width: 768px) {
  .main-content {
    gap: 15px;
    margin-top: 30px;
  }
  .gallery-section {
    width: 50%;
  }
  .content-right {
    width: 50%;
    height: 600px;
  }
  .gallery-grid {
    max-height: 500px;
  }
  .gallery-grid:has(.gallery-item:only-child) {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .gallery-grid:has(.gallery-item:only-child) .gallery-item {
    max-width: 350px;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }
  .gallery-section h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }
}
@media (max-width: 767px) {
  body {
    /*min-height: 100vh;*/
    /*height: 100%;*/
    background-size: cover;
    background-repeat: no-repeat;
  }
@media (max-width: 767px) {
  .main-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
  }
  .main-content{
      gap: 0 !important;
  }
  .gallery-section {
    width: 100% !important;
    margin-bottom: 0;
    order: 2; 
    flex: none;
    padding: 0;
    border: none;
    height: 500px !important;
  }
  .content-right {
    width: 100% !important;
    order: 1;
    flex: none;
    padding: 0;
    border: none;
  }
  .gallery-grid::-webkit-scrollbar,
  .content-right::-webkit-scrollbar {
    display: none;
  }
  .gallery-grid {
    scrollbar-width: none;
  }
  .gallery-section h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
    /*margin-top:20px;*/
  }
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
    overflow-y: visible;
  }
  .gallery-grid:has(.gallery-item:only-child) {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 20px;
  }
  .gallery-grid:has(.gallery-item:only-child) .gallery-item {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    max-height: 300px;
  }
  .gallery-grid:has(.gallery-item:only-child) .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
  }
  .gallery-item {
    height: 140px;
    aspect-ratio: 3/4;
  }
  .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .container {
    padding: 15px;
  }
  .logo {
    max-height: 60px;
    max-width: 150px;
  }
  header h1 {
    font-size: 1.2rem;
  }
  header p {
    font-size: 1rem;
  }
  .upload-area {
    padding: 40px 15px;
  }
  .upload-area i {
    font-size: 2rem;
  }
  .image-actions,
  .result-actions {
      display: flex;
    flex-direction: row;
    align-items: center;
  }
  .btn {
    width: 100%;
    max-width: 150px;
    justify-content: center;
  }
  .result-container img {
    max-height: 70vh;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
  }
  @media (max-width: 767px) {
    .result-container img {
      max-height: 80vh;
      width: 100%;
      object-fit: cover;
      border-radius: 15px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    .result-container {
      padding: 15px;
      text-align: center;
    }
  }
  @media (min-width: 768px) and (max-width: 1024px) {
    .result-container img {
      max-height: 60vh;
      width: 100%;
      object-fit: cover;
      border-radius: 12px;
    }
  }
  @media (min-width: 1025px) {
    .result-container img {
      max-height: 70vh;
      width: 100%;
      object-fit: contain;
      border-radius: 10px;
    }
  }
  .selected-image-container,
  .result-container {
    padding: 20px;
  }
}
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    padding-left: 7px;
  }
  .gallery-item {
    height: 120px;
    aspect-ratio: 3/4;
  }
  .preview-heading {
    margin-bottom: 20px;
    text-align: center;
  }
  .upload-area {
    padding: 30px 10px;
  }
  .upload-area p {
    font-size: 1rem;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.selected-image-section,
.result-section,
.loading-section {
  animation: fadeIn 0.5s ease;
}
.skeleton-loader-section {
  margin-bottom: 20px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.skeleton-container {
  max-width: 100%;
  width: 100%;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 15px;
  padding: 20px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}
.skeleton-image {
  width: 100%;
  height: 200px;
  background: rgba(226, 232, 240, 0.3);
  border-radius: 10px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.skeleton-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.3),
    rgba(255, 255, 255, 0.6),
    rgba(59, 130, 246, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}
.skeleton-content {
  margin-bottom: 20px;
}
.skeleton-line {
  height: 16px;
  background: rgba(226, 232, 240, 0.6);
  border-radius: 8px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.skeleton-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.3),
    rgba(255, 255, 255, 0.6),
    rgba(59, 130, 246, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}
.skeleton-title {
  width: 60%;
  height: 20px;
}
.skeleton-text {
  width: 100%;
  height: 14px;
}
.skeleton-text.short {
  width: 80%;
}
.skeleton-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}
.skeleton-button {
  width: 120px;
  height: 40px;
  background: rgba(226, 232, 240, 0.6);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.skeleton-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
@media (min-width: 768px) {
  .skeleton-image {
    height: 250px;
  }
  .skeleton-button {
    width: 140px;
    height: 45px;
  }
}
.upload-area:focus,
button:focus,
.gallery-item:focus {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}
.upload-area:focus-visible,
button:focus-visible,
.gallery-item:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #3b82f6;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 6px;
}
.keyboard-shortcut {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 8px;
}
.postion_replace {
    position: relative;
    display: inline-block; 
}
#selectedImage {
    width: 100%; 
    height: auto; 
    position: relative; 
}
.replace {
    position: absolute;
    top: 10px;
    cursor: pointer;
    right: 10px;
    z-index: 10; 
    border-radius: 50%;
    padding: 5px; 
}
@media (prefers-contrast: high) {
  .gallery-item:focus,
  .upload-area:focus,
  button:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px #000000;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-item:focus,
  .upload-area:focus,
  button:focus {
    transform: none;
    transition: none;
  }
}
.selected-image-section {
  position: relative;
}
@media (min-width: 769px) {
  .maindownload_sticky {
    display: none !important;
  }
  .downloade_sticky {
    display: none !important;
  }
}
@media (max-width: 768px) {
  #downloadBtn {
    display: none !important;
  }
  #shareBtn {
    display: none !important;
  }
  .maindownload_sticky {
    justify-content: center !important;
    align-items: center !important;
  }
  .downloade_sticky {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
}
.loading-heading-process {
  text-align: left;
  padding-bottom: 13px;
}
@media (max-width: 768px) {
  .loading-heading-process {
    text-align: center;
  }
  .loading-spinner {
    padding: 50px 40px;
  }
    .content-right {
    overflow: auto;
    overflow-x: hidden;
  }
  .main-selected-image-container {
    padding: 0;
    border: none;
  }
  .generateImageBtnOnMobile {
    max-width: 250px;
  }
}
.generateAnother{
    max-width: 250px !important;
    font-size: 15px;
}
@media (max-width: 375px){
    .btn{
        max-width: 100px;
        height: 30px;
        font-size: 12px;
    }
}
.generateImageBtnOnMobile{
    max-width: 170px !important;
    height: 40px !important;
}


/* Animated border for generateImageBtnOnMobile */
.generateImageBtnOnMobile {
  position: relative;
  overflow: hidden;
}

.generateImageBtnOnMobile span:nth-child(1) {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to right, #171618, #3b82f6);
  animation: animate1 2s linear infinite;
}

@keyframes animate1 {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.generateImageBtnOnMobile span:nth-child(2) {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to bottom, #171618, #3b82f6);
  animation: animate2 2s linear infinite;
  animation-delay: 1s;
}

@keyframes animate2 {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

.generateImageBtnOnMobile span:nth-child(3) {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(to left, #171618, #ffffff);
  animation: animate3 2s linear infinite;
}

@keyframes animate3 {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.generateImageBtnOnMobile span:nth-child(4) {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(to top, #171618, #ffffff);
  animation: animate4 2s linear infinite;
  animation-delay: 1s;
}

@keyframes animate4 {
  0% {
    transform: translateY(100%);
  }
  100% {
    transform: translateY(-100%);
  }
}

