/* ----------------- General Styles ----------------- */
body {
  background-color: #f5f5f5;
  color: #222;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* ----------------- Header (Full Width) ----------------- */
header {
  width: 100%;
  padding: 15px;
  text-align: center;
  background-color: #2196F3;
  color: white;
  position: fixed;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  
}

/* ----------------- Theme Toggle ----------------- */
.theme-switch {
  position: absolute;
  top: 50%;
  right: 100px;
  transform: translateY(-50%);
  z-index: 11;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 8px 12px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  
}

.theme-switch:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ----------------- Main Content ----------------- */
main {
  padding-top: 80px; /* Added space for fixed header */
  padding-bottom: 80px; /* Increased space for bottom nav */
  min-height: calc(100vh - 160px); /* Ensure content fills screen */
}

section {
  max-width: 500px;
  margin: 15px auto;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  margin-top: 70px;
}

/* ----------------- Bottom Navigation (Full Width) ----------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #e0e0e0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #ccc;
  padding: 12px 0;
  border-radius: 15px 15px 0 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
  z-index: 100;
  min-height: 60px;
  box-sizing: border-box;
}

/* ----------------- Tab Buttons ----------------- */
.tab-btn {
  background: none;
  border: none;
  padding: 10px 15px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
}

.tab-btn.active {
  background-color: #2196F3;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.tab-btn:hover:not(.active) {
  background-color: rgba(33, 150, 243, 0.1);
  color: #2196F3;
}

/* Add icons or text labels for better UX */
.tab-btn::after {
  content: attr(data-label);
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.7;
}

.tab-btn.active::after {
  opacity: 1;
}

/* ----------------- Tabs ----------------- */
.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* ----------------- Inputs & Buttons ----------------- */
input, button {
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

button {
  background-color: #2196F3;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #1976D2;
}

/* ----------------- Budget Suggestion ----------------- */
.budget-suggestion {
  background: #e8f0fe;
  padding: 15px;
  border-radius: 8px;
  margin-top: 10px;
  font-style: italic;
  border-left: 4px solid #2196F3;
}

/* ----------------- Expense List ----------------- */
#expense-list {
  list-style: none;
  padding: 0;
}

#expense-list li {
  background: #f9f9f9;
  margin: 8px 0;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #2196F3;
}

/* ----------------- Filter Buttons ----------------- */
.filter-btn {
  background-color: #e0e0e0;
  color: #222;
  margin: 5px;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn.active {
  background-color: #2196F3;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.3);
}

.filter-btn:hover:not(.active) {
  background-color: #d0d0d0;
}

/* ----------------- Chart ----------------- */
#chart {
  max-width: 100%;
  height: auto !important;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
}

/* ----------------- Popup Overlay ----------------- */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#popup-overlay .popup {
  background-color: #fff;
  color: #222;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* ----------------- Auth Section ----------------- */
#auth-section {
  max-width: 400px;
  margin: auto;
  padding: 25px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  header h1 {
    font-size: 22px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .theme-switch {
    font-size: 12px;
    padding: 6px 10px;
    flex-shrink: 0;
  }

  header {
    padding: 12px 15px;
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* pushes heading left, toggle right */
    padding: 12px 15px;
  }

  .theme-switch {
    position: static; /* remove absolute positioning */
    transform: none;
    margin: 0;
  }
}


/* ----------------- Dark Mode ----------------- */
body.dark-mode {
  background-color: #121212;
  color: #eee;
}

body.dark-mode header {
  background: #1f1f1f;
}

body.dark-mode .theme-switch {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #eee;
}

body.dark-mode .theme-switch:hover {
  background: rgba(0, 0, 0, 0.5);
}

body.dark-mode section {
  background: #1e1e1e;
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.05);
}

body.dark-mode .bottom-nav {
  background: #1e1e1e;
  border-top: 1px solid #333;
}

body.dark-mode .tab-btn {
  color: #ccc;
   border: none;
  box-shadow: none;
  background-color: transparent; /* keeps same dark bg as nav */
}

body.dark-mode .tab-btn.active {
  background-color: transparent; /* keeps same dark bg as nav */
  color: #03dac6; /* icon still highlighted with color */
  box-shadow: none;
}

body.dark-mode .tab-btn:hover:not(.active) {
  background-color: rgba(3, 218, 198, 0.1);
  color: #03dac6;
}

body.dark-mode input,
body.dark-mode button {
  background-color: #333;
  color: #eee;
  border: 1px solid #555;
}

body.dark-mode button:hover {
  background-color: #03dac6;
  color: #000;
}

body.dark-mode .filter-btn {
  background-color: #333;
  color: #eee;
}

body.dark-mode .filter-btn.active {
  background-color: #03dac6;
  color: #000;
}

body.dark-mode .filter-btn:hover:not(.active) {
  background-color: #444;
}

body.dark-mode .budget-suggestion {
  background: #2a2a2a;
  border-left-color: #03dac6;
}

body.dark-mode #expense-list li {
  background: #333;
  border-left-color: #03dac6;
}

body.dark-mode #popup-overlay .popup {
  background-color: #222;
  color: #eee;
}

body.dark-mode #auth-section {
  background: #1e1e1e;
}


