:root {
  --primary: #4361ee;
  --secondary: #3f37c9;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #f8961e;
  --info: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --income: #2ecc71;
  --expense: #e74c3c;
  --savings: #3498db;
  --background: #f5f7fb;
  --card-bg: #ffffff;
  --text: #333333;
  --text2: #bbd9ff;
  --border: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

.dark-mode {
  --background: #1a1a1a;
  --card-bg: #2d2d2d;
  --text: #f0f0f0;
  --border: #404040;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text);
  transition: all 0.3s ease;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.mobile-nav {
  display: none;
}

/* Header Styles */
header {
  background-color: var(--primary);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav ul {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background 0.3s;
  display: block;
}

nav ul li a:hover,
nav ul li a.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.header-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.theme-toggle,
.language-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.theme-toggle:hover,
.language-toggle:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.language-toggle {
  background-color: rgba(255, 255, 255, 0.1);
  font-weight: bold;
  font-size: 0.9rem;
}

/* Page Styles */
.page {
  display: none;
  padding: 2rem 0;
  min-height: calc(100vh - 80px);
}

.page.active {
  display: block;
}

.page-title {
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 600;
}

/* Card Styles */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 600;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  color: white;
  text-align: center;
  transition: transform 0.3s ease;
}

.summary-card:hover {
  transform: translateY(-5px);
}

.summary-card.income {
  background: linear-gradient(135deg, var(--income), #27ae60);
}

.summary-card.expense {
  background: linear-gradient(135deg, var(--expense), #c0392b);
}

.summary-card.balance {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.summary-card.savings {
  background: linear-gradient(135deg, var(--savings), #2980b9);
}

.summary-card.upcoming-total {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.summary-card.upcoming-pending {
  background: linear-gradient(135deg, #e67e22, #d35400);
}

.summary-card.upcoming-paid {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.summary-card.fixed-total {
  background: linear-gradient(135deg, #34495e, #2c3e50);
}

.summary-card.fixed-active {
  background: linear-gradient(135deg, #27ae60, #229954);
}

.summary-card.fixed-inactive {
  background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.summary-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: white;
  opacity: 0.9;
  font-weight: 500;
}

.summary-card .amount {
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Button Styles */
button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
  font-weight: 500;
}

button:hover {
  background-color: var(--secondary);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.btn-danger {
  background-color: var(--danger);
}

.btn-danger:hover {
  background-color: #d1144a;
}

.btn-success {
  background-color: var(--success);
}

.btn-success:hover {
  background-color: #3aa8d0;
}

.btn-warning {
  background-color: #f39c12;
}

.btn-warning:hover {
  background-color: #e67e22;
}

.btn-info {
  background-color: #3498db;
}

.btn-info:hover {
  background-color: #2980b9;
}

/* Transaction List */
.transaction-list {
  margin-top: 1.5rem;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s;
}

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

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-info h4 {
  margin-bottom: 0.25rem;
  color: var(--text);
  font-weight: 600;
}

.transaction-info p {
  color: var(--text);
  opacity: 0.8;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.transaction-amount {
  font-size: 1.1rem;
  font-weight: bold;
}

.transaction-amount.income {
  color: var(--income);
}

.transaction-amount.expense {
  color: var(--expense);
}

.transaction-actions {
  display: flex;
  gap: 0.5rem;
}

.transaction-actions button {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* Chart Container */
.chart-container {
  height: 300px;
  margin-bottom: 2rem;
  position: relative;
}

/* Filter Options */
.filter-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-options select,
.filter-options input {
  flex: 1;
  min-width: 150px;
}

/* Upcoming Items */
.upcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-left: 4px solid var(--warning);
  background-color: var(--card-bg);
  margin-bottom: 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.upcoming-item:hover {
  transform: translateX(5px);
}

.upcoming-item.due-soon {
  border-left-color: var(--danger);
}

.upcoming-item.paid {
  border-left-color: var(--success);
  opacity: 0.7;
}

.upcoming-info h4 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.upcoming-info p {
  margin-bottom: 0.25rem;
  color: var(--text);
  opacity: 0.8;
  font-size: 0.9rem;
}

.upcoming-actions {
  display: flex;
  gap: 0.5rem;
}

.upcoming-actions button {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Fixed Expenses */
.fixed-expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-left: 4px solid #9b59b6;
  background-color: var(--card-bg);
  margin-bottom: 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.fixed-expense-item:hover {
  transform: translateX(5px);
}

.fixed-expense-item.active {
  border-left-color: #2ecc71;
}

.fixed-expense-item.inactive {
  border-left-color: #95a5a6;
  opacity: 0.7;
}

.fixed-expense-info h4 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fixed-expense-info p {
  margin-bottom: 0.25rem;
  color: var(--text);
  opacity: 0.8;
  font-size: 0.9rem;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.status-badge.active {
  background-color: #2ecc71;
  color: white;
}

.status-badge.inactive {
  background-color: #95a5a6;
  color: white;
}

.fixed-expense-actions {
  display: flex;
  gap: 0.5rem;
}

.fixed-expense-actions button {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.fixed-expense-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.fixed-source {
  font-style: italic;
  color: var(--primary) !important;
  font-size: 0.8rem !important;
}

.next-due {
  font-style: italic;
  color: var(--primary);
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* Settings */
.settings-option {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: var(--background);
  border-radius: 4px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
}

.app-info {
  padding: 1rem;
  background-color: var(--background);
  border-radius: 4px;
}

.app-info p {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.app-info strong {
  color: var(--primary);
}

/* FAB Menu Styles */
.fab-menu {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  padding: 8px;
  z-index: 1001;
  animation: fabMenuSlideUp 0.3s ease;
  border: 1px solid var(--border);
  min-width: 200px;
}

@keyframes fabMenuSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fab-menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 4px;
}

.fab-menu-item:last-child {
  margin-bottom: 0;
}

.fab-menu-item:hover {
  background-color: var(--primary);
  transform: translateX(-5px);
}

.fab-menu-item:hover .fab-menu-label {
  color: white;
}

.fab-menu-icon {
  font-size: 1.2rem;
  margin-right: 12px;
  width: 24px;
  text-align: center;
  transition: transform 0.3s;
}

.fab-menu-item:hover .fab-menu-icon {
  transform: scale(1.2);
}

.fab-menu-label {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.3s;
}

/* FAB Animation */
@keyframes fabPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.fab-saving {
  animation: fabPulse 0.6s ease-in-out;
  background-color: var(--success) !important;
}

/* FAB Icon Rotation - NEW */
.fab-icon {
  transition: transform 0.3s ease;
}

/* Mobile-specific FAB positioning */
@media screen and (max-width: 768px) {
  .fab {
    bottom: 80px; /* Mobile nav এর উপরে */
    right: 20px;
    width: 56px;
    height: 56px;
  }
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  font-weight: bold;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text);
  opacity: 0.7;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
