/* ===================================================================
   NABUNG KUY! - DESIGN SYSTEM & GLOBAL STYLES
   Inspired by ultra-sleek dark purple fintech wallet interface
   =================================================================== */

:root {
  /* Color Palette - Deep Dark Purple Theme */
  --bg-main: #0c0819;
  --bg-surface: #140e2b;
  --bg-card: #1c143d;
  --bg-card-hover: #261c4f;
  --bg-card-elevated: #241748;
  --bg-glass: rgba(28, 20, 61, 0.75);
  --border-subtle: rgba(140, 82, 255, 0.15);
  --border-focus: rgba(168, 85, 247, 0.6);
  --border-glow: rgba(157, 78, 221, 0.4);

  /* Primary Accent & Gradients */
  --accent-purple: #8c52ff;
  --accent-purple-light: #ab7bff;
  --accent-purple-glow: rgba(140, 82, 255, 0.35);
  --accent-neon: #a855f7;
  --grad-purple: linear-gradient(135deg, #7928ca 0%, #a855f7 50%, #d946ef 100%);
  --grad-card-1: linear-gradient(135deg, #44107a 0%, #291054 50%, #170b3b 100%);
  --grad-card-2: linear-gradient(135deg, #1f1b63 0%, #15113d 50%, #0d0926 100%);
  --grad-card-3: linear-gradient(135deg, #6b115a 0%, #3d0d3d 50%, #1a0826 100%);
  --grad-btn: linear-gradient(135deg, #8c52ff 0%, #b23bfd 100%);

  /* Functional Colors */
  --income-green: #00e676;
  --income-green-bg: rgba(0, 230, 118, 0.12);
  --income-green-glow: rgba(0, 230, 118, 0.3);
  --expense-red: #ff3366;
  --expense-red-bg: rgba(255, 51, 102, 0.12);
  --expense-red-glow: rgba(255, 51, 102, 0.3);
  --transfer-blue: #38bdf8;
  --transfer-blue-bg: rgba(56, 189, 248, 0.12);
  --warning-amber: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);

  /* Text Colors */
  --text-white: #ffffff;
  --text-primary: #f1f0f7;
  --text-secondary: #9d96b8;
  --text-muted: #6b6388;
  --text-dim: #4d466b;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Elevations & Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.55);
  --shadow-purple: 0 8px 30px rgba(140, 82, 255, 0.35);
  --shadow-glow: 0 0 25px rgba(140, 82, 255, 0.45);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(140, 82, 255, 0.35);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 82, 255, 0.7);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 82, 255, 0.35) transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glow Effects */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(140, 82, 255, 0.15) 0%, rgba(12, 8, 25, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px;
  right: -50px;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(194, 65, 238, 0.08) 0%, rgba(12, 8, 25, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* App Container Layout */
#app-root {
  min-height: 100vh;
  display: flex;
  position: relative;
  z-index: 1;
}

/* Auth Container (Fullscreen Glassmorphic) */
.auth-wrapper {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(121, 40, 202, 0.25) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.2) 0px, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(22, 15, 45, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg), var(--shadow-purple);
  text-align: center;
  animation: modalEnter 0.4s var(--transition-bounce);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-surface);
  border: 2.5px solid var(--accent-purple);
  margin-bottom: 16px;
  box-shadow: 0 0 25px var(--accent-purple-glow);
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 28px;
}

/* App Shell (Desktop vs Mobile) */
.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Desktop Sidebar */
.desktop-sidebar {
  display: none;
  width: 270px;
  background: rgba(18, 12, 38, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--accent-purple);
  box-shadow: 0 0 14px var(--accent-purple-glow);
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-white);
}

.brand-text span {
  font-size: 11px;
  color: var(--accent-purple-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-white);
  background: rgba(140, 82, 255, 0.1);
  border-color: rgba(140, 82, 255, 0.2);
}

.nav-link.active {
  color: var(--text-white);
  background: linear-gradient(135deg, rgba(140, 82, 255, 0.25) 0%, rgba(168, 85, 247, 0.15) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 16px rgba(140, 82, 255, 0.2);
}

.nav-link i, .nav-link svg {
  width: 20px;
  height: 20px;
}

.sidebar-user {
  margin-top: auto;
  padding: 14px;
  background: rgba(28, 20, 61, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7928ca, #ff0080);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 14px;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
}

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 8, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7928ca, #ff0080);
  border: 2px solid var(--accent-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
}

.header-user-greet span {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
}

.header-user-greet h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-white);
  border-color: var(--border-glow);
  background: var(--bg-card);
}

/* Page Views Container */
.content-area {
  flex: 1;
  padding: 20px 20px 100px 20px; /* bottom padding for mobile bar */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

/* Bottom Navigation Bar (Mobile) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(18, 12, 38, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px 14px 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
}

.bottom-nav-item.active {
  color: var(--text-white);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0px;
  width: 16px;
  height: 3px;
  background: var(--accent-purple);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px var(--accent-purple);
}

/* Elevated Floating Action Center Button */
.fab-center-btn {
  position: relative;
  top: -16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--grad-btn);
  border: 4px solid var(--bg-main);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-purple-glow), 0 0 12px rgba(168, 85, 247, 0.5);
  transition: var(--transition-bounce);
}

.fab-center-btn:hover, .fab-center-btn:active {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 28px var(--accent-purple-glow), 0 0 20px rgba(168, 85, 247, 0.7);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Desktop Responsive Layout */
@media (min-width: 992px) {
  .desktop-sidebar {
    display: flex;
  }
  .mobile-bottom-nav {
    display: none;
  }
  .mobile-header {
    padding: 20px 32px;
  }
  .content-area {
    padding: 28px 36px 40px 36px;
  }
}
