/* Chat Interface Styles */
.chat-interface {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f8ceec 75%, #ffecd2 100%);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  overflow: hidden;
}

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

.chat-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-voice-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-voice-toggle:hover {
  background: #f1f5f9;
}

.quick-voice-toggle.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.quick-voice-toggle.active:hover {
  background: #5a67d8;
}

.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  margin: 0.5rem 0;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.messages-overlay {
  position: relative;
  z-index: 2;
  border-radius: 8px;
  padding: 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100%;
}

.chat-input-container {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.voice-controls-panel {
  position: fixed;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Message List Styles */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.message-list.empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.empty-state {
  text-align: center;
  color: #64748b;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  max-width: 400px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: #334155;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 85%;
  animation: fadeIn 0.3s ease-in-out;
}

.message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.message.assistant {
  margin-right: auto;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.message.user .message-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.message-content {
  position: relative;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  transition: all 0.3s ease;
}

.message.user .message-content {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.message.assistant .message-content {
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.message:hover .message-content {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.message.user:hover .message-content {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.message-image-container {
  margin-top: 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.message-image-container img {
  width: 100%;
  height: auto;
  max-width: 300px;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.message-image-container:hover img {
  transform: scale(1.02);
}

.image-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px dashed rgba(102, 126, 234, 0.3);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

.image-error {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1.5rem;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  gap: 0.75rem;
}

.image-error button {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.image-error button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.message-text {
  line-height: 1.6;
  font-size: 0.95rem;
}

.message-text:last-child {
  margin-bottom: 0;
}

.message-content .message-text + .message-image-container {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.3);
  padding-top: 0.75rem;
}

.message-text p {
  margin: 0 0 0.75rem 0;
  word-wrap: break-word;
}

.message.user .message-text p {
  color: rgba(255, 255, 255, 0.95);
}

.message-timestamp {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.5rem;
  font-weight: 500;
}

.message.user .message-timestamp {
  color: rgba(255, 255, 255, 0.8);
}

.message-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.message:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  padding: 0.5rem;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
}

.message-action-btn:hover {
  background: rgba(241, 245, 249, 0.9);
  color: #475569;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user .message-action-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.message.user .message-action-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Streaming Animation */
.message.streaming .message-content::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 18px;
  background: currentColor;
  margin-left: 4px;
  animation: blink 1s infinite;
  border-radius: 1px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Scrollbar */
.messages-container::-webkit-scrollbar {
  width: 6px;
}

.messages-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
  .chat-header {
    padding: 1rem;
  }
  
  .header-top {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .header-controls {
    justify-content: center;
  }
  
  .chat-content {
    margin: 0.25rem 0;
    border-radius: 12px;
  }
  
  .message {
    max-width: 95%;
  }
  
  .message-image-container img {
    max-width: 250px;
  }
  
  .voice-controls-panel {
    position: fixed;
    bottom: 6rem;
    right: 1rem;
    top: auto;
    transform: none;
  }
}

@media (max-width: 480px) {
  .messages-container {
    padding: 1rem;
  }
  
  .chat-input-container {
    padding: 0.75rem 1rem 1rem 1rem;
  }
  
  .message {
    max-width: 98%;
  }
  
  .message-content {
    padding: 0.75rem 1rem;
  }
  
  .message-image-container img {
    max-width: 200px;
  }
}


/* Session Tabs Styles */
.session-tabs {
  margin-top: 1rem;
}

.tabs-container {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0 0 1rem 0;
}

.session-tab {
  flex-shrink: 0;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  min-width: 200px;
  max-width: 300px;
}

.session-tab:hover {
  background: rgba(241, 245, 249, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.session-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tab-info {
  flex: 1;
}

.tab-title {
  font-weight: 600;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-meta {
  font-size: 0.75rem;
  opacity: 0.7;
}

.tab-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tab-action-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.tab-action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  opacity: 1;
}

.session-tab.active .tab-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.edit-input {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 6px;
  padding: 0.5rem;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
}

.new-session-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.new-session-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245, 87, 108, 0.4);
}

/* Model Selector Styles */
.model-selector {
  position: relative;
  display: inline-block;
}

.model-selector-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.model-selector-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.model-icon {
  width: 16px;
  height: 16px;
}

.model-name {
  font-size: 0.875rem;
}

.chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.chevron.open {
  transform: rotate(180deg);
}

.model-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 16px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 0.5rem;
  animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-header {
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.dropdown-header h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  color: #334155;
}

.dropdown-header p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.model-list {
  padding: 0.5rem;
}

.model-option {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  margin-bottom: 0.5rem;
}

.model-option:hover {
  background: rgba(100, 116, 139, 0.1);
}

.model-option.active {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.model-option-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.model-option-info {
  flex: 1;
}

.model-option-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: #334155;
  margin-bottom: 0.25rem;
}

.model-option-description {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.4;
}

.model-option-features {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.feature-badge {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.feature-badge.vision {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.feature-badge.streaming {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.feature-badge.tokens {
  background: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
} 