/* Custom styles for Personal AI Chat App */

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #374151;
}

::-webkit-scrollbar-thumb {
  background: #6B7280;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* Auto-resize textarea */
.auto-resize {
  min-height: 40px;
  max-height: 150px;
  resize: none;
  overflow-y: auto;
}

/* Message bubble animations */
.message-bubble {
  animation: fadeInUp 0.3s ease-out;
}

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

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 12px 16px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #6B7280;
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Code block styling */
.code-block {
  position: relative;
  margin: 12px 0;
}

.code-header {
  background: #1F2937;
  color: #D1D5DB;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 6px 6px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copy-btn {
  background: #374151;
  border: none;
  color: #9CA3AF;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: background-color 0.2s;
}

.copy-btn:hover {
  background: #4B5563;
  color: #F9FAFB;
}

/* Message content styling */
.message-content {
  line-height: 1.6;
}

.message-content p {
  margin: 8px 0;
}

.message-content ul, .message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.message-content blockquote {
  border-left: 3px solid #6B7280;
  padding-left: 12px;
  margin: 12px 0;
  color: #D1D5DB;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.message-content th,
.message-content td {
  border: 1px solid #4B5563;
  padding: 8px;
  text-align: left;
}

.message-content th {
  background: #374151;
  font-weight: 600;
}

/* Conversation list item hover effects */
.conversation-item {
  transition: background-color 0.2s;
}

.conversation-item:hover {
  background-color: #374151;
}

.conversation-item.active {
  background-color: #1F2937;
  border-right: 3px solid #3B82F6;
}

/* Model selector animations */
.model-dropdown {
  animation: slideDown 0.2s ease-out;
}

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

/* Provider tab styling */
.provider-tab {
  transition: all 0.2s;
}

.provider-tab.active {
  background: #3B82F6;
  color: white;
}

/* Modal animations */
.modal-enter {
  animation: modalEnter 0.3s ease-out;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    height: 100vh;
    z-index: 40;
    transition: left 0.3s ease;
  }
  
  #sidebar.open {
    left: 0;
  }
  
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 30;
  }
  
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #1F2937;
    border-bottom: 1px solid #374151;
  }
  
  .hamburger-btn {
    display: block;
    background: none;
    border: none;
    color: #D1D5DB;
    font-size: 20px;
    cursor: pointer;
  }
}

/* Desktop hide mobile elements */
@media (min-width: 769px) {
  .mobile-header {
    display: none;
  }
  
  .hamburger-btn {
    display: none;
  }
}