/* Basic Reset */
* {
  margin: 0;
  padding: 0;
}
body {
  display: inline;
  font-family: 'Mouse Memoirs', sans-serif; /* Mouse Memoirs for headings */
  line-height: 1.6;
  color: #333;
  background-color: #f4f4f4;
}
h1, h2 {
  font-family: 'Mouse Memoirs', sans-serif; /* Mouse Memoirs for headings */
  text-align: center;
  font-size: 2em;
}
/* Header */
header {
  font-family: 'Mouse Memoirs', sans-serif; /* Mouse Memoirs for headings */
  color: #fff;
  padding: 0rem 0;
  text-align: center;
  background-image: url('/banner.png');
  background-size: cover;
  background-position: center center; /* Center the background image */
  display: flex; /* Use flexbox to center content */
  justify-content: center; /* Horizontally center the content */
  align-items: flex-start; /* Align content to the top */
  height: 350px; /* Example height, adjust as needed */
}
#logo {
  font-size: 4rem;
  font-weight: bold;
  line-height: 180px;
  color: orange;
}
/* Added for token improvements */
#token-display-header {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Token Badge */
.token-badge {
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1rem;
  min-width: 40px;
  text-align: center;
  display: inline-block;
  transition: transform 0.3s ease, background-color 0.3s ease;
}
/* Low token warning */
.low-tokens {
  background-color: #e74c3c; /* Red if low tokens */
}
/* Flash animation */
.flash {
  transform: scale(1.3);
}
/* Buy Tokens Button in Header */
#buy-tokens-button-header {
  background-color: #4CAF50;
  color: #fff;
  border: none;
  padding: 5px 10px;
  font-size: 0.9rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#buy-tokens-button-header:hover {
  background-color: #45a049;
}
/* Toast Messages */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #444;
  color: #fff;
  padding: 10px 15px;
  border-radius: 5px;
  opacity: 0.9;
  font-size: 14px;
  z-index: 9999;
}
/* Hamburger Menu Button */
#menu-toggle {
  display: none; /* Hidden by default, can be displayed on smaller screens */
}
/* Hero Section */
#hero {
  background-color: #fee440; /* Bright yellow */
  text-align: center;
  font-size: 1.2em;
}
#hero h1 {
  margin-bottom: 0.5rem;
}
#hero p {
  margin-bottom: 1rem;
}
#start-button {
  background-color: #00b4d8; /* Sky blue */
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
}
#start-button:hover {
  background-color: #0096c7; /* Darker blue */
}
/* How It Works Section */
#how-it-works {
  padding: 1rem;
  background-color: #ffafcc; /* Light pink */
}
#how-it-works h2 {
  text-align: center;
  margin-bottom: 1rem;
}
.steps {
  display: flex;
  justify-content: space-around;
  text-align: center;
}
.example-steps {
  display: flex;
  justify-content: space-evenly;
  text-align: center;
  flex-wrap: wrap;
  gap: 2rem;
}
.step {
  width: 300px; /* Adjust the width as needed */
  height: 200px; /* Adjust the height as needed */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover; /* Or 'contain' depending on your preference */
  text-align: center;
  line-height: 420px; /* This should be equal to the height to vertically center the text */
  margin: 4px; /* Adds some space between the steps */
  border: 2px solid #ccc; /* Optional border */
  border-radius: 10px; /* Optional rounded corners */
}
.example {
  width: 150px; /* Adjust the width as needed */
  height: 150px; /* Adjust the height as needed */
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover; /* Or 'contain' depending on your preference */
  text-align: center;
  line-height: 340px; /* This should be equal to the height to vertically center the text */
  margin: 2px;
  border: 4px solid #ccc; /* Optional border */
  border-radius: 10px; /* Optional rounded corners */
  font-size: 1.5em;
}
.example:hover {
  border: 4px solid blue; /* Change as needed */
}
.example.selected {
  border: 4px solid green; /* Change as needed */
}
#image-3d {
  background-image: url('/3d.png');
  filter: grayscale(80%); /* Grey out the image */
}
#image-comic {
  background-image: url('/paint.png');
  filter: grayscale(80%);
}
#image-sticker {
  background-image: url('/sticker.png');
  filter: grayscale(80%);
}
#image-pickle {
  background-image: url('/pickle.png');
  filter: grayscale(80%);
}
#image-cupcake {
  background-image: url('/cupcake.png');
  filter: grayscale(80%);
}
#image-sketch {
  background-image: url('/sketch.png');
  filter: grayscale(80%);
}
#upload-photo {
  background-image: url('/imgUpload.jpg');
}
#customize {
  background-image: url('/token.png');
}
#generate {
  background-image: url('/imgCustom.png');
}
#download {
  background-image: url('/imgDownload.png');
}
/* Image Generation Section */
#buy_tokens {
  padding: 2rem;
}
#authentication-section {
  padding: 0rem;
}
#image-settings {
  padding: 0rem;
}
#file-selection {
  display: none;
  padding: 1rem;
}
#image-upload-form {
  display: block;
  text-align: center;
  margin-bottom: 1rem;
}
.dropdown-container {
  font-family: 'Mouse Memoirs', sans-serif; /* Mouse Memoirs for headings */
  display: block;
  justify-content: center; /* Horizontally center the content */
  align-items: center; /* Vertically center the content */
  height: 100%; /* Set a height, or it defaults to the content's height */
  text-align: center;
}
#preview-area {
  display: flex;
  justify-content: space-around;
  padding: 20px;
}
/* Enhanced Progress Bar Styling */
#progress-bar-container {
  width: 90%;
  max-width: 600px;
  margin: 20px auto;
  background-color: rgba(238, 238, 238, 0.8);
  border-radius: 10px;
  padding: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

#progress-bar {
  height: 20px;
  background: linear-gradient(45deg, 
    #4CAF50 25%, 
    #45a049 25%, 
    #45a049 50%, 
    #4CAF50 50%, 
    #4CAF50 75%, 
    #45a049 75%, 
    #45a049);
  background-size: 20px 20px;
  border-radius: 6px;
  width: 0%;
  transition: width 0.4s ease, background-position 1s linear;
  animation: progressAnimation 1s linear infinite;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

/* Progress bar animation */
@keyframes progressAnimation {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}

/* Progress percentage label */
#progress-bar::after {
  content: attr(data-progress) '%';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

/* Mobile optimization for progress bar */
@media only screen and (max-width: 600px) {
  #progress-bar-container {
    width: 95%;
    margin: 15px auto;
  }
  
  #progress-bar {
    height: 16px;
  }
  
  #progress-bar::after {
    font-size: 10px;
  }
}
/* Gallery layout */
.gallery-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
/* Common styles for all photo containers */
.photo-container1,
.photo-container2,
.photo-container3,
.photo-container4,
.photo-container5 {
  display: none;
  font-family: 'Mouse Memoirs', sans-serif;
  width: 300px;
  text-align: center;
  margin: 10px;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
/* Show the first container by default */
.photo-container1 {
  display: block;
}
/* Image placeholder styling */
.image-placeholder {
  width: 100%;
  height: 300px;
  margin: 0 auto 15px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;
}
.image-placeholder img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* Description text styling */
.photo-container1 p,
.photo-container2 p,
.photo-container3 p,
.photo-container4 p,
.photo-container5 p {
  margin: 15px 0;
  font-size: 1.1em;
  color: #333;
  padding: 0 10px;
  min-height: 60px;
}
/* Button styling */
.photo-container1 button,
.photo-container2 button,
.photo-container3 button,
.photo-container4 button,
.photo-container5 button,
.image-placeholder button {
  display: block;
  width: 80%;
  margin: 10px auto;
  padding: 10px 15px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.photo-container1 button:hover,
.photo-container2 button:hover,
.photo-container3 button:hover,
.photo-container4 button:hover,
.photo-container5 button:hover,
.image-placeholder button:hover {
  background-color: #45a049;
}
.photo-container1 button:disabled,
.photo-container2 button:disabled,
.photo-container3 button:disabled,
.photo-container4 button:disabled,
.photo-container5 button:disabled,
.image-placeholder button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}
#gallery {
  display: block;
  font-family: 'Mouse Memoirs', sans-serif;
  background-color: #ff6347; /* Tomato red */
  color: #fff;
  padding: 0rem 0;
  text-align: center;
}
#gallery-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}
.image-placeholder {
  width: 300px;
  height: 300px;
  background-color: #e0e0e0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  font-family: 'Mouse Memoirs', sans-serif;
  color: #555;
  font-size: 20px;
  text-align: center;
  border: 2px dashed #999;
}
#image-generation .dropdown-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
#image-generation select {
  flex-basis: 45%;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin: 5px;
}
#image-generation label {
  flex-basis: 100%;
  margin-top: 10px;
}
/* Gallery Section */
#gallery h2 {
  text-align: center;
  margin-bottom: 1rem;
}
.gallery-images img {
  margin: 0.5rem;
  width: 150px;
  height: 150px;
  object-fit: cover;
}
/* Style for gallery image placeholders */
#gallery .image-placeholder {
  background-image: url('/img_icon.png');
  background-size: contain;
  background-position: center;
}
#uploaded-photo-placeholder {
  background-image: url('/img_icon.png');
  background-size: contain;
  background-position: center;
}
#generated-photo-placeholder {
  background-image: url('/img_icon.png');
  background-size: contain;
  background-position: center;
}
/* Authenticated Content Section */
#authenticated-content {
  background-color: #fff;
  border-radius: 10px;
  margin: 1rem auto;
  max-width: 800px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}
#authenticated-content h2 {
  color: #ff6347;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}
#authenticated-content p {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1.2rem;
}
#logout-button {
  background-color: #ff6347;
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: 'Mouse Memoirs', sans-serif;
}
#logout-button:hover {
  background-color: #ff4f2b;
}
/* Media Queries for Mobile Optimization */
@media only screen and (max-width: 360px) {
  h1, h2 {
    font-size: 1.5rem;
  }
  .step, #image-generation .dropdown-container, #gallery {
    flex-direction: column;
  }
  .step {
    width: 100%;
    margin: 5px 0;
  }
  #image-generation select {
    flex-basis: 100%;
  }
  button, input[type="file"] {
    padding: 10px;
    width: 100%;
  }
}
button:disabled {
  color: #757575;
  background-color: #e0e0e0;
  border: 1px solid #d3d3d3;
  cursor: not-allowed;
}
/* Footer */
footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 1rem 0;
}
/* Generate Button Styling */
#generate-image {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  font-size: 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#generate-image:hover {
  background-color: #45a049;
}
#generate-image:active {
  transform: scale(0.98);
}
#generate-image:disabled {
  color: #757575;
  background-color: #e0e0e0;
  border: 1px solid #d3d3d3;
  cursor: not-allowed;
}
/* image-upload Styling */
#image-upload {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  font-size: 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
#image-upload:hover {
  background-color: #45a049;
}
#image-upload:active {
  transform: scale(0.98);
}
#image-upload:disabled {
  color: #757575;
  background-color: #e0e0e0;
  border: 1px solid #d3d3d3;
  cursor: not-allowed;
}

/* Upload info styling */
.upload-info {
  color: #666;
  font-size: 0.9em;
  margin-top: -10px;
  margin-bottom: 10px;
}

/* File input styling */
#image-upload {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 10px;
  margin: 10px auto;
  display: block;
}

/* Mobile optimization for file input */
@media only screen and (max-width: 600px) {
  #image-upload {
    width: 90%;
    font-size: 14px;
  }
  
  /* Adjust the container as well */
  #file-selection {
    padding: 1rem;
  }
  
  /* Make sure the photo container is responsive */
  .photo-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Mobile optimization for upload section */
@media only screen and (max-width: 600px) {
  #file-selection {
    padding: 0.5rem;
  }
  
  #file-selection h2 {
    margin: 10px 0 5px 0;
  }
  
  #file-selection .upload-info {
    margin: 3px 0;
    font-size: 0.85em;
  }
  
  #file-selection br {
    display: none;
  }
  
  #image-upload {
    width: 90%;
    font-size: 14px;
    margin: 8px auto;
  }
  
  .photo-container {
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
  }
  
  #uploaded-photo-description {
    margin: 5px 0;
    font-size: 1.5em;
  }
  
  /* Adjust spacing for generate section on mobile */
  #gallery h2 {
    margin: 10px 0 5px 0;
  }
  
  #generate-image {
    margin: 8px 0;
  }
  
  #tokens2 {
    margin: 5px 0;
  }
}

/* GPT-4 Description Styling */
#result:empty {
  display: none;
}

#result:not(:empty) {
  display: block;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 15px 20px;
  margin: 15px auto;
  max-width: 90%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 1.1em;
  line-height: 1.5;
  color: #333;
  text-align: center;  /* Changed from left to center */
  border-left: 4px solid #4CAF50;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
}

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

/* Mobile optimization for description */
@media only screen and (max-width: 600px) {
  #result {
    font-size: 1em;
    padding: 12px 15px;
    margin: 12px auto;
    max-width: 95%;
  }
}

/* Mobile optimization for welcome section */
@media only screen and (max-width: 600px) {
  /* Welcome section adjustments */
  #welcome-section {
    padding: 0.8rem;
  }
  
  #welcome-section h1 {
    font-size: 2em;
    margin: 8px 0;
  }
  
  #welcome-section p {
    font-size: 1.1em;
    margin: 8px 0 12px 0;
  }
  
  /* Login buttons spacing */
  .firebaseui-container {
    margin: 0 !important;
  }
  
  .firebaseui-card-content {
    padding: 0 8px !important;
  }
  
  .firebaseui-idp-button {
    margin: 8px 0 !important;
  }
  
  /* Terms text */
  .firebaseui-tos {
    margin: 8px 0 !important;
    font-size: 0.8em !important;
  }
  
  /* Remove extra spacing */
  .firebaseui-card-header {
    padding: 8px 0 !important;
  }
  
  .firebaseui-subtitle {
    margin: 8px 0 !important;
  }
  
  .firebaseui-text {
    margin: 8px 0 !important;
  }
}

/* File input display styling */
#file-display-text {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.9em;
  color: #666;
  margin-left: 10px;
}

/* Mobile optimization for file display text */
@media only screen and (max-width: 600px) {
  #file-display-text {
    display: block;
    margin: 5px auto;
    text-align: center;
    font-size: 0.85em;
  }
}

/* Promotional badge styles */
.promo-badge {
  position: absolute;
  top: 60px;
  right: 20px;
  background: linear-gradient(45deg, #ff6b6b, #ff8e53);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  font-size: 0.9em;
  font-weight: bold;
  transform: rotate(5deg);
  z-index: 1000;
  animation: bounce 1s ease infinite;
}

.badge-text {
  display: inline-block;
  vertical-align: middle;
}

@keyframes bounce {
  0%, 100% {
    transform: rotate(5deg) translateY(0);
  }
  50% {
    transform: rotate(5deg) translateY(-5px);
  }
}

/* Mobile optimization for promo badge */
@media only screen and (max-width: 600px) {
  .promo-badge {
    top: auto;
    bottom: 20px;
    right: 10px;
    font-size: 0.8em;
    padding: 6px 12px;
  }
}

/* Email checkbox option styles */
.email-option {
  margin-bottom: 15px;
  font-size: 1rem;
  color: #333;
}

.email-option input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.2);
}

.email-option label {
  cursor: pointer;
}