/* Chatbot CSS - Gemini-like Interface */

:root {
  /* Colors */
  --primary-bg: #0f0f0f;
  --secondary-bg: #1a1a1a;
  --tertiary-bg: #262626;
  --sidebar-bg: #131313;
  --card-bg: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --accent-primary: #00d4ff;
  --accent-secondary: #7c3aed;
  --border-color: rgba(255, 255, 255, 0.1);
  --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s ease;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--primary-bg);
  color: var(--text-primary);
  overflow: hidden;
}

/* Main App Layout */
.chatbot-app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.chatbot-sidebar {
  width: 256px;
  min-width: 220px;
  max-width: 420px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 12px;
  cursor: ew-resize;
  z-index: 10;
  background: transparent;
}

.sidebar-resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  width: 2px;
  height: 32px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-resize-handle:hover::before {
  background: rgba(255, 255, 255, 0.4);
}

.sidebar-resize-handle:hover {
  background: rgba(255, 255, 255, 0.02);
}

.chatbot-sidebar::-webkit-scrollbar {
  width: 6px;
}

.chatbot-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.chatbot-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Header */
.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.new-chat-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.new-chat-btn i {
  width: 1.25rem;
  height: 1.25rem;
}

/* Sidebar Search */
.sidebar-search {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-search i {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 1rem;
  height: 1rem;
  pointer-events: none;
  display: block;
  line-height: 1;
}

/* Sidebar Section */
.sidebar-section {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 0.5rem;
  transition: all var(--transition);
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.sidebar-nav-item i {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Recent Chats */
.recent-chats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recent-chat-item {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition);
}

.recent-chat-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: all var(--transition);
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-bg);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.profile-menu-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.profile-menu-btn:hover {
  color: var(--text-primary);
}

.profile-menu-btn i {
  width: 1.25rem;
  height: 1.25rem;
}

/* Main Chat Area */
.chatbot-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--primary-bg);
  position: relative;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.conversation-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.conversation-title p {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  max-width: 650px;
}

.conversation-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.chat-header {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

.chat-header-title {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

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

/* Welcome Section */
.welcome-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  margin: auto;
}

.welcome-content {
  text-align: center;
  max-width: 900px;
  width: 100%;
}

.welcome-title {
  font-size: 3.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* Welcome Chips */
.welcome-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.welcome-chip {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}

.welcome-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gradient-primary);
  border-radius: 0.75rem;
  flex-shrink: 0;
  color: var(--primary-bg);
}

.chip-icon i {
  width: 1.25rem;
  height: 1.25rem;
}

.chip-content {
  min-width: 0;
}

.chip-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.chip-text {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

/* Messages */
.message {
  display: flex;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

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

.user-message {
  justify-content: flex-end;
}

.bot-message {
  justify-content: flex-start;
}

.message-content {
  max-width: 65%;
  padding: 1rem 1.5rem;
  border-radius: 1.25rem;
  line-height: 1.6;
  word-wrap: break-word;
  font-size: 0.95rem;
}

.bot-message .message-content {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.user-message .message-content {
  background: var(--accent-primary);
  color: var(--primary-bg);
  border: none;
  font-weight: 500;
}

/* Input Area */
.chat-input-area {
  padding: 2rem;
  border-top: 1px solid var(--border-color);
  background: var(--primary-bg);
}

.input-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.chat-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.input-action-btn {
  width: 2.75rem;
  height: 2.75rem;
  background: var(--accent-primary);
  border: none;
  border-radius: 50%;
  color: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.input-action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.input-action-btn:active {
  transform: scale(0.95);
}

.input-action-btn i {
  width: 1.25rem;
  height: 1.25rem;
}

.input-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .chatbot-sidebar {
    width: 220px;
  }

  .welcome-title {
    font-size: 2.5rem;
  }

  .welcome-chips {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .chatbot-app {
    flex-direction: column;
  }

  .chatbot-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 1rem;
    align-items: center;
  }

  .sidebar-header {
    padding: 0;
    border: none;
  }

  .new-chat-btn {
    white-space: nowrap;
  }

  .sidebar-search {
    display: none;
  }

  .sidebar-section {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .chat-header {
    display: flex;
  }

  .sidebar-toggle {
    display: block;
  }

  .welcome-title {
    font-size: 2rem;
  }

  .welcome-chips {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .message-content {
    max-width: 85%;
  }

  .chat-input-area {
    padding: 1.5rem 1rem;
  }

  .input-container {
    padding: 0;
  }
}

@media (max-width: 480px) {
  .chat-messages {
    padding: 1rem;
  }

  .welcome-title {
    font-size: 1.75rem;
  }

  .welcome-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .welcome-chips {
    gap: 0.75rem;
  }

  .welcome-chip {
    padding: 1rem;
  }

  .chip-icon {
    width: 2rem;
    height: 2rem;
  }

  .chip-title {
    font-size: 0.85rem;
  }

  .chip-text {
    font-size: 0.75rem;
  }

  .chat-input {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .input-action-btn {
    width: 2.5rem;
    height: 2.5rem;
  }

  .input-footer {
    font-size: 0.7rem;
  }

  .message-content {
    max-width: 95%;
    padding: 0.75rem 1rem;
  }
}

/* Images Modal */
.images-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.images-modal.active {
  display: flex;
  opacity: 1;
}

.images-modal-content {
  background: var(--secondary-bg);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

.images-modal-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
}

.images-modal-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.images-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.images-modal-body::-webkit-scrollbar {
  width: 6px;
}

.images-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.no-images {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-secondary);
}

.no-images i {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-images p {
  font-size: 1rem;
}

.image-item {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
  cursor: pointer;
}

.image-item:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.image-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.image-meta {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
}

.image-from {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.image-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Responsive Images Modal */
@media (max-width: 768px) {
  .images-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .images-modal-body {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
  }

  .images-modal-header {
    padding: 1.25rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .images-modal-content {
    width: 98%;
    border-radius: 0.75rem;
  }

  .images-modal-body {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
  }

  .images-modal-header {
    padding: 1rem;
  }

  .images-modal-header h2 {
    font-size: 1.25rem;
  }

  .image-item img {
    height: 150px;
  }

  .image-meta {
    padding: 0.75rem;
  }

  .image-from {
    font-size: 0.7rem;
  }

  .image-label {
    font-size: 0.8rem;
  }
}
