:root {
  --primary-red: #dc3545;
  --light-red: #f8d7da;
  --dark-red: #721c24;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.hero-section {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.navbar-brand {
  font-size: 1.8rem !important;
}

.card {
  border: none;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.btn-danger {
  background-color: var(--primary-red);
  border-color: var(--primary-red);
  border-radius: 25px;
  padding: 10px 30px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background-color: var(--dark-red);
  border-color: var(--dark-red);
  transform: translateY(-2px);
}

.btn-outline-danger {
  border-color: var(--primary-red);
  color: var(--primary-red);
  border-radius: 25px;
  padding: 10px 30px;
  font-weight: 500;
}

.btn-outline-danger:hover {
  background-color: var(--primary-red);
  border-color: var(--primary-red);
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 12px 15px;
  transition: border-color 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.text-danger {
  color: var(--primary-red) !important;
}

.bg-danger {
  background-color: var(--primary-red) !important;
}

.alert-danger {
  background-color: var(--light-red);
  border-color: var(--primary-red);
  color: var(--dark-red);
}

.table-hover tbody tr:hover {
  background-color: rgba(220, 53, 69, 0.05);
}

.stats-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-left: 4px solid var(--primary-red);
}

.chart-container {
  position: relative;
  height: 300px;
  margin: 20px 0;
}

.sidebar {
  background-color: #f8f9fa;
  min-height: 100vh;
  border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
  color: #495057;
  padding: 12px 20px;
  border-radius: 8px;
  margin: 5px 10px;
  transition: all 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: var(--primary-red);
  color: white;
}

.dashboard-header {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
  color: white;
  padding: 30px 0;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding: 40px 0;
  }

  .display-4 {
    font-size: 2rem;
  }

  .sidebar {
    min-height: auto;
  }
}

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

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

.pulse {
  animation: pulse 2s infinite;
}

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--dark-red);
}
/* --- Root Variables for Color Palette --- */
:root {
    --primary-red: #D9232D;
    --primary-text: #FFFFFF;
    --chat-background: #F4F4F4;
    --user-bubble: #EAEAEA;
    --bot-bubble: #D9232D;
}

/* --- Basic Page Styles --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f9f9f9;
}

.main-content {
    padding: 40px;
    text-align: center;
}

/* --- Chat Icon --- */
.chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-red);
    color: var(--primary-text);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.chat-icon:hover {
    transform: scale(1.1);
}

/* --- Chat Window --- */
.chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 370px;
    height: 550px;
    background-color: var(--chat-background);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.chat-window.open {
    transform: scale(1);
}

/* --- Chat Header --- */
.chat-header {
    background-color: var(--primary-red);
    color: var(--primary-text);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-title {
    margin: 0;
    font-size: 1.2rem;
}

.language-toggle .lang-btn {
    background: none;
    border: 1px solid var(--primary-text);
    color: var(--primary-text);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: all 0.2s;
}

.language-toggle .lang-btn.active {
    background-color: var(--primary-text);
    color: var(--primary-red);
    opacity: 1;
}

/* --- Chat Body (Message Log) --- */
.chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message {
    background-color: var(--user-bubble);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background-color: var(--bot-bubble);
    color: var(--primary-text);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

/* Typing Indicator */
.typing-indicator {
    align-self: flex-start;
}
.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: typing 1s infinite;
    margin: 0 2px;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- Chat Footer (Input Area) --- */
.chat-footer {
    padding: 10px;
    background-color: #fff;
    flex-shrink: 0;
}

#chat-form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
}

#chat-input {
    flex-grow: 1;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

#send-btn {
    background-color: var(--primary-red);
    color: var(--primary-text);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

#send-btn:hover {
    opacity: 0.8;
}

/* --- Responsive Design --- */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    .chat-icon {
        bottom: 20px;
        right: 20px;
    }
}

/* Sidebar toggler custom style */
.sidebar-toggler-btn {
  background-color: var(--primary-red) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.15);
  transition: background 0.2s, box-shadow 0.2s;
}
.sidebar-toggler-btn:hover, .sidebar-toggler-btn:focus {
  background-color: var(--dark-red) !important;
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.25);
}
