body { 
  font-family: 'Poppins', sans-serif; 
  margin: 0; 
  padding: 20px; 
  background-color: #121212; 
  color: #fff;
  animation: rainbow-bg 15s linear infinite;
}

@keyframes rainbow-bg {
  0% { background-color: rgba(18, 18, 18, 1); }
  20% { background-color: rgba(20, 18, 25, 1); }
  40% { background-color: rgba(18, 20, 26, 1); }
  60% { background-color: rgba(18, 22, 20, 1); }
  80% { background-color: rgba(20, 20, 18, 1); }
  100% { background-color: rgba(18, 18, 18, 1); }
}

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  position: relative;
  z-index: 1;
}

h1 { 
  text-align: center; 
  color: #fff; 
  position: relative;
  text-shadow: 0 0 10px rgba(255,0,0,0.5), 
               0 0 20px rgba(255,165,0,0.3), 
               0 0 30px rgba(255,255,0,0.2), 
               0 0 40px rgba(0,128,0,0.1);
  animation: rainbow-text 3s linear infinite;
}

@keyframes rainbow-text {
  0% { text-shadow: 0 0 10px rgba(255,0,0,0.5), 0 0 20px rgba(255,165,0,0.3); }
  20% { text-shadow: 0 0 10px rgba(255,165,0,0.5), 0 0 20px rgba(255,255,0,0.3); }
  40% { text-shadow: 0 0 10px rgba(255,255,0,0.5), 0 0 20px rgba(0,128,0,0.3); }
  60% { text-shadow: 0 0 10px rgba(0,0,255,0.5), 0 0 20px rgba(75,0,130,0.3); }
  80% { text-shadow: 0 0 10px rgba(75,0,130,0.5), 0 0 20px rgba(238,130,238,0.3); }
  100% { text-shadow: 0 0 10px rgba(255,0,0,0.5), 0 0 20px rgba(255,165,0,0.3); }
}

.controls, .gallery-controls { 
  display: flex; 
  gap: 10px; 
  margin-bottom: 20px; 
  flex-wrap: wrap; 
  justify-content: center; 
  position: relative;
}

input, textarea, select, button { 
  padding: 6px; 
  border: 1px solid rgba(255,255,255,0.1); 
  border-radius: 4px; 
  font-size: 14px; 
  background-color: rgba(0,0,0,0.5);
  color: white;
}

button { 
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 400% 400%;
  animation: rainbow-button 3s linear infinite;
  color: white; 
  cursor: pointer; 
  height: 30px; 
  line-height: 1; 
  border: none;
  position: relative;
  overflow: hidden;
}

@keyframes rainbow-button {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

button:hover { 
  opacity: 0.9;
  transform: scale(1.05);
  transition: all 0.3s;
}

.style-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
  gap: 5px; 
  margin-bottom: 20px;
  position: relative;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) rgba(0,0,0,0.2);
}

.style-grid::-webkit-scrollbar {
  width: 8px;
}

.style-grid::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}

.style-grid::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}

.style-option { 
  border: 2px solid rgba(255,255,255,0.1); 
  border-radius: 4px; 
  padding: 5px; 
  text-align: center; 
  cursor: pointer; 
  transition: all 0.3s; 
  font-size: 12px; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  background-color: rgba(0,0,0,0.4);
}

.style-option.active { 
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 400% 400%;
  animation: rainbow-button 3s linear infinite;
  color: white;
}

.style-option i { margin-right: 5px; }

#imageGallery { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
  gap: 10px; 
  position: relative;
}

.gallery-item { 
  position: relative; 
  border-radius: 4px; 
  overflow: hidden; 
  background: #000; 
  transition: all 0.3s; 
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
}

.gallery-item img { 
  width: 100%; 
  height: auto; 
  display: block; 
  transition: transform 0.3s; 
}

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

.gallery-item.shared {
  position: relative;
}

.shared-by {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  background-color: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  padding: 3px;
  font-size: 10px;
}

.shared-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 5px;
}

.share-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
}

.share-button:hover {
  background: rgba(255,255,255,0.2);
}

.gallery-item.selected,
.gallery-item:hover { 
  box-shadow: 0 0 15px rgba(255,0,0,0.5), 
              0 0 25px rgba(255,165,0,0.3), 
              0 0 35px rgba(255,255,0,0.2), 
              0 0 45px rgba(0,128,0,0.1);
  animation: rainbow-border 3s linear infinite;
}

@keyframes rainbow-border {
  0% { box-shadow: 0 0 15px rgba(255,0,0,0.5), 0 0 25px rgba(255,165,0,0.3); }
  20% { box-shadow: 0 0 15px rgba(255,165,0,0.5), 0 0 25px rgba(255,255,0,0.3); }
  40% { box-shadow: 0 0 15px rgba(255,255,0,0.5), 0 0 25px rgba(0,128,0,0.3); }
  60% { box-shadow: 0 0 15px rgba(0,0,255,0.5), 0 0 25px rgba(75,0,130,0.3); }
  80% { box-shadow: 0 0 15px rgba(75,0,130,0.5), 0 0 25px rgba(238,130,238,0.3); }
  100% { box-shadow: 0 0 15px rgba(255,0,0,0.5), 0 0 25px rgba(255,165,0,0.3); }
}

.style-label { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 3px; 
  font-size: 10px; 
  border-top: 1px solid rgba(255,255,255,0.1);
  background-color: rgba(0,0,0,0.7);
}

.checkbox-wrapper { 
  display: flex; 
  align-items: center; 
}

.style-checkbox { 
  appearance: none; 
  width: 10px; 
  height: 10px; 
  border: 2px solid; 
  border-radius: 3px; 
  margin-right: 5px; 
  position: relative; 
  cursor: pointer; 
  background-color: rgba(0,0,0,0.5);
}

.style-checkbox:checked::after { 
  content: '\2714'; 
  position: absolute; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%);
  color: #fff;
}

.size-options { 
  display: flex; 
  gap: 5px; 
  flex-wrap: wrap;
  justify-content: center;
}

.size-option { 
  padding: 3px 6px; 
  border: 1px solid rgba(255,255,255,0.1); 
  border-radius: 4px; 
  cursor: pointer; 
  font-size: 12px; 
  display: flex; 
  align-items: center;
  background-color: rgba(0,0,0,0.5);
}

.size-option i { 
  margin-right: 3px; 
}

.size-option.active { 
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 400% 400%;
  animation: rainbow-button 3s linear infinite;
  color: white;
}

#prompt { 
  resize: vertical; 
  min-height: 38px; 
  flex-grow: 1;
  background-color: rgba(0,0,0,0.5);
  color: white;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}

.image-modal { 
  display: none; 
  position: fixed; 
  z-index: 2; 
  left: 0; 
  top: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.95); 
}

.modal-image-container { 
  position: relative; 
  width: 80%; 
  height: 80%; 
  margin: auto; 
}

.modal-image { 
  max-width: 100%; 
  max-height: 100%; 
  object-fit: contain; 
  border: 3px solid transparent;
  animation: rainbow-border 3s linear infinite;
}

.modal-close { 
  position: absolute; 
  top: 15px; 
  right: 35px; 
  color: #f1f1f1; 
  font-size: 40px; 
  font-weight: bold; 
  cursor: pointer; 
  text-shadow: 0 0 10px rgba(255,0,0,0.5), 
               0 0 20px rgba(255,165,0,0.3);
  animation: rainbow-text 3s linear infinite;
}

.modal-nav { 
  position: absolute; 
  top: 50%; 
  transform: translateY(-50%); 
  font-size: 30px; 
  color: white; 
  cursor: pointer; 
  text-shadow: 0 0 10px rgba(255,0,0,0.5), 
               0 0 20px rgba(255,165,0,0.3);
  animation: rainbow-text 3s linear infinite;
}

.modal-prev { 
  left: 20px; 
}

.modal-next { 
  right: 20px; 
}

.modal-actions { 
  position: absolute; 
  bottom: 20px; 
  left: 50%; 
  transform: translateX(-50%); 
  display: flex; 
  gap: 10px; 
}

.modal-actions button { 
  padding: 8px 15px; 
  border: none; 
  border-radius: 4px; 
  color: white; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  gap: 5px;
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 400% 400%;
  animation: rainbow-button 3s linear infinite;
}

.modal-actions button i { 
  margin-right: 5px; 
}

.slider-container { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin-top: 10px;
  color: white;
}

.slider { 
  width: 150px;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 5px;  
  background: linear-gradient(to right, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%; 
  background: white;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(255,255,255,0.5);
}

.slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(255,255,255,0.5);
}

.shimmer-toggle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

#shimmerToggleButton {
  font-size: 14px;
  font-weight: bold;
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 400% 400%;
  animation: rainbow-button 3s linear infinite;
  color: white;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 20px;
  border: none;
  display: inline-block;
}

.shimmer-disabled #shimmerToggleButton {
  background: #3498db;
  animation: none;
}

.multiplayer-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

#multiplayerButton {
  padding: 8px 15px;
  background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
  background-size: 400% 400%;
  animation: rainbow-button 3s linear infinite;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s;
}

#multiplayerButton.active {
  background: #3498db;
  animation: none;
}

.shimmer-disabled #multiplayerButton {
  background: #3498db;
  animation: none;
}

.shimmer-disabled h1 {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: none;
}

.shimmer-disabled button,
.shimmer-disabled .style-option.active,
.shimmer-disabled .size-option.active,
.shimmer-disabled input:checked + .slider {
  background: #3498db;
  animation: none;
}

.shimmer-disabled .gallery-item.selected,
.shimmer-disabled .gallery-item:hover,
.shimmer-disabled .modal-image {
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: none;
}

.shimmer-disabled .modal-close,
.shimmer-disabled .modal-nav {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: none;
}

.shimmer-disabled .slider {
  background: linear-gradient(to right, #3498db, #2980b9);
}

.shimmer-disabled .container::before {
  animation: none;
  background: none;
}

/* Rainbow shimmer overlay */
.container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
                rgba(255,0,0,0.05), 
                rgba(255,165,0,0.05), 
                rgba(255,255,0,0.05), 
                rgba(0,128,0,0.05), 
                rgba(0,0,255,0.05), 
                rgba(75,0,130,0.05), 
                rgba(238,130,238,0.05));
  background-size: 400% 400%;
  animation: shimmer 5s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes shimmer {
  0% { background-position: 0% 100%; }
  50% { background-position: 100% 0%; }
  100% { background-position: 0% 100%; }
}

.online-users {
  background-color: rgba(0,0,0,0.3);
  border-radius: 8px;
  margin-bottom: 15px;
  padding: 10px;
  display: none;
}

.online-users h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  text-align: center;
}

.user-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 5px rgba(255,255,255,0.2);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, #ff0000, #ff7f00);
  color: white;
  font-weight: bold;
}

.generation-status {
  background-color: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 15px;
  border-radius: 4px;
  margin: 10px auto;
  text-align: center;
  width: 80%;
  max-width: 600px;
  transition: opacity 0.5s, background-color 0.3s;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 10px rgba(0,0,255,0.3);
  font-size: 14px;
  position: sticky;
  top: 10px;
  z-index: 10;
}

.status-processing {
  background: linear-gradient(45deg, #2980b9, #3498db);
  animation: pulse 1.5s infinite;
  border-color: #3498db;
}

.status-waiting {
  background: linear-gradient(45deg, #f39c12, #f1c40f);
  border-color: #f39c12;
}

.status-error {
  background: linear-gradient(45deg, #c0392b, #e74c3c);
  border-color: #e74c3c;
}

.status-info {
  background: linear-gradient(45deg, #2c3e50, #34495e);
  border-color: #2c3e50;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

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

.generation-status .fa-spinner {
  animation: spinner 1s linear infinite;
  margin-right: 5px;
}

.generation-status .fa-hourglass-half {
  animation: pulse 1.5s infinite;
  margin-right: 5px;
}

.generation-status .fa-exclamation-triangle {
  animation: pulse 1.5s infinite;
  margin-right: 5px;
  color: #ffcc00;
}

/* New styles for collapsible sections */
.collapsible-section {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header {
  padding: 10px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s;
}

.section-header:hover {
  background-color: rgba(0, 0, 0, 0.4);
}

.section-header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
}

.section-header h3 i {
  margin-right: 8px;
}

.toggle-icon {
  transition: transform 0.3s;
}

.section-content {
  padding: 15px;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.section-content.collapsed {
  max-height: 0;
  padding: 0 15px;
  overflow: hidden;
}

.main-controls {
  margin-bottom: 20px;
}

.prompt-section {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.generate-btn {
  background: linear-gradient(45deg, #27ae60, #2ecc71);
  margin-bottom: 10px;
  height: auto;
  padding: 10px;
  font-weight: bold;
  font-size: 16px;
}

.stop-btn {
  background-color: #e74c3c !important;
  animation: none !important;
  margin-bottom: 10px;
  height: auto;
  padding: 10px;
  font-weight: bold;
  font-size: 16px;
}

.style-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 15px;
}

.search-filter {
  display: flex;
  width: 100%;
  max-width: 300px;
  position: relative;
  margin: 10px auto;
}

#styleSearch {
  width: 100%;
  padding: 8px 30px 8px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
}

#clearSearch {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  height: 20px;
  width: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: none;
}

#clearSearch:hover {
  color: white;
}

.gallery-section {
  margin-top: 30px;
}

.feeling-lucky {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .style-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  #imageGallery {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .shimmer-toggle {
    position: relative;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .modal-image-container {
    width: 95%;
  }
}