/* AI Departmental Portal - Main Stylesheet */

/* ========== Global Styles ========== */
:root {
  --primary-color: #0d6efd;
  --primary-dark: #0b5ed7;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --body-bg: #f5f7fa;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

body {
  background-color: var(--body-bg);
  color: var(--dark-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== Navbar ========== */
.navbar {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  padding: 0.8rem 1rem;
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: 1.5rem;
}

.navbar .nav-link {
  font-weight: 600;
  font-size: 1.2rem;
  padding: 0.7rem 1.2rem;
  transition: all var(--transition-speed);
}

.navbar .nav-link i {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

.navbar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  transform: translateY(-2px);
}

.navbar-toggler {
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
}

/* Dropdown menu adjustments for larger navbar */
.dropdown-menu {
  border: none;
  box-shadow: var(--card-shadow);
  border-radius: 8px;
}

.dropdown-item {
  padding: 0.6rem 1.2rem;
  transition: all var(--transition-speed);
}

.dropdown-item:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

/* ========== Cards & Containers ========== */
.card {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.container {
  padding: 1.5rem;
}

/* ========== Buttons ========== */
.btn {
  border-radius: 4px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all var(--transition-speed);
}

.btn-primary {
  background-color: #1067ea;
  border-color: #1067ea;
}

.btn-primary:hover {
  background-color: #0d5dd0;
  border-color: #0d5dd0;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.25);
}

/* Button with icon padding */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========== Forms ========== */
.form-control, .form-select {
  border-radius: 6px;
  border: 1px solid #dee2e6;
  padding: 0.6rem 1rem;
  transition: all var(--transition-speed);
}

.form-control:focus, .form-select:focus {
  border-color: #1067ea;
  box-shadow: 0 0 0 0.25rem rgba(16, 103, 234, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Form groups with better spacing */
.form-group {
  margin-bottom: 1.5rem;
}

/* ========== Tables ========== */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table-responsive {
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  padding: 1rem;
}

.table tbody tr {
  transition: all var(--transition-speed);
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

.table td {
  padding: 1rem;
  vertical-align: middle;
}

/* ========== Status Indicators ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge-success {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--success-color);
}

.status-badge-warning {
  background-color: rgba(255, 193, 7, 0.1);
  color: #997404;
}

.status-badge-danger {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

.status-badge-info {
  background-color: rgba(13, 202, 240, 0.1);
  color: var(--info-color);
}

.status-badge-primary {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
}

.status-badge-secondary {
  background-color: rgba(108, 117, 125, 0.1);
  color: var(--secondary-color);
}

/* ========== Loading States ========== */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* ========== Chat Interface ========== */
.chat-container {
  height: 500px;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background-color: #f8f9fa;
}

.chat-input-container {
  padding: 1rem;
  background-color: white;
  border-top: 1px solid #dee2e6;
}

.message {
  margin-bottom: 1rem;
  max-width: 80%;
}

.message-user {
  align-self: flex-end;
  background-color: var(--primary-color);
  color: white;
  border-radius: 18px 18px 4px 18px;
  padding: 0.8rem 1rem;
  margin-left: auto;
}

.message-bot {
  align-self: flex-start;
  background-color: white;
  border-radius: 4px 18px 18px 18px;
  padding: 0.8rem 1rem;
  border: 1px solid #dee2e6;
}

.message-timestamp {
  font-size: 0.7rem;
  color: rgba(108, 117, 125, 0.7);
  margin-top: 0.3rem;
}

/* ========== File Upload ========== */
.file-upload-container {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all var(--transition-speed);
  cursor: pointer;
}

.file-upload-container:hover, .file-upload-container.dragging {
  border-color: var(--primary-color);
  background-color: rgba(13, 110, 253, 0.05);
}

.file-upload-icon {
  font-size: 3rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

/* ========== Dashboard Widgets ========== */
.widget {
  height: 100%;
  transition: all var(--transition-speed);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.widget-body {
  padding: 1.25rem;
}

.widget-actions {
  display: flex;
  gap: 0.5rem;
}

/* ========== Footer ========== */
.footer {
  margin-top: auto;
  padding: 1rem 0;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

/* ========== Dark Mode ========== */
[data-bs-theme="dark"] {
  --body-bg: #1a1d20;
  --dark-color: #e9ecef;
  --light-color: #212529;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #2c3034;
}

[data-bs-theme="dark"] .table thead th {
  background-color: #212529;
}

[data-bs-theme="dark"] .table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .message {
    max-width: 90%;
  }
}

/* ========== Department Tabs ========== */
.department-tabs .nav-link {
  padding: 0.6rem 1.2rem;
  transition: all var(--transition-speed);
  margin-bottom: 0.5rem;
}

.department-tabs .nav-link:hover {
  transform: translateY(-2px);
}

.department-tabs .nav-link.active {
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.department-tabs .tab-pane {
  transition: all 0.3s ease-in-out;
}

/* Chat container height constraint for better UX */
.chat-container {
  max-height: 400px;
  overflow-y: auto;
  scrollbar-width: thin;
}

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

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

.chat-container::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.05);
}

/* ========== Mobile Optimizations ========== */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .message {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .message-content {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .department-tabs .nav {
    flex-wrap: wrap;
  }
  
  .department-tabs .nav-link {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }
  
  .chat-container {
    height: 350px;
  }
  
  .role-card, .stat-card {
    margin-bottom: 1.5rem;
  }
  
  .display-4, .display-5 {
    font-size: calc(1.5rem + 1.5vw);
  }
  
  .lead {
    font-size: 1.1rem;
  }
}

/* ========== Performance Optimizations ========== */
/* Add will-change for elements with animations */
.card:hover,
.btn:hover,
.hover-item:hover,
.hover-stat:hover {
  will-change: transform;
}

/* Use hardware acceleration for smoother animations */
.loading-spinner,
.role-card, 
.stat-card {
  transform: translateZ(0);
}

/* Optimize icon rendering */
.fas, .far, .fab {
  text-rendering: optimizeSpeed;
}

/* Any additional CSS can be added below */

/* Navbar improvements for better visibility */
@media (max-width: 992px) {
  .navbar-brand {
    font-size: 1.3rem;
  }
  
  .navbar .nav-link {
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
  }
}

/* Make sure department names and user info don't get cut off */
.navbar-nav .nav-link, .navbar .dropdown-toggle {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
  line-height: 1.2;
  padding: 8px 16px !important;
}

.container-fluid {
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Handle long department names */
.department-label, .navbar .nav-link {
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  max-width: none !important;
}

/* Mobile responsive adjustments */
@media (max-width: 992px) {
  .navbar-collapse {
    padding-top: 10px;
  }
  
  .navbar-nav .nav-link {
    padding: 8px 0 !important;
  }
}

/* Main content container */
.content-container {
  flex: 1;
  padding: 2rem 0;
}

/* Custom alert styling */
.alert {
  border-radius: 6px;
}

/* Enhance accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Chat page specific */
body.chat-page {
  overflow: hidden;
}

.chat-page .container-fluid {
  padding: 0;
  height: calc(100vh - 56px);
}

/* Override for chat window in fullscreen mode */
.fullscreen-chat .container-fluid {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
} 
/* UI Layout Improvements */
#embeddable-chatbot .icon-container {
    margin-top: -30px;
    position: relative;
    z-index: 2;
}

#embeddable-chatbot .row {
    margin-bottom: 10px;
}

#capabilities .col-md-6 {
    margin-bottom: 15px;
}

#capabilities .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#capabilities .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#capabilities .card-text {
    flex: 1;
}

/* Reduce spacing overall */
.section-padding {
    padding: 50px 0;
}

/* Align elements better */
.text-center.mb-5 {
    margin-bottom: 3rem !important;
}

/* Make the demo button more prominent */
.btn-primary.demo-btn {
    padding: 10px 20px;
    font-weight: 600;
}

/* Embeddable Chatbot Section Improvements */
.feature-icon-wrapper {
    margin-bottom: 15px !important;
}

.chatbot-icon {
    margin-top: -25px !important;
    z-index: 5 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #0d6efd !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.chatbot-icon i.fa-code {
    font-size: 1.75rem !important;
    color: white !important;
}

.bg-light.rounded .row {
    align-items: stretch;
}

.bg-light.rounded .card {
    margin-bottom: 0;
    height: 100%;
}

.bg-light.rounded .list-group-item {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.bg-light.rounded h5 {
    margin-bottom: 0.5rem;
}

.bg-light.rounded .mb-4 {
    margin-bottom: 1rem !important;
}

.bg-light.rounded .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Ensure proper alignment of elements */
.bg-light.rounded .d-flex {
    align-items: flex-start;
}

.bg-light.rounded .card-body {
    padding: 1rem;
}

/* Ensure equal height cards */
.bg-light.rounded .h-100 {
    height: 100% !important;
}

/* Reduce spacing between sections */
.mt-5.mb-5 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
}
