/* Custom styles for AdminLTE MVC */

/* Remove body margin since AdminLTE handles layout */
body {
  margin: 0;
}

/* Custom card styles */
.card {
  margin-bottom: 20px;
}

/* Timeline custom styles */
.timeline {
  position: relative;
  padding-left: 0;
}

.timeline > div {
  margin-bottom: 15px;
  position: relative;
}

.timeline > div > .timeline-item {
  background: #f4f4f4;
  border-radius: 3px;
  padding: 10px;
  margin-left: 50px;
  margin-top: 0;
}

.timeline > div > .fas,
.timeline > div > .far {
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 30px;
  position: absolute;
  color: #fff;
  text-align: center;
  border-radius: 50%;
  left: 10px;
}

.bg-blue { background-color: #007bff !important; }
.bg-green { background-color: #28a745 !important; }
.bg-yellow { background-color: #ffc107 !important; }
.bg-gray { background-color: #6c757d !important; }

/* Custom adjustments */
.content-wrapper {
  min-height: calc(100vh - 57px - 57px);
}

.main-footer {
  padding: 0.25rem 1rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.main-footer strong,
.main-footer .float-right {
  font-size: 0.75rem;
}

/* Sidebar chatbot */
.main-sidebar .sidebar {
  display: flex;
  flex-direction: column;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.main-sidebar .sidebar > nav.mt-2 {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.spm-chatbot {
  margin: 0 0 6px 6px;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  flex: 0 0 calc(100% - 12px);
  max-height: calc(100% - 20px);
  min-height: 0;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
}

/* Sidebar collapsed behavior:
   - Desktop: show chatbot when sidebar is hovered/focused (expanded width)
   - Mobile: show only when sidebar is opened */
@media (min-width: 992px) {
  body.sidebar-collapse .main-sidebar:not(:hover):not(:focus-within) #aiChartBot {
    display: none;
  }

  body.sidebar-collapse .main-sidebar:hover #aiChartBot,
  body.sidebar-collapse .main-sidebar:focus-within #aiChartBot {
    display: flex;
  }
}

@media (max-width: 991.98px) {
  body.sidebar-collapse:not(.sidebar-open) #aiChartBot {
    display: none;
  }
}

.spm-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.spm-chatbot-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e9f1ff;
}

.spm-chatbot-status {
  font-size: 0.65rem;
  color: #9bd7a8;
  background: rgba(40, 167, 69, 0.14);
  border: 1px solid rgba(40, 167, 69, 0.35);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
}

.spm-chatbot-status.warning {
  color: #ffe39a;
  background: rgba(255, 193, 7, 0.16);
  border-color: rgba(255, 193, 7, 0.42);
}

.spm-chatbot-suggestions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.spm-chatbot-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #d9e6ff;
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
  padding: 0.26rem 0.48rem;
  cursor: pointer;
}

.spm-chatbot-chip:hover {
  background: rgba(0, 123, 255, 0.2);
  border-color: rgba(0, 123, 255, 0.45);
}

.spm-chatbot-messages {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 0.45rem;
}

.spm-chatbot-msg {
  margin-bottom: 0.38rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.spm-chatbot-msg.user {
  align-items: flex-end;
}

.spm-chatbot-bubble {
  max-width: 92%;
  font-size: 0.69rem;
  line-height: 1.35;
  border-radius: 10px;
  padding: 0.34rem 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.spm-chatbot-msg.bot .spm-chatbot-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: #e6edfb;
}

.spm-chatbot-msg.warning .spm-chatbot-bubble {
  background: rgba(255, 193, 7, 0.2);
  color: #fff3cf;
  border: 1px solid rgba(255, 193, 7, 0.45);
}

.spm-chatbot-meta {
  margin-top: 0.15rem;
  font-size: 0.56rem;
  color: rgba(230, 237, 251, 0.58);
  line-height: 1;
}

.spm-chatbot-msg.warning .spm-chatbot-meta {
  color: rgba(255, 236, 179, 0.78);
}

.spm-chatbot-msg.user .spm-chatbot-bubble {
  background: #0d6efd;
  color: #fff;
}

.spm-chatbot-input {
  display: flex;
  gap: 0.3rem;
}

.spm-chatbot-input .form-control {
  min-width: 0;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.95);
}

.spm-chatbot-input .btn {
  min-width: 34px;
}

/* Info box hover effect */
.info-box:hover {
  transform: translateY(-5px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
