/* =========================================================
   HR AI Demo — Custom Styles
   Only new styles here. Never override DashLite core CSS.
   ========================================================= */

/* --- CSS Custom Properties ----------------------------- */
:root {
  --hr-primary:   #1a3a5c;
  --hr-accent:    #2e6da4;
  --hr-success:   #1a7a4a;
  --hr-warning:   #b85c00;
  --hr-danger:    #a32d2d;
  --hr-ai-border: #2e6da4;
  --chat-bg:      #f8f9fc;
  --chat-bot-bg:  #e8f0fa;
  --chat-user-bg: #2e6da4;
  --chat-width:   320px;
}

/* --- Role Selector Cards (index.html) ------------------ */
.hr-role-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-top: 4px solid var(--hr-accent);
}

.hr-role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(46, 109, 164, 0.18);
}

.hr-role-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hr-primary), var(--hr-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.hr-role-icon em {
  font-size: 28px;
  color: #fff;
}

/* --- Stat Cards ---------------------------------------- */
.hr-stat-card {
  border-right: 4px solid var(--hr-accent);
}

.hr-stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--hr-primary);
  line-height: 1.2;
}

.hr-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hr-stat-icon em {
  font-size: 20px;
}

/* --- Page Header Block --------------------------------- */
.hr-page-header {
  padding: 20px 0 12px;
  border-bottom: 1px solid #e5e9f2;
  margin-bottom: 24px;
}

.hr-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--hr-primary);
  margin-bottom: 4px;
}

.hr-page-subtitle {
  font-size: 13px;
  color: #8094ae;
}

/* --- Quick Action Buttons ------------------------------ */
.hr-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.hr-quick-actions .btn {
  font-size: 13px;
}

/* --- AI Analysis Box ----------------------------------- */
.hr-ai-box {
  background: #fff;
  border-radius: 8px;
  border-right: 4px solid var(--hr-ai-border);
  padding: 20px 20px 20px 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.hr-ai-box-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--hr-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hr-ai-box-content {
  font-size: 14px;
  color: #526484;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* --- Chatbot Toggle Button ----------------------------- */
.chatbot-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hr-primary), var(--hr-accent));
  border: none;
  box-shadow: 0 4px 16px rgba(46, 109, 164, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  transition: transform 0.2s ease;
}

.chatbot-toggle:hover {
  transform: scale(1.08);
}

.chatbot-toggle em {
  font-size: 22px;
  color: #fff;
}

.chatbot-toggle .badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* --- Chatbot Panel ------------------------------------- */
.chatbot-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--chat-width);
  height: 100vh;
  background: #fff;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(-110%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-panel.is-open {
  transform: translateX(0);
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--hr-primary), var(--hr-accent));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chatbot-name {
  font-size: 14px;
  font-weight: 600;
}

.chatbot-status {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
}

.chatbot-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.chatbot-close:hover {
  color: #fff;
}

.chatbot-close em {
  font-size: 18px;
}

/* Chatbot Messages Area */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--chat-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.chat-bubble.bot {
  background: var(--chat-bot-bg);
  color: #364a63;
  align-self: flex-start;
  border-bottom-right-radius: 4px;
}

.chat-bubble.user {
  background: var(--chat-user-bg);
  color: #fff;
  align-self: flex-end;
  border-bottom-left-radius: 4px;
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: var(--chat-bot-bg);
  border-radius: 12px;
  border-bottom-right-radius: 4px;
  align-self: flex-start;
  max-width: 70px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: #8094ae;
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-6px); }
}

/* Chatbot Quick Actions */
.chatbot-quick-actions {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e9f2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.chatbot-quick-actions .btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* Chatbot Input Row */
.chatbot-input-row {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e9f2;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chatbot-input-row input {
  flex: 1;
  border: 1px solid #dbdfea;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  outline: none;
  background: var(--chat-bg);
  text-align: right;
  direction: rtl;
}

.chatbot-input-row input:focus {
  border-color: var(--hr-accent);
}

.chatbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hr-accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.chatbot-send-btn:hover {
  background: var(--hr-primary);
}

.chatbot-send-btn em {
  font-size: 16px;
}

/* Overlay backdrop when chatbot open */
.chatbot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.chatbot-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* --- Chart container ----------------------------------- */
.hr-chart-wrap {
  position: relative;
  height: 240px;
}

/* --- At-risk table status badges ---------------------- */
.badge-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.badge-status.critical  { background: #fde8e8; color: var(--hr-danger); }
.badge-status.warning   { background: #fff3e0; color: var(--hr-warning); }
.badge-status.ok        { background: #e8f5ee; color: var(--hr-success); }

/* --- Text Logo ----------------------------------------- */
.hr-logo-text {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  text-decoration: none;
}

.hr-logo-text em {
  font-size: 22px;
  color: #ffffff;
}

.hr-logo-text span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  white-space: nowrap;
}
