* {
  font-family: "Inter", sans-serif;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
:root {
  --color-primary: #5c56e1;
  --color-primary-dark: #5b21b6;
  --color-accent: #8b5cf6;
  --color-card: #ffffff;
  --color-input: #f1f1ff;
  --color-text: #09090e;
  --color-placeholder: #5c5a87;
  --color-border: #d4d4ed;
  --color-gradient: #5b21b6;
}

body.dark-theme {
  --color-card: #1e293b;
  --color-input: #141b2d;
  --color-text: #f3f4f6;
  --color-placeholder: #a3b6dc;
  --color-border: #334155;

  background: var(--color-card);
  background-image: radial-gradient(
      circle at 15% 50%,
      rgba(99, 102, 241, 0.15) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 30%,
      rgba(139, 92, 246, 0.15) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 50% 80%,
      rgba(99, 102, 241, 0.1) 0%,
      transparent 40%
    );
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: var(--color-text);
  padding: 15px;
  background: linear-gradient(#f0f0f0, #d9d9d9);
}

body.dark-theme .container {
  border: 1px solid var(--color-border);
}

body.dark-theme .theme-toggle {
  color: #ffffffb4;
}

.container {
  width: 900px;
  background: var(--color-card);
  border-radius: 23px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 32px;
  overflow: hidden;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--color-gradient);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .logo-wrapper {
  display: flex;
  gap: 18px;
  align-items: center;
}

.header .logo-wrapper .logo {
  width: 56px;
  height: 55px;
  border-radius: 50%;
  font-size: 1.35rem;
  background: var(--color-gradient);
  border-radius: 15px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header .logo-wrapper h1 {
  font-size: 1.9rem;
  font-weight: 700;
}

.header .theme-toggle {
  width: 43px;
  height: 43px;
  display: flex;
  cursor: pointer;
  border-radius: 50%;
  font-size: 1.05rem;
  align-items: center;
  justify-content: center;
  background-color: var(--color-input);
  border: 1px solid var(--color-border);
}

.header .theme-toggle:hover {
  background-color: var(--color-primary);
  transform: scaleY(-2px);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.main-content {
  margin: 35px 0 5px;
}

.main-content .prompt-container {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.prompt-container .prompt-input {
  line-height: 1.6;
  font-size: 1.05rem;
  min-height: 120px;
  padding: 16px 20px;
  width: 100%;
  gap: 20px;
  border-radius: 15px;
  color: var(--color-text);
  background: var(--color-input);
  border: 1px solid var(--color-border);
  resize: vertical;
  transition: all 0.3s ease;
}

.prompt-container .prompt-input::placeholder {
  color: var(--color-placeholder);
}

.prompt-container .prompt-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.2);
}

.prompt-container .prompt-btn {
  position: absolute;
  right: 15px;
  bottom: 15px;
  width: 35px;
  height: 35px;
  background-color: var(--color-primary-dark);
  color: #fff;
  font-size: 0.75rem;
  border: none;
  border-radius: 50%;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.prompt-container .prompt-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.main-content .prompt-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.1fr 1fr;
  gap: 14px;
}

.main-content .gallery-grid:has(.img-card) {
  margin-top: 30px;
}

.prompt-actions .select-wrapper::after {
  content: \f078;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  position: absolute;
  font-size: 0.9rem;
  font-weight: 900;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.prompt-actions :where(.custom-select, .generate-btn) {
  cursor: pointer;
  padding: 12px 20px;
  font-size: 1rem;
  border-radius: 10px;
  background-color: var(--color-input);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.prompt-actions .custom-select {
  width: 100%;
  outline: none;
  height: 100%;
  appearance: none;
  color: var(--color-text);
}

.prompt-actions .custom-select:is(:focus, :hover) {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.prompt-actions .generate-btn {
  background-color: var(--color-gradient);
  margin-left: auto;
  color: #fff;
  border: none;
  padding: 12px 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  gap: 12px;
}

.prompt-actions .generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(109, 40, 217, 0.3);
}

/* ended the main skelet section */

/* let's create result image gallery section */

.main-content .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.gallery-grid .img-card {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 16px;
  background-color: var(--color-input);
  border: 1px solid var(--color-border);
  transition: all 0.5s ease;
}

.gallery-grid .img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.gallery-grid .img-card .img-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  display: flex;
  justify-content: flex-end;
}

.gallery-grid .img-card .img-download-btn {
  height: 45px;
  width: 45px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.gallery-grid .img-card:not(.loading, .error):hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.gallery-grid .img-card:is(.loading, .error) :is(.result-img, .img-overlay) {
  display: none;
}

.gallery-grid .img-card:hover .img-download-btn {
  opacity: 1;
  pointer-events: auto;
}

.gallery-grid .img-card .img-download-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.4);
}

.gallery-grid .img-card .status-container {
  padding: 15px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}

.gallery-grid .img-card:where(.loading, .error) .status-container {
  display: flex;
}

.gallery-grid .img-card.loading .status-container i,
.gallery-grid .img-card.error .spinner {
  display: none;
}

.gallery-grid .img-card.error .status-container i {
  font-size: 1.7rem;
  color: red;
}

.gallery-grid .img-card.loading .spinner {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.gallery-grid .img-card .status-text {
  color: var(--color-placeholder);
  font-size: 0.85rem;
  text-align: center;
}
