/* Default light theme */
body[data-theme="light"] {
  --bg-color: #ffffff;
  --text-color: #222;
  --card-bg: #f5f5f5;
  --hv-color:#F9FAfB;
}

/* Dark theme */
body[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #fff;
  --card-bg: #2a2a2a;
  --hv-color: #6B7280; 
}

.no-transactions {
  text-align: center;
  padding: 24px;
  color: #6B7280;
  font-size: 16px;
}

.no-transactions .add-link {
  display: inline-block;
  margin-top: 8px;
  color: #2563EB;
  font-weight: 500;
  text-decoration: none;
  transition: 0.3s;
}

.no-transactions .add-link:hover {
  text-decoration: underline;
}


.dashboard-content {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 20px;
	margin: 24px 0 0 0;
}

.dashboard-details {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px;
	background: var(--bg-color);
	border-radius: 5px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.01), 
	            0 1px 1px rgba(0, 0, 0, 0.08);
}

.dashboard-details:nth-child(2) {
	color: #16A34A;
}

.dashboard-details:nth-child(3) {
	color: #DC2626;
}

.dashboard-text {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dashboard-text h1 {
	font-size: 24px;
}

.dashboard-text p {
	color: #6B7280;
	font-size: 14px;
}

.dashboard-icon-balance {
	width: 48px;
	height: 48px;
	padding: 12px;
	background: #DBEAFE;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #2563EB;
}
.dashboard-icon-income {
	width: 48px;
 	height: 48px;
 	padding: 12px;
 	background: #DCFCE7;
 	border-radius: 50%;
 	display: flex;
 	align-items: center;
 	justify-content: center;
 	color: #16A34A;
}

.dashboard-icon-expenses {
	width: 48px;
 	height: 48px;
 	padding: 12px;
 	background: #FEE2E2;
 	border-radius: 50%;
 	display: flex;
 	align-items: center;
 	justify-content: center;
 	color: #DC2626;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  overflow-x: hidden; /* Prevents sideways scroll */
}

.chart-content {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  overflow: hidden;
}

.chart-content h2 {
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--text-color);
  text-align: center;
}

/* Wrap each chart properly */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px; /* sets base height */
  max-width: 100%;
  overflow: hidden;
}

/* Let canvas fill container */
.chart-wrapper canvas,
#weeklyChart,
#categoryChart {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
}


.recent-transactions {
 	padding: 24px;
 	margin: 24px 0 0;
 	background: var(--bg-color);
 	border-radius: 5px;
}

.recent-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.recent-header h2 {
	font-size: 18px;
	color: var(--text-color);
}

.recent-header a {
	text-decoration: none;
	color: #2563EB;
}

.link-button {
  background: none;
  border: none;
  color: #2563EB;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  padding: 0;
  font-size: 14px;
}


.transaction-content {
	display: flex;
	gap: 20px;
	align-items: center;
}

.transaction-indicator {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.transaction-indicator span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}
.medical {
	background: #F9731620;
}
.medical i {
	color: #F97316;
}

.entertainment {
	background: #8B5CF620;
}
.entertainment i {
	color: #8B5CF6;
}

.income {
	background: #22C55E20;
}
.income i {
	color: #22C55E;
}

.gym {
	background: #EF444420;
}
.gym i {
	color: #EF4444;
}

.food {
	background: #EC489920;
}
.food i {
	color: #EC4899;
}

.groceries {
	background: #F59E0B20;
}

.groceries i {
	color: #F59E0B;
}

.shopping {
	background: #14B8A620;
}
.shopping i {
	color: #14B8A6;
}

.transport, 
.travel {
	background: #6366F120;
}
.transport i, 
.travel i {
	color: #6366F1;
}

.utility {
	background: #3B82F620;
}
.utility i {
	color: #3B82F6;
}

.others {
	background: #999E0B20;
}

.others i {
	color: #999E0B;
}


.transaction-details-dashboard {
	display: flex;
	flex-direction: column;
	gap: 15px;
}


.transaction-details-dashboard p {
   	font-size: 16px;
   	color: var(--text-color);
   	font-weight: 500;
}

.transaction-details-dashboard span {
   	font-size: 12px;
   	color: var(--text-color);
}

.transaction-list {
   	display: flex;
   	justify-content: space-between;
   	align-items: center;
   	padding: 12px;
   	margin: 16px 0 0;
   	border-radius: 6px;
}

.transaction-list:hover {
	background: var(--hv-color);
}

.debit-transaction-amount {
   	color: #DC2626;
   	font-weight: 500;
 }

 .credit-transaction-amount {
 	color: #16A34A;
 	font-weight: 500;
 }

 /*--------------------------------------------media query------------------------------------------*/

@media only screen and (max-width: 1023px) {
	.dashboard-content {
		grid-template-columns: 1fr 1fr;
	}
} 

@media only screen and (max-width: 1022px) {
	.charts-container {
		grid-template-columns: 1fr;
	}
}

@media only screen and (max-width: 768px) {
	.dashboard-content {
		grid-template-columns: 1fr;
	}
	.chart-wrapper {
    height: 250px;
  }
}

@media only screen and (max-width: 500px) {
	.recent-transactions {
	 	padding: 24px 14px;
	}

	.recent-header h2 {
		font-size: 15px;
	}

	.recent-header a {
		font-size: 12px;
	}

	.transaction-list {
   	padding: 12px 8px;
	}

	.transaction-content {
		gap: 10px;
	}

	.transaction-details-dashboard {
		gap: 10px;
	}

	.transaction-details-dashboard p {
   	font-size: 14px;
	}

.transaction-details-dashboard span {
   	font-size: 10px;
	}

	.debit-transaction-amount {
   	font-size: 14px;
 }

 .credit-transaction-amount {
 	font-size: 14px;
 }
}

@media (max-width: 480px) {
  .charts-container {
    gap: 15px;
  }
  .chart-wrapper {
    height: 220px;
  }
}
