/* ==========================================================================
   Kelola Yuk - UI Components Stylesheet
   ========================================================================== */

/* --- Splash Screen Intro Animation --- */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fafbfc;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-content {
  text-align: center;
  animation: splashFadeSlideUp 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.splash-logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem auto;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  color: white;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px -4px rgba(13, 148, 136, 0.4);
}

.splash-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.splash-subtitle {
  font-size: 1.1rem;
  color: var(--primary-700);
  font-weight: 500;
}

.splash-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.splash-dot {
  width: 10px;
  height: 10px;
  background-color: var(--primary-400);
  border-radius: 50%;
  animation: splashPulse 1.4s infinite ease-in-out both;
}

.splash-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.splash-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes splashFadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  40% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  85% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
}

@keyframes splashPulse {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Public Top Navbar --- */
.navbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--neutral-600);
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-600);
}

/* --- Internal Sidebar Layout --- */
.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border-color);
  background-color: var(--card-bg);
  z-index: 90;
}

.sidebar-header {
  padding: 0 0.75rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--neutral-200);
  margin-bottom: 1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: var(--neutral-600);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.sidebar-item:hover {
  background-color: var(--primary-50);
  color: var(--primary-700);
}

.sidebar-item.active {
  background-color: var(--primary-500);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.sidebar-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-divider {
  height: 1px;
  background-color: var(--neutral-200);
  margin: 0.75rem 0;
}

.sidebar-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--neutral-200);
}

/* --- Buttons & Action Controls --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-600);
  color: white;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-700);
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1.5px solid var(--primary-600);
  color: var(--primary-600);
  background-color: transparent;
}

.btn-outline:hover {
  background-color: var(--primary-50);
}

.btn-secondary {
  background-color: var(--neutral-100);
  color: var(--neutral-700);
  border: 1px solid var(--neutral-200);
}

.btn-secondary:hover {
  background-color: var(--neutral-200);
}

.btn-danger {
  background-color: var(--accent-red);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

/* --- Cards & Panels --- */
.card {
  padding: 1.5rem;
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--neutral-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Financial Health Score Circular Gauge Card */
.health-score-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-50) 100%) !important;
  border: 1px solid rgba(13, 148, 136, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.75rem 2rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.health-score-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
}

.health-gauge-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.health-gauge-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.health-score-number {
  position: absolute;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--neutral-900);
}

.score-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.score-good {
  background-color: #dcfce7;
  color: #15803d;
}

.score-medium {
  background-color: #fef3c7;
  color: #b45309;
}

.score-bad {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* AI Spending Insight Card */
.ai-insight-card {
  background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%) !important;
  border: 1px solid var(--primary-200);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}

.ai-sparkle-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Stat Cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.stat-icon.red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.stat-icon.teal {
  background: var(--primary-100);
  color: var(--primary-700);
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--neutral-900);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- Form Controls --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--neutral-700);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  color: var(--text-main);
  transition: var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  color: var(--neutral-500);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--neutral-700);
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
  cursor: pointer;
}

/* 2FA 6-digit Code Input Grid */
.two-factor-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.two-factor-input {
  width: 100%;
  height: 52px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
}

.two-factor-input:focus {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* --- Badges & Progress Bars --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #e0f2fe;
  color: #075985;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--neutral-200);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.progress-fill-green {
  background-color: var(--accent-green);
}

.progress-fill-yellow {
  background-color: var(--accent-amber);
}

.progress-fill-red {
  background-color: var(--accent-red);
}

.progress-fill-teal {
  background-color: var(--primary-500);
}

/* --- Floating AI Chatbot Widget (4.7) --- */
.chatbot-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.chatbot-trigger-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
  transition: var(--transition-normal);
}

.chatbot-trigger-btn:hover {
  transform: scale(1.08);
}

.chatbot-panel {
  position: absolute;
  bottom: 75px;
  right: 0;
  width: 380px;
  height: 540px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: var(--transition-normal);
}

.chatbot-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.chatbot-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background-color: var(--neutral-50);
}

.chat-bubble {
  max-width: 82%;
  padding: 0.75rem 1rem;
  border-radius: 1.1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.chat-bubble.ai {
  align-self: flex-start;
  background-color: white;
  color: var(--neutral-800);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 0.2rem;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.user {
  align-self: flex-end;
  background-color: var(--primary-600);
  color: white;
  border-bottom-right-radius: 0.2rem;
}

.quick-reply-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.chip-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  background: white;
  border: 1px solid var(--primary-300);
  color: var(--primary-700);
  border-radius: 9999px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.chip-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}

.chatbot-footer {
  padding: 0.75rem;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
}

.chatbot-input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

/* --- Modals System --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Table styling */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--neutral-50);
}

.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.data-table tr:hover td {
  background-color: var(--primary-50);
}