/* ============================================================
   ARUJA Design System v1.0
   AI Powered Property Marketing Platform
   Vibrant Full Light Theme (Colorful Edition)
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Primary Palette - Vibrant Indigo/Violet */
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Accent - Hot Pink/Rose */
  --accent-50: #fff1f2;
  --accent-100: #ffe4e6;
  --accent-400: #fb7185;
  --accent-500: #f43f5e;
  --accent-600: #e11d48;

  /* Success - Vibrant Emerald */
  --success-400: #34d399;
  --success-500: #10b981;
  --success-600: #059669;

  /* Warning - Amber */
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  /* Danger - Rose */
  --danger-500: #f43f5e;

  /* Info - Sky Blue */
  --info-400: #38bdf8;
  --info-500: #0ea5e9;

  /* Neutral - Blue Gray */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* Surface Colors (Ultra Premium Light) */
  --surface-bg: #f8fafc;
  --surface-card: #ffffff;
  --surface-card-hover: #ffffff;
  --surface-elevated: #ffffff;
  --surface-border: rgba(0, 0, 0, 0.04);
  --surface-border-hover: rgba(0, 0, 0, 0.08);

  /* Glass Effect (Colorful) */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 12px;

  /* Text Colors */
  --text-primary: #1e1b4b;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-accent: #8b5cf6;

  /* Gradients - "Warna Warni" */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --gradient-accent: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-info: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  --gradient-sidebar: linear-gradient(180deg, #4338ca 0%, #6366f1 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f5f3ff 100%);
  --gradient-hero: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);

  /* Shadows (Multi-layered for realism) */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 6px -1px rgba(99, 102, 241, 0.05), 0 2px 4px -1px rgba(99, 102, 241, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(99, 102, 241, 0.08), 0 4px 6px -2px rgba(99, 102, 241, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(99, 102, 241, 0.1), 0 10px 10px -5px rgba(99, 102, 241, 0.04);
  --shadow-xl: 0 35px 60px -15px rgba(99, 102, 241, 0.2);
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.3);

  /* Border Radius - More Rounded for Modern Look */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Spacing - Increased for more whitespace */
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 36px;
  --space-8: 48px;
  --space-10: 64px;
  --space-12: 80px;
  --space-16: 120px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Transitions - Smoother Cubic Bezier */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 70px;
}

/* --- CSS Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--primary-400); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-300); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--text-accent); }
.text-success { color: var(--accent-500); }
.text-warning { color: var(--warning-500); }
.text-danger { color: var(--danger-500); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }

.d-flex { display: flex; }
.d-grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Component: Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 30px rgba(99,102,241,0.4); color: #fff; }

.btn-accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-glow-accent);
}
.btn-accent:hover { filter: brightness(1.1); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--primary-400);
  border: 1px solid var(--primary-500);
}
.btn-outline:hover { background: var(--primary-50); color: var(--primary-600); }

.btn-danger {
  background: var(--danger-500);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-600); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--surface-border);
}
.btn-ghost:hover { background: var(--primary-50); color: var(--primary-600); }

.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); }
.btn-icon { padding: 10px; }
.btn-block { width: 100%; }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
}
.btn-whatsapp:hover { background: #1da851; color: #fff; }

/* --- Component: Cards --- */
.card {
  background: var(--surface-card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}
.card:hover {
  border-color: var(--surface-border-hover);
  box-shadow: var(--shadow-lg);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--surface-border);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  font-family: var(--font-display);
}

/* --- Component: Stat Card --- */
.stat-card {
  background: var(--gradient-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 0 0 0 100%;
  opacity: 0.1;
  transition: opacity var(--transition-base);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { opacity: 0.2; }

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
}
.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-1);
}
.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.stat-primary .stat-icon { background: rgba(99,102,241,0.15); color: var(--primary-400); }
.stat-primary::before { background: var(--primary-500); }
.stat-accent .stat-icon { background: rgba(16,185,129,0.15); color: var(--accent-400); }
.stat-accent::before { background: var(--accent-500); }
.stat-warning .stat-icon { background: rgba(245,158,11,0.15); color: var(--warning-400); }
.stat-warning::before { background: var(--warning-500); }
.stat-danger .stat-icon { background: rgba(244,63,94,0.15); color: var(--danger-400); }
.stat-danger::before { background: var(--danger-500); }

/* --- Component: Form Controls --- */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}
.form-control:focus {
  background: #ffffff;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}
.form-control::placeholder { color: var(--text-tertiary); }

textarea.form-control { min-height: 100px; resize: vertical; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* --- Component: Table --- */
.table-responsive { overflow-x: auto; border-radius: var(--radius-lg); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: var(--primary-50);
  border-bottom: 1px solid var(--surface-border);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--primary-50); }

/* --- Component: Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.badge-primary { background: rgba(99,102,241,0.15); color: var(--primary-400); }
.badge-accent { background: rgba(16,185,129,0.15); color: var(--accent-400); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning-400); }
.badge-danger { background: rgba(244,63,94,0.15); color: var(--danger-400); }
.badge-info { background: rgba(14,165,233,0.15); color: var(--info-400); }

/* --- Component: Avatar --- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--surface-border);
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

/* --- Component: Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn var(--transition-base);
}
.modal-backdrop.active { display: flex; }

.modal {
  background: #ffffff;
  border: none;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp var(--transition-base);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--surface-border);
}
.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--surface-border);
}

/* --- Component: Toast --- */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.toast {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  animation: slideInRight var(--transition-base);
  box-shadow: var(--shadow-xl);
}
.toast-success { background: var(--accent-600); color: #fff; }
.toast-error { background: var(--danger-600); color: #fff; }
.toast-info { background: var(--info-500); color: #fff; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Grid System --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-700); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-600); }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
}
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-tertiary);
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}
.empty-state h4 { color: var(--text-secondary); margin-bottom: var(--space-2); }
