/* Base page styling */
body {
  font-family: "Arial", sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
  background-color: #f5f5f5;
}

/* Navigation styles */
.nav-bar {
  background-color: white;
  padding: 1rem;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

.nav-logo {
  font-size: 20px;
  font-weight: bold;
  color: #b41270;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.nav-link {
  color: #666;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background-color: #f5f5f5;
}

.nav-link.active {
  color: #b41270;
  font-weight: bold;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.theme-toggle i {
  font-size: 20px;
  color: #666;
}

/* Icon States */
.sun-icon {
  display: none !important;
}

.moon-icon {
  display: inline-block;
}

/* Container and layout styles */
.container {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Two-column layout */
.layout-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
  min-height: 500px;
}

.left-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.right-column {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* About page specific styles */
.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.about-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
}

.about-section h2 {
  color: #b41270;
  margin-top: 0;
  margin-bottom: 20px;
}

.about-section p {
  color: #444;
  line-height: 1.6;
  margin-bottom: 15px;
}

.tech-stack {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tech-item {
  background: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  color: #666;
  border: 1px solid #ddd;
}

.contact-links {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.contact-link {
  color: #b41270;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-link:hover {
  text-decoration: underline;
}

.about-section ul {
  list-style-type: disc;
  margin-left: 20px;
  padding-left: 15px;
}

.about-section li {
  margin-bottom: 8px;
  line-height: 1.1;
  color: #444;
}

/* Generate page specific styles */
.layout-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
  min-height: 500px;
}

.left-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.right-column {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Main prompt section */
.main-prompt {
  margin: 20px 0;
}

.main-prompt label {
  font-weight: bold;
}

.main-prompt textarea {
  width: 100%;
  font-family: "Arial", sans-serif;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  min-height: 40px;
  resize: vertical;
  margin-top: 10px;
  padding: 10px;
  box-sizing: border-box;
}

/* Example prompts section */
.example-prompts {
  margin: 10px 0 20px 0;
  display: flex;
  gap: 10px;
}

.example-prompt-btn {
  background-color: #f8f9fa;
  color: #000000;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.example-prompt-btn:hover {
  background-color: #808080;
}

/* API Key link styling */
.api-key-link {
  font-size: 12px;
  margin-left: 10px;
  color: #444;
  text-decoration: none;
  font-weight: normal;
}

.api-key-link:hover {
  text-decoration: underline;
}

/* Input groups styling */
.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #444;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  height: 40px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  box-sizing: border-box;
  line-height: 20px;
  font-size: 14px;
  font-family: "Arial", sans-serif;
}

.input-group textarea {
  height: auto;
  min-height: 40px;
  resize: vertical;
}

/* Advanced options section */
.advanced-options {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 30px 0;
}

.advanced-options summary {
  cursor: pointer;
  color: #666;
  font-weight: bold;
  margin-bottom: 15px;
}

.advanced-options summary:hover {
  color: #666;
}

/* Result section styling */
#result {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  width: 100%;
}

.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 5px;
  max-height: calc(100% - 60px);
  overflow: auto;
}

#loading {
  display: none;
  margin: 20px 0;
  text-align: center;
  color: #b41270;
  font-weight: bold;
}

#error {
  color: #dc3545;
  margin-top: 10px;
  display: none;
  padding: 10px;
  border-radius: 6px;
  background-color: #fff3f3;
}

/* Generated image styling */
.generated-image {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 4px #0000001a;
  height: auto;
  object-fit: contain;
}

/* Generated image Modal styles */
.modal {
  display: none; /* Keep only this display property */
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center; /* Keep flex properties but remove display: flex */
  justify-content: center;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh; /* Reduced from 90vh to add space at bottom */
  object-fit: contain;
  /* Add these properties */
  margin-bottom: 30px; /* Adds space at bottom */
  padding: 0 20px; /* Adds horizontal padding */
}

.close-modal {
  position: absolute;
  right: 35px;
  top: 15px;
  color: #f1f1f1;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #bbb;
}

.download-modal {
  position: absolute;
  right: 60px;
  top: 19px;
  color: #f1f1f1;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.download-modal:hover {
  color: #bbb;
}

.generated-image,
.model-result img {
  cursor: pointer;
  transition: opacity 0.3s;
}

.generated-image:hover,
.model-result img:hover {
  opacity: 0.8;
}

/* Button styling */
.action-button {
  font-size: 14px;
  padding: 15px 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: white;
  width: 100%;
}

.generate-btn {
  background-color: #b41270;
}

.generate-btn:hover {
  background-color: #8f0f59;
}

.download-btn {
  background-color: #ca4113;
}

.download-btn:hover {
  background-color: #a33410;
}

.regenerate-btn {
  background-color: #28a745;
}

.regenerate-btn:hover {
  background-color: #218838;
}

/* Image controls styling */
.image-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding-top: 5px;
}

/* Page title styling */
h1 {
  color: #333;
  text-align: center;
  margin-bottom: 15px;
}

.disclaimer {
  text-align: center;
  padding: 20px 0 10px 0;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #eee;
  margin-top: 30px;
}

.disclaimer a {
  color: #b41270;
  text-decoration: none;
}

.disclaimer a:hover {
  text-decoration: underline;
}

/* Comparator Styles */
/* Base Layout and Typography */
.page-title {
  color: #333;
  text-align: center;
  margin-bottom: 40px;
  font-size: 32px;
}

/* Navigation link styles */
.nav-link {
  color: #666;
  /* Grey for inactive links */
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-link.active {
  color: #b41270;
  /* Pink for active link */
  font-weight: bold;
}

/* Input section layout */
.input-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px;
  width: 100%;
  margin: 0 auto 40px;
  max-width: calc(100% - 60px);
  /* Account for parent container padding */
}

.container {
  max-width: 1140px;
  /* Controls the maximum width of the page content */
  margin: 0 auto;
  padding: 30px;
}

.input-section {
  margin: 30px 0;
}

.input-row {
  display: flex;
  gap: 20px;
  width: 100%;
}

/* Left column with inputs */
.inputs-column {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Input Elements */
.prompt-container,
.api-container {
  width: 100%;
}

.prompt-container textarea {
  width: 100%;
  font-family: "Arial", sans-serif;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  min-height: 40px;
  resize: vertical;
  padding: 10px;
  box-sizing: border-box;
}

.input-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #444;
}

.input-field {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  box-sizing: border-box;
}

.api-key-link {
  display: inline-block;
  font-size: 12px;
  color: #444;
  text-decoration: none;
  margin-left: 8px;
  white-space: nowrap;
}

/* Generate Button Column */
.generate-container {
  flex: 1;
  /* Take up less space than inputs column */
  margin-left: 30px;
  /* Space between columns */
  display: flex;
  align-items: stretch;
}

.generate-all-btn {
  width: 100%;
  padding: 20px;
  background-color: #b41270;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  margin-top: 24px;
  /* Align with inputs, accounting for their labels */
}

.generate-all-btn:hover {
  background-color: #8f0f59;
}

/* Model Results Grid Layout */
.models-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.model-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  min-height: 300px;
}

.model-card h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

/* Model Result Display */
.model-result {
  min-height: 300px;
  color: #b41270;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 10px;
}

.model-result img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
}

.generation-time {
  font-size: 14px;
  color: #666;
  text-align: center;
  padding: 5px;
  /* background: white; */
  border-radius: 4px;
  margin-top: 10px;
}

/* ===== AUTH Styles ===== */

/* Auth specific styles */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  background: var(--background-secondary);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: var(--primary-color);
  font-weight: bold;
  border-bottom: 2px solid var(--primary-color);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form .input-group {
  margin-bottom: 0;
}

/* Updated button styles for pink background */
.auth-btn {
  background-color: #b41270; /* Pink background */
  color: white;
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.auth-btn:hover {
  background-color: #8f0f59; /* Darker pink on hover */
}

/* Input group styles */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-weight: bold;
  color: #444;
}

.input-group input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.input-group input:focus {
  outline: none;
  border-color: #383838;
  /* box-shadow: 0 0 0 2px #444; */
}

.history-container {
  margin-top: 20px;
  padding: 20px;
  background: var(--background-secondary);
  border-radius: 12px;
}

.history-item {
  position: relative;
  overflow: hidden;
}

.history-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.history-item:hover img {
  transform: scale(1.05);
}

.prompt-text {
  margin: 10px 0;
  color: #666;
  font-size: 14px;
}

.date-text {
  color: #999;
  font-size: 12px;
}

/* ===== WELCOME ACCOUNT Styles ===== */

/* login page styles */
.account-section {
  background: var(--background-secondary);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
}

.account-section h1 {
  color: #333;
  margin-bottom: 20px;
}

.account-section h2 {
  color: #444;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

/* Account page styles */

.welcome-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.welcome-section h1 {
  margin-bottom: 0px;
}

.welcome-section button {
  background-color: #b41270;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.welcome-section button:hover {
  background-color: #8f0f59;
}

.welcome-actions {
  display: flex;
  gap: 10px;
}

.api-key-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.api-key-input {
  display: flex;
  gap: 10px;
  flex: 1;
}

.api-key-input input {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.api-key-input input:focus {
  outline: none;
  border-color: #ddd;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.toggle-visibility-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0 10px;
}

.save-btn {
  background-color: #b41270;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.save-btn:hover {
  background-color: #8f0f59;
}

.save-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.save-btn:not(:disabled):hover {
  background-color: #8f0f59;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(300px, 1fr)
  ); /* Creates flexible columns with minimum width */
  gap: 20px;
  margin-top: 20px;
}

.history-item {
  aspect-ratio: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.history-item img {
  width: 100%;
  height: 100%; /* Same as width to make it square */
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.history-item img:hover {
  transform: scale(1.05);
}

.history-item-details {
  padding: 15px;
}

#imageModal {
  z-index: 1000;
}

.prompt-text {
  color: #333;
  font-size: 14px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-text {
  color: #666;
  font-size: 13px;
  margin-bottom: 4px;
}

.date-text {
  color: #666;
  font-size: 12px;
}

.no-history {
  text-align: center;
  color: #666;
  padding: 40px;
}

.auth-btn {
  background-color: #b41270;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.auth-btn:hover {
  background-color: #8f0f59;
}

/* ===== LANDING PAGE ===== */
/* Hero section */
.hero {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.hero-content {
  max-width: 1200px;
  text-align: center;
  padding: 2rem;
}

.hero h1 {
  font-size: 3rem;
  color: #333;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero p {
  /* font-size: 1.25rem; */
  color: #666;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  background-color: #b41270;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  transition: background-color 0.3s;
}

.cta-button:hover {
  background-color: #8f0f59;
}

/* Examples section */
.examples {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.examples h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: #333;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.example-card {
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  line-height: 0; /* Remove space below image */
  font-size: 0; /* Remove space below image */
}

.example-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block; /* Remove space below image */
}

/* Features section */
.features {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.features h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: #333;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  padding: 2rem;
  border-radius: 12px;
  background: #f8f9fa;
  text-align: center;
}

.feature-card h3 {
  color: #333;
  margin-bottom: 1rem;
}

.feature-card p {
  color: #666;
}


/* Dark mode styles */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #2d2d2d 0%, #383838 100%);
}

[data-theme="dark"] .hero h1,
[data-theme="dark"] .examples h2,
[data-theme="dark"] .feature-card h3 {
  color: #ffffff;
}

[data-theme="dark"] .hero p,
[data-theme="dark"] .feature-card p {
  color: #b3b3b3;
}

[data-theme="dark"] .features {
  background: #2d2d2d;
}

[data-theme="dark"] .feature-card {
  background: #383838;
}

[data-theme="dark"] .examples {
  background: #383838;
}

[data-theme="dark"] .example-card {
  background: #2d2d2d;
}

/* Responsive design */
@media (max-width: 768px) {
  .hero h1 {
      font-size: 2.5rem;
  }

  .hero p {
      font-size: 1.1rem;
  }

  .features-grid,
  .examples-grid {
      grid-template-columns: 1fr;
  }
}

/* ===== DARK MODE STYLES ===== */

/* Whole web Background Colors */
[data-theme="dark"] {
  background-color: #2d2d2d;
}

[data-theme="dark"] body {
  background-color: #2d2d2d;
}

[data-theme="dark"] .container {
  background-color: #2d2d2d;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .right-column,
[data-theme="dark"] .input-container,
[data-theme="dark"] .about-section {
  background-color: #383838;
}

/* Dark Mode Icon States */
[data-theme="dark"] .sun-icon {
  display: inline-block !important;
  color: #fff !important;
}

[data-theme="dark"] .moon-icon {
  display: none !important;
}

/* Footer */
[data-theme="dark"] .disclaimer {
  color: #b3b3b3;
  border-top-color: #4d4d4d;
}

[data-theme="dark"] .api-key-link {
  color: #b3b3b3;
}

/* Navigation Bar */
[data-theme="dark"] .nav-bar {
  background-color: #2d2d2d;
  border-bottom: 1px solid #4d4d4d;
}

[data-theme="dark"] .nav-container,
[data-theme="dark"] .nav-link,
[data-theme="dark"] .about-section p,
[data-theme="dark"] .advanced-options summary {
  color: #ffffff;
}

[data-theme="dark"] .nav-link:hover {
  background-color: #383838;
}

[data-theme="dark"] .nav-link.active {
  color: #ff4aa7;
  font-weight: bold;
}

[data-theme="dark"] .nav-logo {
  color: #ff4aa7;
}

/* Text & Headings */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] label,
[data-theme="dark"] .input-group label,
[data-theme="dark"] p,
[data-theme="dark"] .about-section li {
  color: #ffffff;
}

[data-theme="dark"] .about-section a:hover,
[data-theme="dark"] .about-section a:visited,
[data-theme="dark"] .about-section a,
[data-theme="dark"] .about-section h2 {
  color: #ff4aa7;
}

/* Generate tab Input Elements */
[data-theme="dark"] .input-group input,
[data-theme="dark"] .input-group select,
[data-theme="dark"] .input-group textarea,
[data-theme="dark"] .prompt-container textarea,
[data-theme="dark"] #prompt {
  background-color: #2d2d2d;
  border-color: #4d4d4d;
  color: #ffffff;
}

[data-theme="dark"] #prompt::placeholder,
[data-theme="dark"] .input-group input::placeholder,
[data-theme="dark"] .input-group textarea::placeholder {
  color: #666666;
}

/* Buttons & Interactive Elements */
[data-theme="dark"] .example-prompt-btn {
  background-color: #383838;
  color: #ffffff;
  border-color: #4d4d4d;
}

[data-theme="dark"] .example-prompt-btn:hover {
  background-color: #4d4d4d;
}

/* Advanced Options */
[data-theme="dark"] .advanced-options {
  background-color: #383838;
}

/* Status Messages */
[data-theme="dark"] #loading {
  color: #ff4aa7;
}

[data-theme="dark"] #error {
  background-color: #3d0f0f;
}

/* Compare tab dark mode */

/* Model Results Grid */
[data-theme="dark"] .model-card {
  background-color: #383838;
}

[data-theme="dark"] .model-result {
  background-color: #2d2d2d;
}

[data-theme="dark"] .generation-time {
  color: #b3b3b3;
}

/* Generate buttons */
[data-theme="dark"] .generate-all-btn,
[data-theme="dark"] .generate-btn,
[data-theme="dark"] .regenerate-btn {
  background-color: #ff4aa7;
}

[data-theme="dark"] .generate-all-btn:hover,
[data-theme="dark"] .generate-btn:hover,
[data-theme="dark"] .regenerate-btn:hover {
  background-color: #ff4aa7;
}

/* Compare API Key Input */
[data-theme="dark"] #apiKey {
  background-color: #2d2d2d;
  border-color: #4d4d4d;
  color: #ffffff;
}

[data-theme="dark"] .model-card h3 {
  color: #ffffff;
}

/* Account page dark theme updates */
[data-theme="dark"] .welcome-section button,
[data-theme="dark"] .save-btn {
  background-color: #ff4aa7;
}

[data-theme="dark"] .welcome-section button:hover,
[data-theme="dark"] .save-btn:hover {
  background-color: #ff6cb7;
}

[data-theme="dark"] .history-item {
  background-color: #383838;
}

[data-theme="dark"] .history-item-details .prompt-text,
[data-theme="dark"] .history-item-details .model-text,
[data-theme="dark"] .history-item-details .date-text {
  color: #ffffff;
}

[data-theme="dark"] .api-key-input input {
  background-color: #2d2d2d;
  border-color: #4d4d4d;
  color: #ffffff;
}

/* Login page dark theme updates */
[data-theme="dark"] .auth-btn {
  background-color: #ff4aa7;
}

[data-theme="dark"] .auth-btn:hover {
  background-color: #ff6cb7;
}

[data-theme="dark"] .input-group input:focus {
  border-color: #4d4d4d;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tab-btn {
  color: #ffffff;
}

[data-theme="dark"] .tab-btn.active {
  color: #ff4aa7;
  border-bottom-color: #ff4aa7;
}

[data-theme="dark"] .tabs {
  border-bottom-color: #4d4d4d;
}

/* ===== MOBILE ===== */
@media screen and (max-width: 768px) {
  /* Base Layout */
  body {
    padding: 15px;
  }

  .container {
    padding: 15px;
    min-height: auto;
  }

  .landing-container {
    min-height: auto;
    gap: 15px;
    padding-bottom: 0;
  }

  /* Navigation */
  .nav-container {
    flex-direction: column;
    gap: 6px;
    padding: 5px;
    text-align: center;
    height: 155px;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 5px; /* Reduced from 8px for tighter spacing */
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 2px 2px; /* Reduced from 8px for tighter spacing */
    box-sizing: border-box;
  }

  /* Header Elements */
  .moon-icon {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 20px;
    height: 20px;
  }

  .sun-icon {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 20px;
    height: 20px;
  }

  .page-title {
    margin: 10px 0;
  }

  h1 {
    margin-bottom: 10px;
  }

  /* Layout & Components */
  .layout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .input-row {
    flex-direction: column;
    gap: 15px;
  }

  .generate-container {
    margin-left: 0;
  }

  .models-grid {
    grid-template-columns: 1fr;
  }

  /* Images & Buttons */
  .generated-image {
    max-width: 100%;
    height: auto;
  }

  .image-controls {
    flex-direction: column;
    gap: 10px;
  }

  .action-button {
    width: 100%;
    padding: 12px 20px;
    min-height: 44px; /* Apple's touch target size */
  }

  /* Form Elements */
  .input-group input,
  .input-group select,
  .input-group textarea {
    font-size: 16px; /* Prevents iOS zoom */
  }

  /* About Page */
  .about-content {
    padding: 10px;
  }

  .about-section {
    padding: 20px;
  }

  .tech-stack {
    gap: 10px;
  }
}

/* Account page mobile adjustments */
.welcome-section {
  flex-direction: column;
  gap: 15px;
  text-align: center;
  padding: 15px;
  margin: 0;
  width: auto;
}

.welcome-section h1 {
  font-size: 22px;
  margin: 0;
  width: 100%;
}

.api-key-container {
  padding: 15px;
  margin: 0;
  width: auto;
  box-sizing: border-box;
}

.api-key-input {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: auto;
}

.api-key-input input {
  flex: 1;
  min-width: 0; /* This prevents input from overflowing */
  height: 40px;
  padding: 0 12px;
}

.save-btn {
  height: 40px;
  min-width: 80px; /* Reduced minimum width */
  white-space: nowrap;
  padding: 0 15px; /* Reduced padding */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Prevents button from shrinking */
}

.history-item-details {
  padding: 12px;
}

.account-section {
  padding: 15px;
  margin: 0 0 15px 0;
  width: auto; /* Change from 100% to auto */
  box-sizing: border-box;
}

.account-section h2 {
  font-size: 20px;
}

/* Adjust modal buttons position */

.modal {
  padding: 0;
}

.modal-content {
  max-width: 95%;
  max-height: 80vh;
  margin: 60px auto 20px auto; /* Added top margin to avoid overlapping with buttons */
}

.close-modal {
  right: 20px;
  top: 15px;
  font-size: 35px;
}

.download-modal {
  right: 49px;
  top: 18px;
  font-size: 25px;
}

/* Extra Small Screens */
@media screen and (max-width: 480px) {
  .page-title {
    font-size: 24px;
  }

  .container {
    padding: 10px;
  }

  .input-container {
    padding: 15px;
  }
}

/* iOS Specific */
@supports (-webkit-touch-callout: none) {
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
  .welcome-section h1 {
    font-size: 20px;
  }

  .account-section {
    padding: 15px;
  }

  .history-item img {
    height: 160px;
  }

  .modal-content {
    max-width: 100%;
    margin: 50px auto 15px auto;
  }

  .close-modal {
    right: 15px;
    top: 10px;
    font-size: 30px;
  }

  .download-modal {
    right: 55px;
    top: 10px;
    font-size: 22px;
  }
}

.history-grid,
#generationHistory {
  display: none !important;
}

/* Style Transfer Page Styles */
.upload-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.upload-box {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
}

.upload-box .input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.file-input {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  background-color: var(--primary-bg);
  border: 1px solid var(--border-color);
}

.image-preview {
  max-width: 100%;
  max-height: 300px;
  margin-top: 10px;
  display: none;
  border-radius: 4px;
  object-fit: contain;
}

.slider-group {
  margin-bottom: 20px;
}

.slider-input {
  width: 100%;
  margin: 10px 0 5px;
  accent-color: var(--accent-color);
}

.slider-value {
  color: var(--text-color);
  font-size: 0.9em;
}

.loading-message {
  text-align: center;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-radius: 8px;
  margin-bottom: 20px;
}

.error-message {
  color: var(--error-color);
  text-align: center;
  margin-bottom: 20px;
}

.result-container {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.result-preview {
  max-width: 100%;
  max-height: 500px;
  border-radius: 4px;
  display: none;
  object-fit: contain;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.result-preview:hover {
  transform: scale(1.02);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border-color);
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fix for line-clamp compatibility */
.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: var(--line-clamp, 2);
  line-clamp: var(--line-clamp, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.api-key-link {
  font-size: 12px;
  margin-left: 10px;
  color: #444;
  text-decoration: none;
  font-weight: normal;
}

.api-key-link:hover {
  text-decoration: underline;
}

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

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #444;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  height: 40px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
  box-sizing: border-box;
  line-height: 20px;
  font-size: 14px;
  font-family: "Arial", sans-serif;
}

.input-group input[type="range"] {
  height: 6px;
  padding: 0;
  margin: 10px 0;
  background-color: var(--border-color);
}

.input-group input[type="file"] {
  height: auto;
  padding: 8px;
  background-color: var(--primary-bg);
  border: 1px dashed var(--border-color);
}

.advanced-options {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 12px 0;
}

.advanced-options summary {
  cursor: pointer;
  color: #666;
  font-weight: bold;
  margin-bottom: 15px;
}

.advanced-options summary:hover {
  color: #444;
}

.advanced-options .input-group:last-child {
  margin-bottom: 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.image-preview {
  width: 100%;
  max-height: 300px;
  margin-top: 10px;
  display: none;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid var(--border-color);
}

.result-preview {
  max-width: 100%;
  max-height: 500px;
  border-radius: 6px;
  display: none;
  object-fit: contain;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.result-preview:hover {
  transform: scale(1.02);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-message {
  text-align: center;
  padding: 20px;
  color: #666;
}

.error-message {
  color: #dc3545;
  text-align: center;
  margin: 10px 0;
}

.generate-btn {
  width: 100%;
  margin-top: 20px;
}

.download-btn {
  width: 100%;
}

/* Style Transfer Dark Mode Styles */
[data-theme="dark"] .input-group label {
  color: var(--text-color);
}

[data-theme="dark"] .input-group input,
[data-theme="dark"] .input-group select,
[data-theme="dark"] .input-group textarea {
  background-color: var(--secondary-bg);
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .input-group input[type="file"] {
  background-color: var(--secondary-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .advanced-options {
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .advanced-options summary {
  color: var(--text-color);
}

[data-theme="dark"] .advanced-options summary:hover {
  color: var(--accent-color);
}

[data-theme="dark"] .result-content {
  background-color: var(--secondary-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .loading-message {
  color: var(--text-color);
}

[data-theme="dark"] .spinner {
  border-color: var(--border-color);
  border-top-color: var(--accent-color);
}

[data-theme="dark"] .api-key-link {
  color: var(--text-color);
}

[data-theme="dark"] .image-preview {
  border-color: var(--border-color);
}

/* Mobile Optimization for Style Transfer */
@media (max-width: 768px) {
  .layout-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .image-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .input-group input,
  .input-group select,
  .input-group textarea {
    font-size: 16px; /* Prevents zoom on mobile */
  }

  .advanced-options {
    margin: 20px 0;
    padding: 15px;
  }

  .result-content {
    min-height: 200px;
    padding: 15px;
  }

  .result-preview {
    max-height: 300px;
  }

  .generate-btn,
  .download-btn {
    padding: 12px;
    font-size: 16px;
  }

  /* Image Modal Mobile Styles */
  .modal-content {
    width: 95%;
    max-height: 80vh;
  }

  .close-modal,
  .download-modal {
    font-size: 24px;
    padding: 10px;
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  .input-group label {
    font-size: 14px;
  }

  .advanced-options summary {
    font-size: 14px;
  }

  .loading-message {
    font-size: 14px;
    padding: 15px;
  }

  .spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }
}

.image-controls {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
}

.regenerate-btn {
  background-color: #28a745;
}

.regenerate-btn:hover {
  background-color: #218838;
}
