* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #36393f;
  color: #dcddde;
  padding: 20px;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #2f3136;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header h1 {
  color: #fff;
  margin-bottom: 10px;
}

.header p {
  color: #b9bbbe;
}

.main-content {
  display: flex;
  gap: 20px;
  flex: 1;
  margin-bottom: 20px;
}

.character-selection {
  flex: 1;
  background-color: #2f3136;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.character-selection h2 {
  margin-bottom: 15px;
  color: #fff;
  text-align: center;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.character-card {
  background-color: #40444b;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.character-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.character-card.selected {
  border: 2px solid #7289da;
  background-color: #4f545c;
}

.character-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
}

.character-card h3 {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.conversation-container {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.discord-chat {
  flex: 1;
  background-color: #2f3136;
  border-radius: 8px;
  padding: 15px;
  overflow-y: auto;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.message {
  display: flex;
  margin-bottom: 15px;
  align-items: flex-start;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 15px;
  object-fit: cover;
}

.message-content {
  flex: 1;
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.message-username {
  font-weight: bold;
  color: #fff;
  margin-right: 8px;
}

.message-timestamp {
  font-size: 0.7rem;
  color: #72767d;
}

.message-text {
  color: #dcddde;
  line-height: 1.3;
}

.message-image {
  max-width: 300px;
  max-height: 300px;
  border-radius: 8px;
  margin-top: 10px;
  display: block;
}

.message-input-container {
  display: flex;
  background-color: #40444b;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.message-input-wrapper {
  display: flex;
  flex: 1;
  align-items: center;
}

.character-selector {
  min-width: 120px;
  margin-right: 10px;
  padding: 8px;
  background-color: #2f3136;
  border: none;
  color: #fff;
  border-radius: 4px;
}

.message-input {
  flex: 1;
  padding: 10px 15px;
  border: none;
  background-color: #40444b;
  color: #dcddde;
  border-radius: 4px;
  outline: none;
}

.message-input:focus {
  outline: 1px solid #7289da;
}

.send-button {
  background-color: #7289da;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: bold;
  margin-left: 10px;
  transition: background-color 0.2s;
}

.send-button:hover {
  background-color: #5e77d4;
}

.script-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.script-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.save-button {
  background-color: #43b581;
  color: white;
}

.save-button:hover {
  background-color: #3ca374;
}

.clear-button {
  background-color: #f04747;
  color: white;
}

.clear-button:hover {
  background-color: #d84040;
}

.saved-scripts {
  background-color: #2f3136;
  border-radius: 8px;
  padding: 15px;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 300px;
  z-index: 10;
}

.saved-scripts h2 {
  margin-bottom: 15px;
  color: #fff;
  text-align: center;
}

.script-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.script-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #40444b;
  padding: 10px 15px;
  border-radius: 4px;
}

.script-item-title {
  font-weight: bold;
  color: #fff;
}

.script-item-actions {
  display: flex;
  gap: 8px;
}

.script-item-actions button {
  background-color: transparent;
  border: none;
  color: #b9bbbe;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}

.script-item-actions button:hover {
  color: #fff;
}

.load-button:hover {
  color: #7289da;
}

.delete-button:hover {
  color: #f04747;
}

.save-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.save-modal-content {
  background-color: #36393f;
  padding: 20px;
  border-radius: 8px;
  width: 400px;
  max-width: 90%;
}

.save-modal h2 {
  margin-bottom: 15px;
  color: #fff;
}

.save-modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background-color: #40444b;
  border: none;
  color: #dcddde;
  border-radius: 4px;
}

.save-modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.save-modal-buttons button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.save-confirm {
  background-color: #43b581;
  color: white;
}

.save-cancel {
  background-color: #747f8d;
  color: white;
}

.mention {
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 500;
}

.ai-button {
  background-color: #7289da;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 15px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
}

.ai-button:hover {
  background-color: #5e77d4;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background-color: #36393f;
  padding: 20px;
  border-radius: 8px;
  width: 500px;
  max-width: 90%;
}

.modal-content h2 {
  margin-bottom: 15px;
  color: #fff;
}

.modal-content p {
  margin-bottom: 10px;
  color: #b9bbbe;
}

.modal-content textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background-color: #40444b;
  border: none;
  color: #dcddde;
  border-radius: 4px;
  resize: vertical;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-buttons button {
  padding: 8px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.generate-button {
  background-color: #7289da;
  color: white;
}

.generate-button:hover:not(:disabled) {
  background-color: #5e77d4;
}

.generate-button:disabled {
  background-color: #5e77d4;
  opacity: 0.6;
  cursor: not-allowed;
}

.cancel-button {
  background-color: #747f8d;
  color: white;
}

.cancel-button:hover {
  background-color: #5e6673;
}

.rules-section {
  background-color: #2f3136;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.rules-section h2 {
  margin-bottom: 15px;
  color: #fff;
  text-align: center;
}

.rules-list {
  list-style-position: inside;
  margin-left: 10px;
}

.rules-list li {
  margin-bottom: 8px;
  color: #dcddde;
}

.beluga-link {
  display: inline-block;
  color: #7289da;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}

.beluga-link:hover {
  color: #5e77d4;
  text-decoration: underline;
}

.playing-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #2f3136;
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.typing-indicator {
  display: flex;
  align-items: center;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  background-color: #b9bbbe;
  border-radius: 50%;
  margin: 0 2px;
  display: inline-block;
  animation: typing 1.5s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.3s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.changelog {
  background-color: #2f3136;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.changelog h2 {
  margin-bottom: 15px;
  color: #fff;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.changelog h2 .update-badge {
  background-color: #7289da;
  color: white;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  margin-left: 10px;
}

.changelog-list {
  list-style: disc;
  margin-left: 20px;
}

.changelog-list li {
  margin-bottom: 8px;
  color: #dcddde;
}

.new-feature {
  color: #43b581;
  font-weight: bold;
}

.image-upload {
  display: flex;
  align-items: center;
  background-color: #40444b;
  border-radius: 4px;
  padding: 8px;
  margin-right: 10px;
  cursor: pointer;
}

.image-upload:hover {
  background-color: #4f545c;
}

.image-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  margin: 10px 0;
  display: block;
}

.mode-selector {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.mode-button {
  background-color: #4f545c;
  border: none;
  color: #ffffff;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mode-button.active {
  background-color: #7289da;
}

.mode-button:hover:not(.active) {
  background-color: #5d6269;
}

.ai-button:disabled, .save-button:disabled, .clear-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.character-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.custom-char-button {
  background-color: #7289da;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.2s;
}

.custom-char-button:hover {
  background-color: #5e77d4;
}

.sound-toggle {
  display: flex;
  align-items: center;
}

.sound-toggle-label {
  display: flex;
  align-items: center;
  color: #b9bbbe;
  font-size: 0.9rem;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background-color: #40444b;
  border-radius: 11px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.toggle-switch.on {
  background-color: #43b581;
}

.toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch.on .toggle-slider {
  transform: translateX(18px);
}

.custom-character {
  position: relative;
  border: 2px dashed #7289da;
}

.delete-custom-char {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: #f04747;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.custom-character:hover .delete-custom-char {
  opacity: 1;
}

.custom-char-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  color: #b9bbbe;
  font-size: 0.9rem;
}

.form-group input[type="text"] {
  padding: 10px;
  background-color: #40444b;
  border: none;
  border-radius: 4px;
  color: #dcddde;
}

.color-picker {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.file-input {
  background-color: #40444b;
  color: #dcddde;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}

.custom-image-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 10px;
}

.create-button {
  background-color: #43b581;
  color: white;
}

.create-button:hover:not(:disabled) {
  background-color: #3ca374;
}

.previous-feature {
  color: #b9bbbe;
  font-weight: bold;
}

.image-preview-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.chili-indicator {
  background-color: #f04747;
  color: white;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

.chili-mode-checkbox {
  display: flex;
  align-items: center;
  margin: 15px 0;
}

.chili-mode-checkbox input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
}

.chili-mode-checkbox label {
  color: #dcddde;
  cursor: pointer;
}

.pride-indicator {
  background: linear-gradient(to right, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #86007D);
  color: white;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

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

.theme-button {
  background-color: #4f545c;
  border: none;
  color: #ffffff;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.theme-button.active {
  outline: 2px solid #ffffff;
}

.theme-button:hover:not(.active) {
  background-color: #5d6269;
}

.theme-color-preview {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: inline-block;
}

.theme-default .theme-color-preview {
  background-color: #36393f;
}

.theme-black .theme-color-preview {
  background-color: #000000;
}

.theme-white .theme-color-preview {
  background-color: #ffffff;
  border: 1px solid #cccccc;
}

.theme-blue .theme-color-preview {
  background-color: #1a237e;
}

.theme-red .theme-color-preview {
  background-color: #b71c1c;
}

.theme-pink .theme-color-preview {
  background-color: #880e4f;
}

.theme-pride .theme-color-preview {
  background: linear-gradient(to right, #FF0018, #FFA52C, #FFFF41, #008018, #0000F9, #86007D);
}

/* Theme specific styles */
body.theme-default {
  background-color: #36393f;
  color: #dcddde;
}

body.theme-black {
  background-color: #000000;
  color: #ffffff;
}

body.theme-white {
  background-color: #ffffff;
  color: #000000;
}

body.theme-blue {
  background-color: #1a237e;
  color: #ffffff;
}

body.theme-red {
  background-color: #b71c1c;
  color: #ffffff;
}

body.theme-pink {
  background-color: #880e4f;
  color: #ffffff;
}

body.theme-pride {
  background: linear-gradient(135deg, #FF0018 0%, #FFA52C 20%, #FFFF41 40%, #008018 60%, #0000F9 80%, #86007D 100%);
  color: #ffffff;
}

/* Adjustments for specific themes */
body.theme-white .header,
body.theme-white .character-selection,
body.theme-white .discord-chat,
body.theme-white .saved-scripts,
body.theme-white .message-input-container,
body.theme-white .rules-section,
body.theme-white .changelog {
  background-color: #f5f5f5;
  color: #000000;
}

body.theme-white .message-username {
  color: #000000;
}

body.theme-white .character-card {
  background-color: #e0e0e0;
}

.eos-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #f04747;
  color: white;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.eos-content {
  padding: 15px;
  text-align: center;
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.eos-badge {
  background-color: white;
  color: #f04747;
  font-size: 0.9rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: bold;
  margin-left: 10px;
}

.eos-feature {
  color: #f04747;
  font-weight: bold;
}

.eos-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  height: 30px;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.eos-close-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}