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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8f9fa;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  min-width: 280px;
  background-color: #ffffff;
  transition: transform 0.3s ease;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1050;
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
}

.brand-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
}

.brand-icon i {
  color: white !important;
}

/* Navigation Links */
.nav .btn {
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.nav .btn:hover {
  background-color: #e9ecef;
  transform: translateX(2px);
}

.nav .btn i {
  font-size: 1.1rem;
}

/* Model Selector */
#modelSelect {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

#modelSelect:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Chat Container */
.chat-messages {
  max-width: 900px;
  margin: 0 auto;
}

/* Message Styles */
.message {
  animation: slideIn 0.3s ease;
}

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

.user-message .message-text > div {
  background-color: #667eea !important;
  color: white;
}

.assistant-message .message-text > div {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
}

.message-avatar {
  flex-shrink: 0;
}

.message-actions .btn {
  border-radius: 6px;
  padding: 4px 8px;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #667eea;
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.4s infinite;
}

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

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

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

/* Code Blocks */
pre {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
}

code {
  background-color: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

pre code {
  background: none;
  padding: 0;
}

/* Input Container */
.input-container {
  position: relative;
}

.input-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.input-group .form-control {
  border: 1px solid #dee2e6;
  padding: 12px 16px;
  font-size: 1rem;
}

.input-group .form-control:focus {
  border-color: #667eea;
  box-shadow: none;
}

.input-group .btn {
  padding: 12px 20px;
  border: none;
}

#sendBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transition: all 0.3s ease;
}

#sendBtn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sendBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#attachBtn {
  border-color: #dee2e6;
  background-color: white;
  transition: all 0.2s ease;
}

#attachBtn:hover {
  background-color: #f8f9fa;
  border-color: #667eea;
}

/* Welcome Screen */
.welcome-icon {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Prompt Cards */
.prompt-card {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  transition: all 0.3s ease;
  text-align: left;
  height: 100%;
}

.prompt-card:hover {
  border-color: #667eea;
  background-color: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.prompt-card i {
  font-size: 1.2rem;
  color: #667eea;
}

/* Status Badge */
.online-dot {
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: blink 2s ease-in-out infinite;
}

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

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-light {
  background-color: #f8f9fa;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-light:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

/* Modal Styles */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid #e9ecef;
  padding: 20px 24px;
}

.modal-body {
  padding: 24px;
}

/* Form Controls */
.form-check-input:checked {
  background-color: #667eea;
  border-color: #667eea;
}

.form-range::-webkit-slider-thumb {
  background-color: #667eea;
}

.form-range::-moz-range-thumb {
  background-color: #667eea;
}

.form-select {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 8px 12px;
}

.form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    min-width: 260px;
  }
  
  .chat-messages {
    padding: 0 16px;
  }
  
  .prompt-card {
    padding: 16px !important;
  }
  
  .welcome-icon i {
    font-size: 3rem !important;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

/* Alert Styles */
.alert {
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

/* Utility Classes */
.text-primary {
  color: #667eea !important;
}

.bg-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Focus States */
*:focus {
  outline: none;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Disabled State */
:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Link Styles */
a {
  text-decoration: none;
  color: #667eea;
  transition: color 0.2s ease;
}

a:hover {
  color: #764ba2;
}
