/* DragonMINDS Sidebar Navigation Styles */

/* This creates a skinny sidebar fixed to the left of the page */
.sidebar {
  position: fixed;
  top: 7vh;
  left: 0;
  bottom: 0;
  width: 5rem;
  padding: 2rem 1rem;
  background-color: #052E47; /* NFI Blue */
  z-index: 1050;
  transition: width 0.3s ease-in-out;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

/* when the user hovers on the sidebar, expand it */
.sidebar:hover {
  width: 16rem;
}

/* make sure the contents of the navlink don't wrap when navbar collapses */
.sidebar .nav-link {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  color: white !important;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
  background-color: #C1272D; /* Dragon Red */
  color: white !important;
}

.sidebar .nav-link.active {
  background-color: #0a4a72; /* NFI Blue Light */
  color: white !important;
}

/* fix the width of the icons */
.sidebar .nav-link i {
  width: 1.5rem;
  text-align: center;
  margin-right: 0.5rem;
}

/* hide the navlink labels by default */
.sidebar .nav-link span {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

/* when the sidebar is hovered, reveal the labels */
.sidebar:hover .nav-link span {
  visibility: visible;
  opacity: 1;
}

/* container for the sidebar header */
.sidebar-header {
  display: flex;
  justify-content: left;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* position the header relative to the logo and hide by default */
.sidebar-header h2 {
  opacity: 0;
  margin-left: 1rem;
  margin-bottom: 0;
  transition: opacity 0.2s ease-in-out;
  color: white;
  font-size: 1.2rem;
}

/* reveal the header when the sidebar is toggled */
.sidebar:hover .sidebar-header h2 {
  opacity: 1;
}

/* position the content relative to the collapsed sidebar */
.content {
  margin-left: 6rem;
  margin-right: 2rem;
  padding: 1rem;
  min-height: calc(100vh - 7vh);
}

/* Top navbar styles */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7vh;
  z-index: 1060;
  background: linear-gradient(135deg, #052E47 0%, #C1272D 100%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.5rem;
}

/* Adjust main content for navbar */
body {
  padding-top: 7vh;
}

/* Custom stat boxes for home page */
.stat-box {
  background: linear-gradient(135deg, #052E47 0%, #C1272D 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(193, 39, 45, 0.3);
  transition: transform 0.2s ease-in-out;
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(193, 39, 45, 0.4);
}

.stat-number {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 1.2em;
  opacity: 0.95;
}

/* Page titles and styling */
.page-title {
  color: #052E47;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 2.5em;
}

.page-subtitle {
  color: #6c757d;
  font-size: 1.2em;
  margin-bottom: 20px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
  }
  
  .sidebar:hover {
    width: 14rem;
    padding: 2rem 1rem;
  }
  
  .content {
    margin-left: 1rem;
  }
  
  .stat-box {
    margin-bottom: 10px;
  }
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

/* Error message styling */
.error-message {
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Success message styling */
.success-message {
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Custom dropdown styling */
.Select-control {
  border: 2px solid #052E47 !important;
}

.Select-control:hover {
  border-color: #C1272D !important;
}

/* ==================== CHAT WIDGET STYLES ==================== */

/* Chat widget hover effects */
#chat-toggle-btn:hover {
  background-color: #D84449 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(193, 39, 45, 0.4) !important;
}

/* Chat input focus */
#chat-input:focus {
  outline: none;
  border-color: #C1272D !important;
  box-shadow: 0 0 0 2px rgba(193, 39, 45, 0.2) !important;
}

/* Send button hover */
#chat-send-btn:hover {
  background-color: #D84449 !important;
}

/* Typing animation */
.typing-dot {
  color: #052E47;
  animation: typing 1.4s infinite ease-in-out;
}

@keyframes typing {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

/* Scrollbar styling */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: #0a4a72;
  border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #052E47;
}

/* Mobile responsiveness for chat */
@media (max-width: 480px) {
  #chat-panel {
    width: calc(100vw - 40px) !important;
    right: 20px !important;
    bottom: 80px !important;
  }
  
  #chat-toggle-btn {
    right: 15px !important;
    bottom: 15px !important;
  }
}