/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #121212;
  color: white;
  transition: background-color 0.3s, color 0.3s;
  position: relative;
  overflow-x: hidden;
}

/* Light Theme */
body.light {
  background-color: #f5f5f5;
  color: #121212;
}

/* Highlight Letter */
.highlight-letter {
  color: #fcda68;
  font-weight: bold;
}

/* Light mode highlight letter */
body.light .highlight-letter {
  color: #e8a000;
  font-weight: bold;
}

/* Notification */
.notification {
  position: fixed;
  top: 80px;
  right: 20px;
  background-color: rgba(33, 33, 33, 0.9);
  border-left: 4px solid #fcda68;
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: translateX(200%);
  transition: transform 0.3s ease-in-out;
  max-width: 300px;
}

.notification.show {
  transform: translateX(0);
}

/* Particles Background */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: 
    radial-gradient(rgba(252, 218, 104, 0.15) 1px, transparent 1px),
    radial-gradient(rgba(252, 218, 104, 0.1) 1px, transparent 1px);
  background-size: 50px 50px, 100px 100px;
  background-position: 0 0, 25px 25px;
  animation: particles-float 180s linear infinite;
}

@keyframes particles-float {
  0% {
    background-position: 0 0, 25px 25px;
  }
  100% {
    background-position: 1000px 500px, 1025px 525px;
  }
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background-color: rgba(18, 18, 18, 0.95);
  border-bottom: 1px solid rgba(252, 218, 104, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}

.top-bar h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.version {
  font-size: 16px;
  opacity: 0.7;
  vertical-align: super;
  margin-left: 4px;
  color: #fcda68;
}

.controls {
  display: flex;
  gap: 12px;
}

.controls button {
  background: none;
  color: #fff;
  font-size: 18px;
  padding: 10px;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: rgba(252, 218, 104, 0.1);
}

.controls button:hover {
  transform: translateY(-2px);
  background-color: rgba(252, 218, 104, 0.2);
  color: #fcda68;
}

/* Memory counter badge */
.count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: rgba(252, 218, 104, 0.9);
  color: #121212;
  font-size: 10px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.controls button.active .count-badge {
  opacity: 1;
  transform: scale(1.1);
}

/* Light mode for the badge */
body.light .count-badge {
  background-color: #e8a000;
  color: white;
}

.controls button.active {
  background-color: rgba(252, 218, 104, 0.2);
  color: #fcda68;
}

/* Homepage */
.homepage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.homepage.hidden {
  display: none;
}

.welcome-card {
  background-color: rgba(24, 24, 24, 0.7);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 90%;
  border: 1px solid rgba(252, 218, 104, 0.1);
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.robot-icon {
  background-color: #fcda68;
  color: #121212;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-right: 15px;
}

.welcome-card h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #fff;
}

.welcome-description {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 800px;
  margin: 0 auto 40px;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.feature-box {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  transition: all 0.3s ease;
  border: 1px solid rgba(252, 218, 104, 0.05);
}

.feature-box:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(252, 218, 104, 0.3);
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 15px;
}

.brain {
  background-color: rgba(252, 176, 69, 0.15);
  color: #fcb045;
}

.vision {
  background-color: rgba(252, 218, 104, 0.15);
  color: #fcda68;
}

.voice {
  background-color: rgba(241, 150, 108, 0.15);
  color: #f1966c;
}

.visual {
  background-color: rgba(253, 200, 48, 0.15);
  color: #fdc830;
}

.feature-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
}

.feature-box p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.start-btn {
  margin-top: 10px;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  background-color: #fcda68;
  color: #121212;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(252, 218, 104, 0.2);
  display: inline-flex;
  align-items: center;
}

.start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(252, 218, 104, 0.3);
  background-color: #fde088;
}

.start-btn i {
  margin-left: 10px;
  transition: transform 0.3s ease;
}

.start-btn:hover i {
  transform: translateX(5px);
}

/* Main Chat */
.main-chat {
  flex: 1;
  display: flex;
  height: calc(100vh - 73px);
}

.main-chat.hidden {
  display: none;
}

/* History Sidebar */
.history-panel {
  width: 280px;
  background-color: rgba(24, 24, 24, 0.7);
  padding: 25px;
  overflow-y: auto;
  border-right: 1px solid rgba(252, 218, 104, 0.05);
}

.history-panel h3 {
  margin-bottom: 20px;
  font-size: 18px;
  color: #fcda68;
  display: flex;
  align-items: center;
}

.history-panel h3 i {
  margin-right: 10px;
}

.history-panel ul {
  list-style: none;
}

.history-panel li {
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-size: 14px;
  border: 1px solid rgba(252, 218, 104, 0.05);
  background-color: rgba(255, 255, 255, 0.03);
}

.history-panel li:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(252, 218, 104, 0.3);
}

.history-panel li.new-chat-btn {
  background-color: rgba(252, 218, 104, 0.1);
  border: 1px dashed rgba(252, 218, 104, 0.3);
  color: #fcda68;
  font-weight: 600;
  text-align: center;
}

.history-panel li.new-chat-btn:hover {
  background-color: rgba(252, 218, 104, 0.2);
}

/* Chat Content */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

.chat-container {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Add styling for API help */
.api-help {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.api-help a {
  color: #fcda68;
  text-decoration: none;
}

.api-help a:hover {
  text-decoration: underline;
}

/* Chat messages */
.user-chat-box, .ai-chat-box {
  display: flex;
  position: relative;
  margin-bottom: 5px;
  animation: fadeIn 0.3s ease;
}

.user-chat-box {
  justify-content: flex-end;
}

.ai-chat-box {
  justify-content: flex-start;
}

.user-chat-area, .ai-chat-area {
  max-width: 80%;
  padding: 15px 20px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.5;
  position: relative;
}

.user-chat-area {
  background-color: #534b8b;
  color: #fff;
  border-bottom-right-radius: 4px;
  text-align: right;
}

.ai-chat-area {
  background-color: #2d2a3d;
  color: #fff;
  border-bottom-left-radius: 4px;
  text-align: left;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timestamp {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  opacity: 0.7;
  text-align: right;
}

.user-chat-box .timestamp {
  padding-right: 10px;
}

.ai-chat-box .timestamp {
  padding-left: 10px;
}

/* Chat timestamp in light mode */
body.light .timestamp {
  color: rgba(18, 18, 18, 0.6);
}

/* Hide the images */
#userImage, #aiImage {
  display: none;
}

/* Input Area */
.prompt-area {
  display: flex;
  align-items: center;
  padding: 20px 30px;
  background-color: rgba(24, 24, 24, 0.7);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(252, 218, 104, 0.05);
}

.prompt-area input {
  flex: 1;
  padding: 16px 24px;
  font-size: 16px;
  border: none;
  border-radius: 30px;
  outline: none;
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  transition: all 0.3s ease;
}

.prompt-area input:focus {
  box-shadow: 0 0 0 2px rgba(252, 218, 104, 0.3);
  background-color: rgba(255, 255, 255, 0.08);
}

.prompt-area input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.prompt-area button {
  width: 50px;
  height: 50px;
  margin-left: 10px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prompt-area button:hover {
  background-color: #fcda68;
  color: #121212;
  transform: translateY(-3px);
}

.prompt-area button#submit {
  background-color: #fcda68;
  color: #121212;
}

.prompt-area button#submit:hover {
  background-color: #fde088;
}

.prompt-area button.listening {
  background-color: #ff4d4d;
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* Loading animation */
@keyframes pulse {
  0% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0.6; transform: scale(0.98); }
}

.ai-chat-area img[alt="loading"] {
  animation: pulse 1.5s infinite ease-in-out;
}

/* API Settings */
.api-settings {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.api-settings.show {
  display: flex;
}

.api-settings-content {
  background-color: #181818;
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  border: 1px solid rgba(252, 218, 104, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.api-settings h3 {
  color: #fcda68;
  margin-bottom: 20px;
  text-align: center;
}

.setting-group {
  margin-bottom: 20px;
}

.setting-group label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.setting-group input {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(252, 218, 104, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 16px;
}

.api-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.api-buttons button {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.api-buttons button#saveApiBtn {
  background-color: #fcda68;
  color: #121212;
  font-weight: 500;
}

.api-buttons button#cancelApiBtn {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.api-buttons button:hover {
  transform: translateY(-2px);
}

.api-confirmation {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fcda68;
  color: #121212;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 500;
  box-shadow: 0 5px 15px rgba(252, 218, 104, 0.3);
  z-index: 110;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* API settings in light mode */
body.light .api-settings-content {
  background-color: #ffffff;
  color: #121212;
  border: 1px solid rgba(252, 218, 104, 0.2);
}

body.light .api-settings h3 {
  color: #121212;
}

body.light .setting-group label {
  color: rgba(18, 18, 18, 0.8);
}

body.light .setting-group input {
  background-color: rgba(0, 0, 0, 0.05);
  color: #121212;
  border: 1px solid rgba(252, 218, 104, 0.2);
}

body.light .api-help {
  color: rgba(18, 18, 18, 0.6);
}

body.light .api-buttons button#cancelApiBtn {
  background-color: rgba(0, 0, 0, 0.1);
  color: #121212;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .main-chat {
    flex-direction: column;
  }
  
  .history-panel {
    width: 100%;
    height: auto;
    max-height: 150px;
    border-right: none;
    border-bottom: 1px solid rgba(252, 218, 104, 0.05);
  }
  
  .chat-container {
    padding: 15px;
  }
  
  .user-chat-area, .ai-chat-area {
    max-width: 85%;
  }
  
  .prompt-area {
    padding: 15px;
  }
  
  .prompt-area button {
    width: 45px;
    height: 45px;
  }
  
  .controls button {
    padding: 8px;
    width: 35px;
    height: 35px;
    margin-left: 10px;
  }
}

/* Light Theme Overrides */
body.light {
  background-color: #f5f5f5;
  color: #121212;
}

body.light .top-bar {
  background-color: rgba(245, 245, 245, 0.95);
  border-bottom: 1px solid rgba(252, 218, 104, 0.3);
}

body.light .top-bar h1 {
  color: #121212;
}

body.light .controls button {
  background-color: rgba(252, 218, 104, 0.15);
  color: #121212;
}

body.light .controls button.active,
body.light .controls button:hover {
  background-color: rgba(252, 218, 104, 0.3);
  color: #121212;
}

body.light .welcome-card {
  background-color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(252, 218, 104, 0.2);
  color: #121212;
}

body.light .welcome-description {
  color: #333;
}

body.light .feature-box {
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(252, 218, 104, 0.1);
}

body.light .feature-box:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

body.light .feature-box h3 {
  color: #121212;
}

body.light .feature-box p {
  color: #333;
}

body.light .history-panel,
body.light .prompt-area {
  background-color: rgba(255, 255, 255, 0.85);
  color: #121212;
}

body.light .history-panel h3 {
  color: #121212;
}

body.light .history-panel li {
  color: #121212;
  border: 1px solid rgba(252, 218, 104, 0.1);
  background-color: rgba(252, 218, 104, 0.05);
}

body.light .history-panel li.new-chat-btn {
  color: #121212;
}

body.light .prompt-area input {
  background-color: rgba(0, 0, 0, 0.05);
  color: #121212;
}

body.light .prompt-area input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

body.light .prompt-area button {
  background-color: rgba(0, 0, 0, 0.05);
  color: #121212;
}

body.light .ai-chat-area {
  background-color: #e2e2e2;
  color: #121212;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light .user-chat-area {
  background-color: #fcda68;
  color: #121212;
}

body.light .notification {
  background-color: rgba(255, 255, 255, 0.9);
  color: #121212;
}

body.light .api-settings-content {
  background-color: #ffffff;
  color: #121212;
  border: 1px solid rgba(252, 218, 104, 0.2);
}

body.light .api-settings h3 {
  color: #121212;
}

body.light .setting-group label {
  color: rgba(18, 18, 18, 0.8);
}

body.light .setting-group input {
  background-color: rgba(0, 0, 0, 0.05);
  color: #121212;
  border: 1px solid rgba(252, 218, 104, 0.2);
}

body.light .api-help {
  color: rgba(18, 18, 18, 0.6);
}

body.light .api-buttons button#cancelApiBtn {
  background-color: rgba(0, 0, 0, 0.1);
  color: #121212;
}

body.light .timestamp {
  color: rgba(18, 18, 18, 0.6);
}

body.light .highlight-letter {
  color: #e8a000;
  font-weight: bold;
}

/* Welcome page text color fix for light mode */
body.light .welcome-description {
  color: #333;
}

body.light .feature-box p {
  color: #333;
}

/* Fix for any inline text elements in light mode */
body.light p, 
body.light span:not(.timestamp):not(.highlight-letter), 
body.light div:not(.user-chat-area):not(.ai-chat-area) {
  color: #121212;
}

/* Input area text fix for light mode */
body.light input,
body.light textarea,
body.light select {
  color: #121212;
}

/* Welcome page content color fixes */
body.light .welcome-card p {
  color: #333;
}

/* Fix homepage feature descriptions */
body.light .welcome-card .feature-box p {
  color: rgba(18, 18, 18, 0.8);
}

/* Homepage styling for the new design */
.centered-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.logo-container {
  margin-bottom: 20px;
}

.bot-logo {
  width: 80px;
  height: 80px;
  background-color: #fcda68;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #121212;
}

.big-letters {
  display: flex;
  justify-content: center;
  margin: 15px 0 25px;
}

.big-word {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}

.big-letter {
  font-size: 52px;
  font-weight: 700;
  color: #fcda68;
  letter-spacing: 2px;
}

.welcome-description {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 auto 40px;
  max-width: 800px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.feature-box {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  text-align: left;
  transition: all 0.3s ease;
  border: 1px solid rgba(252, 218, 104, 0.05);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.feature-box:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(252, 218, 104, 0.3);
}

.feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 15px;
}

.brain {
  background-color: rgba(252, 176, 69, 0.15);
  color: #fcb045;
}

.vision {
  background-color: rgba(252, 218, 104, 0.15);
  color: #fcda68;
}

.voice {
  background-color: rgba(241, 150, 108, 0.15);
  color: #f1966c;
}

.visual {
  background-color: rgba(253, 200, 48, 0.15);
  color: #fdc830;
}

.feature-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
}

.feature-box p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Light mode adjustments for homepage */
body.light .bot-logo {
  background-color: #fcda68;
  color: #121212;
}

body.light .big-letter {
  color: #e8a000;
}

body.light .big-word {
  color: #121212;
}

body.light .feature-box {
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(252, 218, 104, 0.1);
}

body.light .feature-box h3 {
  color: #121212;
}

body.light .feature-box p {
  color: #333;
}

/* Sarcasm Mode Styling - ENHANCED */
body.sarcasm-mode {
  --sarcasm-color: #ff0066;
  --sarcasm-highlight: rgba(255, 0, 102, 0.35);
  --sarcasm-border: rgba(255, 0, 102, 0.6);
}

body.sarcasm-mode .top-bar {
  border-bottom: 2px solid var(--sarcasm-border);
  background-color: rgba(24, 24, 24, 0.95);
  box-shadow: 0 0 15px rgba(255, 0, 102, 0.5);
}

body.sarcasm-mode #sarcasmToggle {
  animation: pulse-sarcasm 1.5s infinite;
  background-color: rgba(255, 0, 102, 0.3);
  color: #ff0066;
  box-shadow: 0 0 10px rgba(255, 0, 102, 0.5);
}

@keyframes pulse-sarcasm {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(255, 0, 102, 0.7); }
  100% { transform: scale(1); }
}

body.sarcasm-mode .ai-chat-area {
  background-color: var(--sarcasm-highlight);
  border-left: 4px solid var(--sarcasm-color);
  font-style: italic;
}

body.sarcasm-mode .ai-chat-area::before {
  content: "🔥";
  position: absolute;
  left: -10px;
  top: -10px;
  font-size: 16px;
}

.sarcasm-message {
  font-style: italic;
  background-color: rgba(255, 0, 102, 0.25) !important;
  border-left: 4px solid #ff0066 !important;
  color: #fff !important;
  font-weight: bold;
}

.sarcasm-message::after {
  content: "🔥";
  margin-left: 5px;
}

/* Light mode sarcasm */
body.light.sarcasm-mode {
  --sarcasm-color: #ff0066;
  --sarcasm-highlight: rgba(255, 0, 102, 0.15);
  --sarcasm-border: rgba(255, 0, 102, 0.4);
}

body.light.sarcasm-mode .top-bar {
  border-bottom: 2px solid var(--sarcasm-border);
  background-color: rgba(245, 245, 245, 0.95);
  box-shadow: 0 0 15px rgba(255, 0, 102, 0.3);
}

body.light.sarcasm-mode .ai-chat-area {
  background-color: var(--sarcasm-highlight);
  border-left: 4px solid var(--sarcasm-color);
  color: #121212;
}

/* System Messages */
.system-message {
  opacity: 0.8;
  font-size: 0.9em;
}

.system-message .ai-chat-area {
  font-style: italic;
  padding: 8px 15px;
}

/* Sarcasm Mode Toggle Styling */
#sarcasmToggle {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

#sarcasmToggle.active {
  background-color: #ff0066 !important;
  color: white !important;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 0, 102, 0.5);
}

#sarcasmToggle::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center, 
    rgba(255, 255, 255, 0.2) 0%, 
    transparent 70%
  );
  transform: scale(0);
  transition: transform 0.3s ease;
  border-radius: 50%;
}

#sarcasmToggle.active::before {
  transform: scale(1);
}

#sarcasmToggle.active:hover {
  background-color: #ff2080 !important;
  box-shadow: 0 0 30px rgba(255, 0, 102, 0.7);
}

/* Pulsing animation for sarcasm mode */
@keyframes sarcasmPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

#sarcasmToggle.active {
  animation: sarcasmPulse 1.5s infinite;
}

/* Voice and Speech Recognition Styles */
.interim-results {
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-style: italic;
  display: none;
  text-align: center;
  z-index: 100;
}

#voice.listening {
  animation: pulse-red 1.5s infinite;
  background-color: rgba(255, 0, 0, 0.2);
  color: #ff0000;
}

#voice.speaking {
  animation: pulse-blue 1.5s infinite;
  background-color: rgba(0, 123, 255, 0.2);
  color: #007bff;
}

@keyframes pulse-red {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

@keyframes pulse-blue {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

/* Voice Toggle Button */
#voiceToggle.active {
  background-color: #007bff !important;
  color: white !important;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 123, 255, 0.5);
}

#voiceToggle.active:hover {
  background-color: #0056b3 !important;
  box-shadow: 0 0 30px rgba(0, 123, 255, 0.7);
}

/* Light mode adjustments */
body.light .interim-results {
  background: rgba(255, 255, 255, 0.95);
  color: #121212;
  border: 1px solid #ddd;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
