/* ============================================================
   THEME VARIABLES
   ============================================================ */
:root {
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Clean White Theme Colors */
  --bg-page: linear-gradient(135deg, #e0f2f1 0%, #ffffff 50%, #e1f5fe 100%);
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --bg-browser: #f0f2f5;

  --txt-title: #1a1a24;
  --txt-body: #4a4a5c;
  --txt-sub: #87879d;
  --txt-teal: #00897b;

  --clr-orange: #ff7043;
  --clr-orange-hover: #f4511e;
  --clr-chat: #374151;
  --clr-chat-hover: #1f2937;
  
  --brd-light: #eadddd;
  --brd-chat: #e5e7eb;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --dur-fast: 0.15s;
}

/* ============================================================
   GLOBAL RESETS
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--txt-body);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   BROWSER WINDOW MOCK
   ============================================================ */
.browser-window {
  width: 100%;
  max-width: 1200px;
  background: var(--bg-browser);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

.browser-header {
  background: #e0e0e0;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.browser-dots {
  display: flex;
  gap: 8px;
}

.browser-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cfd8dc;
}
.browser-dots span:nth-child(1) { background: #ff5f56; }
.browser-dots span:nth-child(2) { background: #ffbd2e; }
.browser-dots span:nth-child(3) { background: #27c93f; }

.browser-content {
  padding: 40px;
  background: #fafafc;
}

/* ============================================================
   DASHBOARD HEADER
   ============================================================ */
.dashboard-header {
  background: var(--bg-card);
  padding: 32px 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
  text-align: center;
}

.header-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--txt-teal);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--txt-title);
  margin-bottom: 12px;
}

.header-description {
  font-size: 1rem;
  color: var(--txt-sub);
}

/* ============================================================
   WIDGETS GRID (2x2)
   ============================================================ */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .widgets-grid { grid-template-columns: 1fr; }
  .browser-content { padding: 20px; }
  body { padding: 10px; }
}

/* ============================================================
   WIDGET CARDS
   ============================================================ */
.widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}

.widget:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--brd-light);
  padding-bottom: 12px;
}

.widget-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--txt-title);
}

.btn--refresh-orange {
  background: var(--clr-orange);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background var(--dur-fast);
}

.btn--refresh-orange:hover {
  background: var(--clr-orange-hover);
}

.btn--refresh-orange:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.widget-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   DATA LIST FORMAT
   ============================================================ */
.data-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none; /* For ul usage */
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.data-label {
  font-weight: 500;
  color: var(--txt-sub);
}

.data-value {
  font-weight: 600;
  color: var(--txt-title);
}

.plain-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--txt-body);
}

.mt-md { margin-top: 16px; }

/* ============================================================
   SPECIFIC WIDGET TWEAKS
   ============================================================ */
.citizen-avatar-wrap {
  text-align: center;
  margin-bottom: 16px;
}
.citizen-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e0e0e0;
}

.currency-list {
  padding: 0;
}

/* ============================================================
   SKELETONS
   ============================================================ */
.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.skeleton-wrap[hidden] {
  display: none !important;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 16px;
}

.skeleton--md { width: 70%; }
.skeleton--lg { width: 90%; }
.skeleton--avatar { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto 16px; }

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.widget-error {
  color: #d32f2f;
  font-size: 0.85rem;
  background: #ffebee;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

/* ============================================================
   CHATBOT TOGGLE (Rectangular)
   ============================================================ */
.chatbot-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chatbot-toggle-rect {
  background: var(--clr-chat);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform var(--dur-fast), background var(--dur-fast);
  display: flex;
  align-items: center;
  position: relative;
}

.chatbot-toggle-rect:hover {
  background: var(--clr-chat-hover);
  transform: translateY(-2px);
}

.notification-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: #ff5252;
  border-radius: 50%;
  border: 2px solid white;
}
.notification-dot.hidden { display: none; }

/* ============================================================
   CHATBOT WINDOW
   ============================================================ */
.chatbot-window {
  position: absolute;
  bottom: calc(100% + 16px);
  right: 0;
  width: 360px;
  height: 480px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid var(--brd-light);
}

.chatbot-window.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-header {
  background: var(--clr-chat);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-bot-name { font-weight: 600; font-family: var(--font-heading); }
.chat-bot-status { font-size: 0.75rem; opacity: 0.8; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 6px; height: 6px; background: #4ade80; border-radius: 50%; }

.chat-close-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.8;
}
.chat-close-btn:hover { opacity: 1; }

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9fafb;
}

.chat-msg {
  max-width: 85%;
  font-size: 0.9rem;
  line-height: 1.4;
}

.chat-msg--bot { align-self: flex-start; }
.chat-msg--user { align-self: flex-end; }

.chat-msg--bot .msg-bubble {
  background: white;
  color: var(--txt-title);
  border: 1px solid var(--brd-chat);
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
}

.chat-msg--user .msg-bubble {
  background: var(--clr-chat);
  color: white;
  border-radius: 12px 12px 2px 12px;
  padding: 10px 14px;
}

.msg-time {
  font-size: 0.65rem;
  color: var(--txt-sub);
  margin-top: 4px;
  text-align: right;
}
.chat-msg--bot .msg-time { text-align: left; }

.chat-suggestions {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--brd-chat);
  background: white;
}
.chat-suggestions::-webkit-scrollbar { display: none; }

.suggestion-chip {
  background: #f3f4f6;
  border: 1px solid var(--brd-chat);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  color: var(--txt-title);
  cursor: pointer;
  white-space: nowrap;
}
.suggestion-chip:hover {
  background: #e5e7eb;
}

.chat-input-area {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--brd-chat);
  background: white;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--brd-chat);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: none;
}
.chat-input:focus {
  outline: none;
  border-color: var(--clr-chat);
}

.chat-send-btn {
  background: var(--clr-chat);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator .msg-bubble {
  display: flex;
  gap: 4px;
  padding: 14px;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--txt-sub);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
