:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4895ef;
  --danger-color: #f72585;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --white: #ffffff;
  --income-color: #2ecc71;
  --expense-color: #e74c3c;
  --balance-color: #3498db;
   --btn-color: #2a9400;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f5f5f5;
  color: var(--dark-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-container {
  max-width: 100%;
  margin: 0 auto;
  background-color: var(--white);
  min-height: 100vh;
  position: relative;
  padding-bottom: 60px;
  overflow-x: hidden;
}

.app-header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 15px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


.header-content h1 {
  font-size: 1.5rem;
  font-weight: 500;
}

.header-actions button {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
}

.back-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  margin-right: 10px;
  cursor: pointer;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 15px;
}

.card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: var(--white);
}

.card.balance .card-icon {
  background-color: var(--balance-color);
}

.card.income .card-icon {
  background-color: var(--income-color);
}

.card.expense .card-icon {
  background-color: var(--expense-color);
}

.card-info h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-color);
  margin-bottom: 5px;
}

.card-info p {
  font-size: 1.1rem;
  font-weight: 700;
}

.transactions-container {
  padding: 15px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.section-header h2 {
  font-size: 1.2rem;
  font-weight: 500;
}

.view-all {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.transaction-item {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
 transition: transform 0.2s ease-out;
}

.transaction-item:hover {
  transform: translateY(-2px);
}

.transaction-info {
  display: flex;
  align-items: center;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  color: var(--white);
}

.transaction-icon.income {
  background-color: var(--income-color);
}

.transaction-icon.expense {
  background-color: var(--expense-color);
}

.transaction-details h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 5px;
}

.transaction-details p {
  font-size: 0.8rem;
  color: var(--gray-color);
}

.transaction-amount {
  font-weight: 700;
}

.transaction-amount.income {
  color: var(--income-color);
}

.transaction-amount.expense {
  color: var(--expense-color);
}

.fab-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 99;
}

.fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.fab:hover {
  background-color: var(--secondary-color);
  transform: scale(1.1);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--white);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--gray-color);
  font-size: 0.8rem;
}

.nav-item i {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.nav-item.active {
  color: var(--primary-color);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--white);
  margin: 20px auto;
  width: 90%;
  max-width: 500px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
      opacity: 0;
      transform: translateY(-20px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}

.modal-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 500;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-color);
}

.modal-body {
  padding: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
}


.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.btn-primary-pdf,
.btn-primary-csv {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    color: white;
    cursor: pointer;
    text-align: center;
}

.btn-primary-pdf {
    background-color: #b00000;
    margin-right: 0.5rem;
}

.btn-primary-pdf i {
    margin-right: 0.5rem;
}

.btn-primary-csv {
    background-color: #217345;
    margin-left: 0.5rem;
}

.btn-primary-csv i {
    margin-right: 0.5rem;
}

.btn-small {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 8px 15px;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-small:hover {
  background-color: var(--secondary-color);
}

.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.loading-spinner i {
  font-size: 2rem;
  color: var(--primary-color);
}

.tabs {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.tab-btn {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: var(--gray-color);
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.categories-list {
  list-style: none;
  margin-bottom: 15px;
}

.categories-list li {
  padding: 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.add-category-form {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.add-category-form input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

.delete-category-btn {
  background-color: var(--danger-color);
  color: var(--white);
  border: none;
  padding: 5px 10px;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.8rem;
}

.report-filters {
  padding: 15px;
  background-color: var(--white);
  margin-bottom: 15px;
  box-shadow: var(--shadow);
}

.filter-group {
  margin-bottom: 15px;
}

.filter-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

.hidden {
  display: none;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 15px;
}

.summary-card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 15px;
  box-shadow: var(--shadow);
  text-align: center;
}

.summary-card h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-color);
  margin-bottom: 5px;
}

.summary-card p {
  font-size: 1.1rem;
  font-weight: 700;
}

.chart-container {
  padding: 15px;
  background-color: var(--white);
  margin: 15px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .summary-cards {
      grid-template-columns: 1fr;
  }
  
  .card {
      margin-bottom: 10px;
  }
  
  .report-summary {
      grid-template-columns: 1fr;
  }
}







/* Make the transaction item a flex container */
.transaction-item {
    display: flex;
    justify-content: space-between;
}

.transaction-info {
    display: flex;
    flex: 1; /* Grow to fill available space */
    overflow: hidden; /* Prevent excessive growth */
}

.transaction-details {
    flex: 1;
    min-width: 0; /* Allow text to wrap within flex child */
}

.transaction-details .description {
    word-wrap: break-word; /* Break long words if needed */
    white-space: normal; /* Allow wrapping */
    overflow: hidden; /* Hide excess if height is constrained */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 10; /* Limit to 2 lines */
}