body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}

header {
  background-color: seagreen;
  color: white;
  padding: 20px;
  text-align: center;
}
header h1 {
  margin: 0;
  font-size: 2.5em;
}

a {
  color: seagreen;
}
a:visited, a:hover {
  color: lightseagreen;
}

.relative {
  position: relative;
}

button, .upload-btn {
  background-color: seagreen;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  border-color: lightseagreen;
  border-width: 1px;
  cursor: pointer;
}

button:hover, .upload-btn:hover {
  background-color: lightseagreen;
}

.panel-title a {
  width: 100%;
  cursor: pointer;
  display: block;
}

nav {
  display: flex;
  justify-content: center;
  background-color: #444;
  padding: 10px;
}
nav a {
  color: white;
  text-decoration: none;
  margin: 0 15px;
}
nav a:hover {
  text-decoration: underline;
}

section {
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.profile {
  display: flex;
  align-items: center;
}
.profile img {
  border-radius: 50%;
  margin-right: 20px;
  width: 150px;
}
.profile h2 {
  margin: 0;
}

.skills ul {
  list-style-type: none;
  padding: 0;
}
.skills ul li {
  background-color: seagreen;
  color: white;
  padding: 10px;
  margin: 5px 0;
  border-radius: 5px;
}

.projects {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.project-card {
  background-color: seagreen;
  color: white;
  padding: 20px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.project-card h3 {
  margin-top: 0;
}
.project-card a {
  background: #fff;
  color: #333;
  padding: 2px;
}
.project-card a.project-link {
  padding: 8px 4px;
  word-break: break-all;
  border-radius: 4px;
}

footer {
  text-align: center;
  padding: 10px;
  background-color: seagreen;
  color: white;
}
footer a {
  color: white;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .projects {
    flex-direction: column;
  }
  .project-card {
    width: 100%;
  }
}



#spinner {
  display: none;
  width: 50px;
  height: 50px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

#apiKeyInputContainer {
  margin-bottom: 20px;
}

/* Mic button styling */
#micButton {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#micButton.active {
  background-color: #ff4c4c;
  color: white;
}

#micButton.active:hover {
  background-color: #ff3333;
}

/* Chat container styling */
#chatContainer {
  overflow-y: auto;
  min-height: 500px;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
}

.chat-message {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 5px;
  white-space: pre-wrap;
}

.user-message {
  background-color: #e6f7ff;
  text-align: right;
  margin-left: 20%;
}

.ai-message {
  background-color: #f0f0f0;
  margin-right: 20%;
}

.chat-message img {
  max-width: 100%;
  height: auto;
  margin-top: 10px;
  border-radius: 5px;
}

.prompt-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 0 4px;
  gap: 4px;
  margin-bottom: 10px;
}

.prompt-container > div {
  display: flex;
  flex: auto;
}

.prompt-container .send-container {
  flex: none;
}

.prompt-container input {
  display: flex;
}

#promptInput {
  width: 100%;
}

#recordingIndicator {
  display: none;
  color: #ff4c4c;
  margin-left: 10px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.3; }
  100% { opacity: 1; }
}

.controls-container {
  display: flex;
  align-items: center;
  margin-top: 15px;
}

/* Language selector styling */
.language-selector {
  margin: 15px 0;
  display: flex;
  align-items: center;
}

#languageSelect {
  padding: 8px;
  margin-left: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Image upload styling */
.image-upload {
  padding: 4px;
}

#imageUpload {
  display: none; /* Hide the default file input */
}

[hidden] {
  display: none !important;
}

[disabled] {
  background-color: #ccc !important;
  opacity: 0.5 !important;
  cursor: not-allowed;
}

.upload-btn {
  display: inline-block;
  margin-right: 10px;
}

#clearImagesBtn {
  padding: 8px 16px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: none; /* Hidden by default, shown when images are selected */
}

#clearImagesBtn:hover {
  background-color: #c0392b;
}

#imagePreviewContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.image-preview {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 5px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .controls-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  #micButton {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  .image-preview {
    width: 80px;
    height: 80px;
  }
}

/* Modes toggle */
.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.img-upload {
  flex: 1;
  min-width: 250px;
}

.img-gen {
  flex: 1;
  min-width: 280px;
}

.img-gen > div {
  display: inline-block;
  width: 280px;
}


body {
  font-family: Arial, sans-serif;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f5f5f5;
}

h1 {
  color: #333;
  text-align: center;
}

/* API Key Section */
#apiKeyInputContainer {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#apiKeyInput {
  width: 300px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Chat Container */
#chatContainer {
  flex: auto;
  overflow-y: auto;
  margin-bottom: 10px;
  padding: 15px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#infoContainer {
  margin-bottom: 10px;
  line-height: 10px;
  font-size: 10px;
  min-height: 10px;
}

.chat-message {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 5px;
  max-width: 80%;
}

.user-message {
  background-image:
          linear-gradient(45deg, #e3f2fd 25%, transparent 25%),
          linear-gradient(-45deg, #e3f2fd 25%, transparent 25%),
          linear-gradient(45deg, transparent 75%, #e3f2fd 75%),
          linear-gradient(-45deg, transparent 75%, #e3f2fd 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  margin-left: auto;
}

.ai-message {
  background-color: #f1f1f1;
}

.chat-message img {
  max-width: 100%;
  margin-top: 10px;
  border-radius: 5px;
}

/* Controls */
.control-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#promptInput {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
}

button {
  padding: 10px 15px;
  text-align: center;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 5px;
}

button:hover {
  background-color: #45a049;
}

select {
  padding: 8px;
  margin-right: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Mic Button */
#micButton {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #f44336;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s;
}

#micButton.active {
  background-color: #d32f2f;
}

#recordingIndicator {
  color: #d32f2f;
  margin-left: 10px;
  font-weight: bold;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.5; }
}

#imagePreviewContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.image-preview {
  position: relative;
  width: 100px;
  height: 100px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}


/* Footer pinned to the bottom of the viewport, kept slim */
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 4px 10px;
  line-height: 1.3;
  font-size: 0.85em;
}
footer p {
  margin: 0;
}
footer a {
  text-decoration: underline;
}
body {
  padding-bottom: 40px;
}
