/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --font-title: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;

  --bg-color: #08080f;
  --text-primary: #f8f9fa;
  --text-secondary: #a0aec0;
  
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --accent-color: #7c4dff;
  --accent-glow: rgba(124, 77, 255, 0.3);
  --success-color: #00e676;
  --warning-color: #ffd600;
  --error-color: #ff1744;

  --gradient-title: linear-gradient(135deg, #f8f9fa 30%, #a29bfe 100%);
  --gradient-accent: linear-gradient(135deg, #7c4dff 0%, #18a5e0 100%);
  --gradient-violet: linear-gradient(135deg, #7c4dff 0%, #b388ff 100%);
  --gradient-green: linear-gradient(135deg, #00e676 0%, #b9f6ca 100%);
  --gradient-amber: linear-gradient(135deg, #ffc400 0%, #ffe57f 100%);
  --gradient-cyan: linear-gradient(135deg, #00e5ff 0%, #80deea 100%);
  --gradient-rose: linear-gradient(135deg, #ff4081 0%, #ff80ab 100%);
  --gradient-emerald: linear-gradient(135deg, #00bfa5 0%, #00e5ff 100%);
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Ambient glow blobs in the background */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.45;
  pointer-events: none;
}
.bg-glow-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-color);
  top: -100px;
  right: -50px;
}
.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: #0055ff;
  bottom: 10%;
  left: -150px;
}
.bg-glow-3 {
  width: 350px;
  height: 350px;
  background: #b388ff;
  top: 40%;
  right: 15%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
  flex-grow: 1;
}

/* ==========================================================================
   GLASSMORPHISM BASE
   ========================================================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

h1 {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  background: var(--gradient-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ==========================================================================
   PROFILE CARD
   ========================================================================== */
.profile-card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: 50px;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  object-fit: cover;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-email {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   BADGES & BUTTONS
   ========================================================================== */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.badge-active {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.badge-pending {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-warning {
  background: rgba(255, 214, 0, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(255, 214, 0, 0.2);
}

.badge-success {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 77, 255, 0.5);
}

.btn-login-glow {
  position: relative;
}
.btn-login-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-accent);
  border-radius: 50px;
  z-index: -1;
  opacity: 0.4;
  filter: blur(6px);
  transition: opacity 0.3s;
}
.btn-login-glow:hover::after {
  opacity: 0.8;
}

.btn-icon {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 50%;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   WARNING BANNER
   ========================================================================== */
.warning-banner {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
  margin-bottom: 40px;
  border-left: 4px solid var(--warning-color);
  background: rgba(255, 214, 0, 0.03);
}

.warning-icon {
  font-size: 1.5rem;
}

.warning-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--warning-color);
  margin-bottom: 2px;
}

.warning-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.highlight-link {
  color: var(--text-primary);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}
.highlight-link:hover {
  color: var(--accent-color);
}

/* ==========================================================================
   LIVE OVERVIEW (STATS)
   ========================================================================== */
.overview-section {
  margin-bottom: 48px;
  animation: fadeIn 0.8s ease-out;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 28px;
  height: 2.5px;
  background: var(--accent-color);
  border-radius: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  padding: 24px;
  gap: 20px;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--glass-bg-hover);
}

.stat-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}

.icon-budget { color: #b388ff; background: rgba(124, 77, 255, 0.1); }
.icon-grocery { color: #00e676; background: rgba(0, 230, 118, 0.1); }
.icon-zakat { color: #ffc400; background: rgba(255, 196, 0, 0.1); }
.icon-baby { color: #f48fb1; background: rgba(244, 143, 177, 0.1); }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-title);
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   APPLICATION LAUNCHER GRID
   ========================================================================== */
.launcher-section {
  margin-bottom: 60px;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

/* App Cards */
.app-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 28px;
  min-height: 250px;
  cursor: pointer;
}

.app-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
  box-shadow: 0 12px 40px rgba(124, 77, 255, 0.15);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.app-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Gradients for icons */
.bg-violet-gradient { background: var(--gradient-violet); }
.bg-green-gradient { background: var(--gradient-green); }
.bg-amber-gradient { background: var(--gradient-amber); }
.bg-cyan-gradient { background: var(--gradient-cyan); opacity: 0.6; }
.bg-cyan-active { background: var(--gradient-cyan); }
.bg-rose-gradient { background: var(--gradient-rose); opacity: 0.6; }
.bg-rose-active { background: var(--gradient-rose); }
.bg-emerald-gradient { background: var(--gradient-emerald); opacity: 0.6; }
.bg-emerald-active { background: var(--gradient-emerald); }

.app-body {
  flex-grow: 1;
}

.app-body h3 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.app-body p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.3s, transform 0.3s;
}

.app-card:hover .app-footer {
  color: var(--text-primary);
}

.app-card:hover .app-footer svg {
  transform: translateX(4px);
}

.app-footer svg {
  transition: transform 0.3s ease;
}

/* Pending Folder Drop State Card */
.app-card-pending {
  cursor: default;
  opacity: 0.55;
  border-style: dashed;
}
.app-card-pending:hover {
  transform: none;
  box-shadow: var(--glass-shadow);
  border-color: var(--glass-border);
  background: var(--glass-bg);
}
.app-card-pending .app-footer {
  font-size: 0.75rem;
  font-weight: 400;
  text-align: center;
  display: block;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-credit {
  text-align: center;
  padding: 30px 24px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--glass-border);
  width: 100%;
}

/* ==========================================================================
   ANIMATIONS & RESPONSIVE
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  h1 {
    font-size: 2.2rem;
  }
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .container {
    padding: 24px 16px;
  }
}

/* ==========================================================================
   COMPACT LAYOUT OVERRIDES
   ========================================================================== */
body.compact-layout {
  font-size: 0.9rem;
}

body.compact-layout .container {
  padding: 24px 20px;
}

body.compact-layout .dashboard-header {
  margin-bottom: 24px;
}

body.compact-layout .section-title {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

body.compact-layout .overview-section {
  margin-bottom: 24px;
}

/* Compact Stats Grid */
body.compact-layout .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

body.compact-layout .stat-card {
  padding: 12px 16px;
  gap: 12px;
}

body.compact-layout .stat-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

body.compact-layout .stat-value {
  font-size: 1.3rem;
}

body.compact-layout .stat-label {
  font-size: 0.7rem;
  margin-bottom: 2px;
}

body.compact-layout .stat-desc {
  font-size: 0.7rem;
}

/* Compact Launcher Grid */
body.compact-layout .launcher-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

body.compact-layout .app-card {
  min-height: auto;
  padding: 14px 16px;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

body.compact-layout .app-card .app-header {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.compact-layout .app-card .app-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

body.compact-layout .app-card .badge {
  display: none; /* Hide badges in compact mode */
}

body.compact-layout .app-card .app-body {
  flex-grow: 1;
}

body.compact-layout .app-card .app-body h3 {
  font-size: 1rem;
  margin-bottom: 0;
}

body.compact-layout .app-card .app-body p {
  display: none; /* Hide descriptions */
}

body.compact-layout .app-card .app-footer {
  display: none; /* Hide footer */
}

/* Customize Overview Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}


