/* Full-page soft gradient background */
.page-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #e0f2ff 0%, #f0f8ff 100%);
  z-index: -1;
}

/* Center the card */
.card-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* White card */
.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 700px;
  padding: 24px;
  font-family: 'Poppins', sans-serif;
}

/* Header: logo+title on left, user-bar on right */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* Logo + title */
.logo-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-title .logo {
  height: 48px;
}
.logo-title h1 {
  margin: 0;
  font-size: 24px;
  color: #0077cc;
}

/* User bar */
.user-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}
.user-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.logout-btn {
  padding: 6px 14px;
  background: #ff4d4f;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.logout-btn:hover {
  background: #d9363e;
}

/* Login / Signup form */
.auth-segment {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-segment input {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccddee;
  border-radius: 8px;
}
.auth-segment .button-group {
  display: flex;
  justify-content: center;
  gap: 16px;
}
.auth-segment button {
  padding: 10px 20px;
  font-size: 16px;
  background: #0077cc;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.auth-segment button:hover {
  background: #005fa3;
}

/* Upload section (label) */
.upload-section {
  display: block;
  border: 2px dashed #0077cc;
  border-radius: 12px;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 18px; /* Add this or increase if needed */
}
.upload-section:hover {
  background: #e6f4ff;
}

/* Preview */
.image-preview img {
  max-width: 100%;
  margin-top: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Textareas */
textarea {
  resize: vertical;
  min-height: 40px;
  max-height: 200px;
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  box-sizing: border-box; /* ✅ This fixes overflow */
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
}

/* Input fields */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="file"] {
  width: 100%;
  margin: 10px 0;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box; /* 🔧 Prevent overflow */
}

/* Sliders */
.slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}
.slider-control {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-control label {
  width: 100px;
  font-size: 14px;
}
.slider-control input[type="range"] {
  flex: 1;
}
.slider-control span {
  width: 30px;
  text-align: right;
  font-size: 14px;
}

/* Bottom buttons */
.button-group {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}
.button-group button {
  padding: 10px 22px;
  font-size: 16px;
  background: #0077cc;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.button-group button:hover {
  background: #005fa3;
}

/* Loader spinner */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #0077cc;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 20px auto;
  animation: spin 1s linear infinite;
}
.loader.hidden {
  display: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result */
#result img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 16px;
}

/* Google Login Button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 16px;
  background: #ffffff;
  color: #333;
  border: 1px solid #ccddee;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  margin-top: 12px;
  width: 100%;
}
.google-btn img {
  height: 20px;
}
.google-btn:hover {
  background: #f7f7f7;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mobile tweaks */
@media (max-width: 600px) {
  .card {
    padding: 16px;
    border-radius: 12px;
    width: 95%;
  }
  .card-header {
    flex-direction: column;
    gap: 12px;
  }
  .logo-title .logo {
    height: 40px;
  }
  .logo-title h1 {
    font-size: 20px;
  }
  .user-bar {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .user-bar span {
    font-size: 14px;
  }
  .logout-btn {
    padding: 6px 12px;
    font-size: 14px;
  }
  .auth-segment {
    gap: 8px;
    margin-bottom: 16px;
  }
  .auth-segment input {
    padding: 8px;
    font-size: 14px;
  }
  .auth-segment .button-group {
    flex-direction: column;
  }
  .auth-segment button {
    width: 100%;
  }
  .upload-section {
    padding: 16px;
  }
  .button-group {
    flex-direction: column;
  }
  .button-group button {
    width: 100%;
  }
  .selector-row {
    flex-direction: column;
    gap: 10px;
  }
  .selector-row select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

.suggestion-controls button {
  padding: 12px 20px;
  font-size: 15px;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 114, 255, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  font-weight: 600;
}

.suggestion-controls button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 114, 255, 0.6);
  background: linear-gradient(135deg, #0099ff, #005eff);
}

.suggestion-controls {
  text-align: center;
  margin-top: 20px;
}

.suggestion-list {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

/* Form control */
.form-control {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Added spacing between label and textarea */
}

.form-control label {
  font-weight: 600; /* Increased font weight for better emphasis */
  margin-bottom: 6px;
  font-size: 14px; /* Added font size for consistency */
  color: #333; /* Added color for better readability */
}

.form-control textarea {
  resize: vertical;
  min-height: 48px;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #ccddee; /* Updated border color for a softer look */
  border-radius: 8px;
  box-sizing: border-box;
  width: 100%;
  background: #f9f9f9; /* Added light background for better contrast */
  transition: border-color 0.2s ease, box-shadow 0.2s ease; /* Added transition for focus effect */
}

.form-control textarea:focus {
  border-color: #0077cc; /* Highlight border on focus */
  box-shadow: 0 0 4px rgba(0, 119, 204, 0.3); /* Added subtle shadow on focus */
  outline: none; /* Removed default outline */
}

/* Prompt card base styles */
.prompt-card {
  background: #ffffff;
  padding: 6px 10px; /* Reduced padding */
  margin: 6px auto;
  border-radius: 6px;
  border: 1px solid #ddeaff;
  box-shadow: 0 1px 4px rgba(0, 119, 204, 0.08);
  max-width: 95%;
}

/* Title styling */
.prompt-title {
  display: block;
  color: #0051a8;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Description styling */
.prompt-desc {
  display: block; /* Force new line */
  font-size: 13px;
  color: #444;
  line-height: 1.4;
  cursor: default;
  padding: 2px 0;
}

/* Remove hover effects */
.prompt-desc:hover {
  text-decoration: underline;
  color: #0077cc;
}

/* Suggestion list prompt card styles */
.suggestion-list .prompt-card {
  padding: 8px 12px !important; /* Increased padding for more space */
  margin: 8px auto !important; /* Adjusted margin for better spacing */
  border-radius: 6px !important;
  border: 1px solid #ddeaff !important;
  box-shadow: 0 1px 4px rgba(0, 119, 204, 0.08) !important;
  max-width: 95% !important;
  font-size: 13px !important;
  background: #fff !important;
}
.suggestion-list .prompt-card .prompt-title {
  font-size: 13px;
  font-weight: 600;
  color: #0051a8;
  margin-bottom: 4px; /* Slightly increased margin for better spacing */
  background: none;
  padding: 0;
  border-radius: 0;
}
.suggestion-list .prompt-card .prompt-desc {
  font-size: 13px;
  color: #444;
  line-height: 1.6; /* Increased line height for better readability */
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Style the selector row for prompt suggestions */
.selector-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.selector-row select {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #0077cc;
  border-radius: 8px;
  background: #f9fbff url('data:image/svg+xml;utf8,<svg fill="%230077cc" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 12px center;
  background-size: 20px;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.selector-row select:focus {
  border-color: #005fa3;
  box-shadow: 0 0 4px rgba(0, 119, 204, 0.18);
  outline: none;
}


/* Crop button */
.crop-button {
  padding: 12px 20px;
  font-size: 16px;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 114, 255, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 20px;
}



/* Button history tab */
.button-link {
  display: inline-block;
  padding: 10px 22px;
  font-size: 16px;
  background: #0077cc;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.button-link:hover {
  background: #005fa3;
}



/* HISTORY HTML SECTION */

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.image-grid img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.image-grid img:hover {
  transform: scale(1.05);
}

/* Image card styles */
.image-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddeaff;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.image-card img {
  width: 100%;
  max-width: 200px;
  border-radius: 8px;
  object-fit: cover;
}
.image-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.image-card p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

/* Modal Preview Styles */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  max-width: 90%;
  max-height: 90%;
  position: relative;
}
.modal-content img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
}
.modal-content button {
  margin-top: 16px;
}
.close-btn {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 28px;
  font-weight: bold;
  color: #ffffff;
  background: none;
  border: none;
  cursor: pointer;
}

/* Modal fade + scale animation */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.modal-content {
  animation: modalFadeIn 0.3s ease forwards;
  transform-origin: center;
  opacity: 0;
}

/* Animate closing (optional via JS toggle) */
.modal.closing .modal-content {
  animation: modalFadeOut 0.25s ease forwards;
}



/* PLAN PAGE */
/* Pricing Plan Cards */
.plans-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}

.plan-card {
  background: #ffffff;
  border: 1px solid #ddeaff;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 119, 204, 0.08);
  padding: 24px;
  width: 260px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.plan-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 119, 204, 0.18);
}

.plan-title {
  font-size: 20px;
  font-weight: 600;
  color: #0077cc;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 26px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}

.plan-desc {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.buy-btn {
  padding: 12px 20px;
  font-size: 15px;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 114, 255, 0.3);
  transition: background 0.3s ease;
}

.buy-btn:hover {
  background: linear-gradient(135deg, #0099ff, #005eff);
}

@media (max-width: 768px) {
  .plans-container {
    flex-direction: column;
    align-items: center;
  }
}

/* User Icon Dropdown Styles */
.user-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.token-header {
  font-size: 14px;
  margin-right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-buy-btn {
  padding: 5px 12px;
  background: linear-gradient(90deg, #00a2ff, #0068d9);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 98, 176, 0.4);
  transition: background 0.3s;
}
.header-buy-btn:hover {
  background: linear-gradient(90deg, #0096ed, #005abb);
}

.user-icon {
  background: #0077cc;
  color: #fff;
  font-weight: bold;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.3s, box-shadow 0.3s;
  outline: none;
  border: none;
}
.user-icon:focus,
.user-icon:hover {
  background: #005fa3;
  box-shadow: 0 4px 16px rgba(0, 119, 204, 0.15);
}

.dropdown-content {
  display: none;
}

.user-dropdown.show .dropdown-content {
  display: block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  background: #fff;
  border: 1px solid #ddeaff;
  border-radius: 10px;
  min-width: 200px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  z-index: 999;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  animation: dropdownFadeIn 0.2s;
}

.user-dropdown.show .dropdown-content {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-10px);}
  to { opacity: 1; transform: translateY(0);}
}

.dropdown-content div,
.dropdown-content a {
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: none;
}

.dropdown-content div:hover,
.dropdown-content a:hover,
.dropdown-content div:focus,
.dropdown-content a:focus {
  background-color: #f0f8ff;
  outline: none;
}

/* .user-dropdown:hover .dropdown-content,
.user-dropdown:focus-within .dropdown-content {
  display: block;
} */

/* Responsive: stack dropdown to left on small screens */
@media (max-width: 600px) {
  .dropdown-content {
    right: auto;
    left: 0;
    min-width: 160px;
    font-size: 15px;
  }
  .user-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}


