/* Custom Styles */
:root {
  --primary-blue: #2563EB;
  --primary-cyan: #06B6D4;
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-600: #4B5563;
  --gray-400: #9CA3AF;
}

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

::-webkit-scrollbar-track {
  background: var(--gray-800);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-600);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* Smooth animations */
* {
  transition: all 0.2s ease;
}

/* Auto-resize textarea */
textarea {
  resize: none;
  min-height: 20px;
  max-height: 120px;
}

/* Message animations */
.message-enter {
  opacity: 0;
  transform: translateY(10px);
  animation: messageEnter 0.3s ease forwards;
}

@keyframes messageEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User status indicators */
.user-online {
  position: relative;
}

.user-online::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #10B981;
  border: 2px solid var(--gray-800);
  border-radius: 50%;
}

/* File type icons */
.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 18px;
  color: white;
}

.file-icon.pdf { background: #EF4444; }
.file-icon.doc { background: #2563EB; }
.file-icon.xls { background: #059669; }
.file-icon.ppt { background: #DC2626; }
.file-icon.zip { background: #7C3AED; }
.file-icon.image { background: #06B6D4; }
.file-icon.video { background: #EC4899; }
.file-icon.audio { background: #F59E0B; }
.file-icon.code { background: #6B7280; }
.file-icon.text { background: #4B5563; }
.file-icon.default { background: var(--gray-600); }

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Mobile sidebar overlay */
@media (max-width: 1023px) {
  #sidebar.mobile-open {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    transform: translateX(0);
  }
  
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
}

/* Image preview styles */
.image-preview {
  max-width: 300px;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.image-preview:hover {
  transform: scale(1.05);
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Message status */
.message-status {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* Responsive design improvements */
@media (max-width: 768px) {
  .message {
    max-width: 85%;
  }
  
  .file-preview-container {
    max-width: 250px;
  }
}

/* Custom focus styles */
input:focus,
textarea:focus,
button:focus {
  outline: none;
  ring: 2px;
  ring-color: var(--primary-blue);
  ring-offset: 2px;
  ring-offset-color: var(--gray-800);
}

/* Smooth page transitions */
#landing-page,
#chat-interface {
  transition: opacity 0.5s ease;
}

/* Enhanced button styles */
button {
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}