/* Light Theme CSS Variables */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light dark;
    --user-fg: #EFEFEF;   
    --user-bg: #1588ff;   
    --bubble-assistant-fg: #000;
    --bubble-assistant-bg: #ededed;
    --fg: #000;
    --bg: #FFF;           
    --bg2: #f3f3f3;       
    --bg3: #252525;       
    --bg4: #b3b3b3;       
    --shadow: 0 2px 8px rgba(0,0,0,0.15);
    --start: #333;        
    --stop: #333;         
    --reset: #333;        
  }
}
/* Dark Theme CSS Variables */
@media (prefers-color-scheme: dark) {
  :root {
    --user-fg: #EFEFEF;  
    --user-bg: #1588ff;  /* Message Sent */
    --bubble-assistant-fg: #FFF;
    --bubble-assistant-bg: #252525;
    --fg: #FFF; 
    --bg: #000;          
    --bg2: #111;         
    --bg3: #252525;      
    --bg4: #b3b3b3;      
    --shadow: 0 2px 8px rgba(0,0,0,0.15);
    --start: #fff;        
    --stop: #fff;         
    --reset: #fff;        
  }
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Inter', Arial, sans-serif;
  background: url("static/background.jpg") no-repeat center center fixed;
  background-size: cover;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
}
#app {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.chat-container {
  flex: 1;
  max-width: 480px;
  width: 100%;
  background: var(--bg);
  box-shadow: var(--shadow);
  margin: 24px 0;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.header {
  background: var(--bg);
  color: var(--fg);
  padding: 18px 24px;
  font-size: 1.25rem;
  letter-spacing: 1px;
  font-weight: 500;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status {
  font-size: 0.9rem;
  color: var(--fg);
  margin-left: auto;
}
.messages {
  flex: 1;
  padding: 20px 16px 16px 16px;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 82%;
  font-size: 1.02rem;
  line-height: 1.6;
  position: relative;
  display: inline-block;
  word-break: break-word;
  box-shadow: 0 0.5px 2px rgba(44,62,80,0.1);
}
.bubble.user {
  color: var(--user-fg);
  background: var(--user-bg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}
.bubble.assistant {
  color: var(--bubble-assistant-fg);
  background: var(--bubble-assistant-bg);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  margin-right: auto;
}
/* Updated typing bubble to a simpler, lighter color */
.bubble.typing {
  color: var(--bubble-assistant-fg);
  background: var(--bubble-assistant-bg);
  opacity: 1;
  min-width: 60px;
  border-radius: 16px;
}
@keyframes pulsebg {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}
.input-bar {
  border-top: 1px solid var(--bg2);
  background: var(--bg2);
  border-radius: 7px;
  display: flex;
  padding: 12px 12px;
  align-items: center;
  gap: 8px;
}
.input-bar button {
  appearance: none;
  outline: none;
  border: none;
  padding: 8px 18px;
  color: var(--fg);
  background: var(--bg2);
  font-size: 1rem;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
  margin-left: 4px;
}
.input-bar button:active {
  background: var(--bg3);
}
.input-bar button:disabled {
  background: var(--bg4);
  cursor: default;
}
@media (max-width: 600px) {
  .chat-container {
    margin: 0;
    border-radius: 0;
    max-width: 100vw;
  }
  .header {
    border-radius: 0;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
}

.btn svg {
  margin: 0;
}

.start-btn {
  background-color: var(--start);
}

.stop-btn {
  background-color: var(--stop);
}

.reset-btn {
  background-color: var(--reset);
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}    
.speed-control {
  flex: 1;
  margin: 0 16px;
  max-width: 200px;
}
#speedSlider {
  width: 100%;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  outline: none;
  padding: 0.1rem;
  -webkit-appearance: none;
  border-radius: 5px;
}
#speedSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--bg3);
  border-radius: 50%;
  cursor: pointer;
}
.speed-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.8rem;
  color: #666;
}
