/* ============================================
   NAVBAR - Purple Top Bar
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--primary-purple);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: var(--z-fixed);
}

.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-center {
  flex: 1;
  text-align: center;
}

.navbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-on-purple);
  margin: 0;
}

.navbar-icon {
  width: 100px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-purple);
  background: transparent;
  border: none;
  border-radius: var(--radius-small);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  font-size: 30px;
  -webkit-tap-highlight-color: transparent;
  font-weight: bolder;
}

#categoryModalTitle, .modal-title{
  font-size: 15px;
}

.navbar-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-icon:active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Add padding to body for fixed navbar */
body {
  padding-top: 60px;
}

/* ============================================
   SIDE MENU - Slides from Right
   ============================================ */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.side-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80%;
  background-color: var(--card-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: var(--z-modal);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.side-menu.active {
  transform: translateX(0);
}

.side-menu-header {
  background-color: var(--primary-purple);
  padding: 24px 20px;
  color: var(--text-on-purple);
}

.side-menu-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text-on-purple);
}

.side-menu-subtitle {
  font-size: 14px;
  margin: 0;
  opacity: 0.9;
  color: var(--text-on-purple);
}

.side-menu-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-menu-item {
  border-bottom: 1px solid var(--light-purple);
}

.side-menu-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 18px;
  transition: background-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.side-menu-link:hover {
  background-color: var(--light-purple);
  color: var(--text-dark);
}

.side-menu-link.active {
  background-color: var(--light-purple);
  color: var(--text-medium);
  font-weight: 600;
}

.side-menu-icon {
  font-size: 32px;
  color: var(--primary-purple);
  width: 32px;
  text-align: center;
}

.side-menu-text {
  flex: 1;  
}

.ko-fi-text{
  font-size: 15px;
}

/* ============================================
   MONTH SELECTOR
   ============================================ */
.month-selector {
  background-color: var(--card-bg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 60px;
  z-index: var(--z-sticky);
}

.month-selector-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  flex: 1;
  text-align: center;
}

.month-selector-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--primary-purple);
  font-size: 24px;
  cursor: pointer;
  border-radius: var(--radius-small);
  transition: background-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.month-selector-btn:hover {
  background-color: var(--light-purple);
}

.month-selector-btn:active {
  background-color: var(--primary-purple);
  color: var(--text-on-purple);
}

/* ============================================
   BALANCE BAR
   ============================================ */
.balance-bar {
  background-color: var(--light-purple);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
}

.balance-bar-left,
.balance-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-bar-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.balance-bar-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-on-purple);
}

.balance-bar-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-dark);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--radius-small);
  transition: background-color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.balance-bar-icon:hover {
  background-color: var(--primary-purple);
  color: var(--text-on-purple);
}

/* ============================================
   ACTION BUTTONS (+ and -)
   ============================================ */
.action-buttons {
  /* position: fixed;
  bottom: 80px;
  left: 0;
  right: 0; */
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 20px;
  pointer-events: none;
  z-index: var(--z-sticky);
}

.action-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-circle);
  border: 4px solid;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
}

.action-btn-expense {
  border-color: var(--error-red);
  color: var(--error-red);
}

.action-btn-expense:hover {
  background-color: var(--error-red);
  color: var(--text-on-purple);
  transform: scale(1.05);
}

.action-btn-expense:active {
  transform: scale(0.95);
}

.action-btn-income {
  border-color: var(--success-green);
  color: var(--success-green);
}

.action-btn-income:hover {
  background-color: var(--success-green);
  color: var(--text-on-purple);
  transform: scale(1.05);
}

.action-btn-income:active {
  transform: scale(0.95);
}

/* ============================================
   RECENT ACTIVITY DRAWER
   ============================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--card-bg);
  border-radius: var(--radius-large) var(--radius-large) 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: var(--z-modal);
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.drawer.active {
  transform: translateY(0);
}

.drawer-handle {
    width: 40px;
    /* height: 5px; */
    background-color: var(--text-light);
    border-radius: 3px;
    margin: 0px auto 0;
    cursor: grab;
}

.drawer-handle:active {
  cursor: grabbing;
}

.drawer-header {
  padding: 16px 20px;
  background-color: var(--light-purple);
  border-radius: var(--radius-large) var(--radius-large) 0 0;
}

.drawer-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background-color: var(--card-bg);
  padding: 20px;
  text-align: center;
  color: var(--text-medium);
  font-size: var(--font-small);
  border-top: 1px solid var(--light-purple);
}

.footer-text {
  margin: 0;
}

.footer-link {
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  color: var(--dark-purple);
  text-decoration: underline;
}

/* ============================================
   BOTTOM NAV (Mobile)
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: var(--card-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: var(--z-fixed);
  padding: 0 8px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  color: var(--text-medium);
  text-decoration: none;
  font-size: var(--font-tiny);
  transition: all var(--transition-fast);
  border-radius: var(--radius-small);
  flex: 1;
  max-width: 100px;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:hover {
  background-color: var(--light-purple);
  color: var(--primary-purple);
}

.bottom-nav-item.active {
  color: var(--primary-purple);
  font-weight: 600;
}

.bottom-nav-icon {
  font-size: 24px;
}

.bottom-nav-label {
  font-size: 11px;
  white-space: nowrap;
}

/* Add padding to body for bottom nav */
body.has-bottom-nav {
  padding-bottom: 70px;
}

/* ============================================
   DESKTOP ADJUSTMENTS
   ============================================ */
@media (min-width: 768px) {
  /* Hide bottom nav on desktop */
  .bottom-nav {
    display: none;
  }

  body.has-bottom-nav {
    padding-bottom: 0;
  }

  /* Sidebar navigation for desktop */
  .desktop-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 250px;
    background-color: var(--card-bg);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    z-index: var(--z-sticky);
  }

  .desktop-sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 16px;
    transition: all var(--transition-fast);
    border-left: 4px solid transparent;
  }

  .desktop-sidebar-item:hover {
    background-color: var(--light-purple);
    border-left-color: var(--primary-purple);
  }

  .desktop-sidebar-item.active {
    background-color: var(--primary-purple);
    color: var(--text-on-purple);
    border-left-color: var(--dark-purple);
    font-weight: 600;
  }

  .desktop-sidebar-icon {
    font-size: 24px;
    width: 24px;
    text-align: center;
  }

  /* Main content with sidebar */
  .main-content-with-sidebar {
    margin-left: 250px;
    padding: 40px;
    min-height: calc(100vh - 60px);
  }

  /* Action buttons positioned better on desktop */
  .action-buttons {
    bottom: 65px;
    gap: 60px;
  }

  .action-btn:hover {
    transform: scale(1.1) translateY(-4px);
  }

  /* Side menu wider on desktop */
  .side-menu {
    width: 400px;
  }

  /* Drawer modal style on desktop */
  .drawer {
    max-width: 600px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: var(--radius-large);
  }

  .drawer.active {
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .navbar,
  .side-menu,
  .action-buttons,
  .balance-bar,
  .bottom-nav,
  .drawer,
  .desktop-sidebar {
    display: none !important;
  }

  body {
    padding-top: 0;
    padding-bottom: 0;
  }

  .main-content-with-sidebar {
    margin-left: 0;
  }
}



/* ============================================
   SIDE MENU - BUY ME A COFFEE (CTA)
   ============================================ */

/* 1. Container Spacing */
.side-menu-item.ko-fi-item {
  border-bottom: none;       /* Remove the standard separator line */
  margin-top: 20px;          /* Push it down from other items */
  padding: 0 20px 20px 20px; /* Add padding around the button */
}

/* 2. The Gold Button Style */
.side-menu-link.ko-fi-link {
  /* Premium Gold Gradient */
  background: linear-gradient(135deg, #FFDD00 0%, #FBB03B 100%); 
  
  color: #4E342E !important; /* Dark Coffee Brown text (better than pure black) */
  font-weight: 800;          /* Extra bold text */
  border-radius: 50px;       /* "Pill" shape (fully round corners) */
  
  /* Center the content */
  justify-content: center;
  padding: 14px 20px;
  
  /* Soft Glow Shadow */
  box-shadow: 0 4px 15px rgba(251, 176, 59, 0.4); 
  border: 2px solid #fff;    /* White border makes it pop off the background */
}

/* 3. The Coffee Icon specific style */
.side-menu-link.ko-fi-link .side-menu-icon {
  color: #4E342E;  /* Match the text color, override the default purple */
  font-size: 22px; 
  width: auto;     /* Remove fixed width to center perfectly */
  margin-right: 0;
}

/* 4. Hover Animation */
.side-menu-link.ko-fi-link:hover {
  transform: translateY(-3px); /* Lifts up slightly */
  box-shadow: 0 8px 25px rgba(251, 176, 59, 0.5); /* Shadow grows */
  background: linear-gradient(135deg, #ffe544 0%, #ffc107 100%); /* Gets brighter */
}

/* 5. Click/Active State */
.side-menu-link.ko-fi-link:active {
  transform: scale(0.97); /* Subtle press effect */
  box-shadow: 0 2px 8px rgba(251, 176, 59, 0.3);
}


/* ============================================
   RESPONSIVE COFFEE BUTTON
   ============================================ */

/* 1. Mobile Styles (Default) */
.navbar-coffee {
    text-decoration: none;
    width: 40px !important; /* Force square on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
}

.coffee-text {
    display: none; /* Hidden on mobile */
}

.coffee-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

/* 2. Desktop/Tablet Styles (Show Text) */
@media (min-width: 768px) {
    .navbar-coffee {
        width: auto !important; /* Allow width to grow for text */
        padding: 0 16px;        /* Add padding like a button */
        gap: 8px;               /* Space between cup and text */
        background-color: rgba(255, 255, 255, 0.15) !important; /* Glass effect */
        border-radius: 50px;    /* Pill shape */
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }

    .coffee-text {
        display: inline-block; /* Show text */
        font-size: 14px;
        font-weight: 600;
        color: #fff;           /* White text on purple header */
        white-space: nowrap;   /* Prevent text wrapping */
    }

    /* Hover effect on Desktop */
    .navbar-coffee:hover {
        background-color: #FFDD00 !important; /* Gold background */
        transform: translateY(-2px);
    }
    
    .navbar-coffee:hover .coffee-text {
        color: #000; /* Black text on Gold background */
    }
}


