body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #fafafa;
  padding-top: 110px; /* header height compensation */
  color: #2d2d2d;
  line-height: 1.6;
}

/* Desktop: Responsive margins using viewport width */
@media (min-width: 769px) {
  body {
    padding-left: 0; /* Remove sidebar padding */
    padding-top: 110px;
  }
}

/* Medium desktop screens - more conservative spacing */
@media (min-width: 769px) and (max-width: 1199px) {
  body:not(.profile-page) .profile-section {
    margin: 20px 5vw 0 15vw !important; /* Responsive margins */
  }
  
  .date-picker-section {
    margin: 40px 5vw 0 15vw !important; /* Responsive margins */
  }
  
  .dashboard {
    margin: 40px 5vw 40px 15vw !important; /* Responsive margins */
  }
  
  .dashboard.profile-page {
    margin: 40px 5vw 40px 15vw !important; /* Responsive margins */
  }
  
  .analysis-container {
    margin: 40px 5vw 40px 15vw !important; /* Responsive margins */
  }
  
  .coming-soon-container {
    margin: 40px 5vw 40px 15vw !important; /* Responsive margins */
  }
}

/* Large desktop screens - generous spacing */
@media (min-width: 1200px) {
  body:not(.profile-page) .profile-section {
    margin: 20px 7vw 0 18vw !important; /* More generous responsive margins */
  }
  
  .date-picker-section {
    margin: 40px 7vw 0 18vw !important; /* More generous responsive margins */
  }
  
  .dashboard {
    margin: 40px 7vw 40px 18vw !important; /* More generous responsive margins */
  }
  
  .dashboard.profile-page {
    margin: 40px 7vw 40px 18vw !important; /* More generous responsive margins */
  }
  
  .analysis-container {
    margin: 40px 7vw 40px 18vw !important; /* More generous responsive margins */
  }
  
  .coming-soon-container {
    margin: 40px 7vw 40px 18vw !important; /* More generous responsive margins */
  }
}

/* Body padding compensation for mobile */
@media (max-width: 480px) {
  body {
    padding-top: 140px;
  }
}

/* Minimalist Header */
header {
  background-color: #ffffff;
  color: #2d2d2d;
  padding: 20px 30px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px; /* increased to make room for subtitle */
  box-sizing: border-box;
  z-index: 1000;
  border-bottom: 2px solid #9f7aea;
}

/* Desktop: Full width header (no sidebar) */
@media (min-width: 769px) {
  header {
    left: 0; /* Full width */
    width: 100%; /* Full width */
    padding-left: 30px; /* Standard padding */
  }
}

header h1 { margin: 0; font-size: 1.6rem; font-weight: 600; }

.header-title { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; display: flex; flex-direction: column; align-items: center; }
.header-subtitle { margin-top: 4px; font-size: 0.9rem; color: #666; }

/* Modern Welcome Section - Premium Design */
body:not(.profile-page) .profile-section {
  background: transparent;
  padding: 0 30px;
  margin: 20px auto 0 auto;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile {
  color: #333;
  font-size: 1.6rem;
  font-weight: 300;
  text-align: left;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  font-family: 'Arial', sans-serif;
  letter-spacing: 0.3px;
  line-height: 1.6;
}

.profile.loading {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

/* Mobile responsive for profile section */
@media (max-width: 480px) {
  body:not(.profile-page) .profile-section {
    padding: 0 20px;
    margin: 8px auto 0 auto;
  }
  
  .profile {
    font-size: 1.4rem;
  }
}

/* Responsive adjustments - REMOVED HAMBURGER STYLES TO AVOID CONFLICTS */
@media (max-width: 480px) {
  header {
    padding: 30px 22px;
    height: 105px;
  }

  header h1 {
    font-size: 2.7rem;
    /* Removed margin-left since we're using absolute positioning */
  }
}

/* Modern Date Range Picker Styles */
.date-picker-section {
  padding: 0 30px;
  margin: 40px auto 0 auto;
  max-width: 1200px;
}

.date-range-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.date-range-display {
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  user-select: none;
}

.date-range-display:hover {
  border-color: #2d2d2d;
}

.date-range-icon {
  font-size: 1rem;
  color: #666;
}

.date-range-text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d2d2d;
}

.dropdown-arrow {
  font-size: 0.75rem;
  color: #666;
  transition: transform 0.15s ease;
}

.date-range-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.date-range-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e1e1e1;
  border-radius: 4px;
  box-shadow: none;
  z-index: 1000;
  margin-top: 1px;
  padding: 20px;
}

.date-inputs-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.date-inputs-container {
  display: flex;
  gap: 16px;
}

.date-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-input-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.date-input {
  padding: 12px 16px;
  border: 1px solid #e1e1e1;
  border-radius: 0;
  font-size: 0.9rem;
  background: white;
  color: #2d2d2d;
  width: 100%;
  transition: border-color 0.15s ease;
  font-weight: 400;
  box-sizing: border-box;
}

.date-input:focus {
  outline: none;
  border-color: #2d2d2d;
  background: white;
  box-shadow: none;
}

.date-input:hover {
  border-color: #999;
  background: white;
}

.apply-date-btn {
  width: 100%;
  padding: 12px 20px;
  background: #2d2d2d;
  color: white;
  border: 1px solid #2d2d2d;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
  box-shadow: none;
  text-transform: none;
  letter-spacing: 0;
}

.apply-date-btn:hover {
  background: #333;
  transform: none;
  box-shadow: none;
}

.apply-date-btn:active {
  background: #1a1a1a;
  transform: none;
}

/* Updated dashboard layout for consistent alignment */
.dashboard {
  display: flex;
  gap: 30px;
  margin: 40px auto; /* Increased spacing for minimalist feel */
  max-width: 1200px;
  padding: 0 30px;
}

.dashboard.transactions-section {
  gap: 0;
  margin-top: 40px; /* Increased spacing for minimalist feel */
  margin-bottom: 40px; /* Increased spacing to bottom */
}

.dashboard.transactions-section > div {
  width: 100%;
}

.dashboard #recentTransactionsContainer {
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Minimalist card styles */
.card {
  flex: 1;
  background: white;
  padding: 32px;
  border-radius: 4px;
  border: 1px solid #e1e1e1;
  position: relative;
  min-height: 140px;
  box-sizing: border-box;
}


.card-title {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.card-amount {
  font-size: 1.75rem;
  font-weight: 600;
  color: #2d2d2d;
  margin-bottom: 16px;
}

.card.income .card-amount {
  color: #2d2d2d;
}

.card.expenses .card-amount {
  color: #d32f2f;
}

/* Move balance display to income card */
.card.expenses .card-balance {
  display: none;
}

.card.income {
  position: relative;
}

.card.income .card-balance {
  position: absolute;
  bottom: 15px;
  right: 20px;
  font-size: 0.85rem;
  color: #666;
  text-align: right;
}

.card-balance {
  position: absolute;
  bottom: 15px;
  right: 20px;
  font-size: 0.85rem;
  color: #666;
  text-align: right;
}

.balance-label {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.balance-amount {
  font-weight: 600;
  color: #2d2d2d;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .dashboard {
    gap: 15px;
    padding: 0 20px;
    margin: 30px auto; /* Increased margin for better spacing */
  }
  
  .dashboard.transactions-section {
    gap: 10px;
    margin-top: 30px; /* Increased spacing */
    margin-bottom: 30px; /* Increased spacing */
  }

  .dashboard.cards-section {
    padding: 0 20px;
    gap: 15px;
    margin-top: 30px; /* Increased spacing */
  }

  .dashboard #recentTransactionsContainer {
    padding: 0;
  }

  /* Mobile date picker alignment */
  .date-picker-section {
    padding: 0 20px;
    margin: 30px auto 0 auto; /* Increased spacing */
  }

  .date-range-display {
    padding: 10px 14px;
  }

  .date-range-text {
    font-size: 0.85rem;
  }

  .date-range-dropdown {
    padding: 20px;
    border-radius: 14px;
  }

  .date-inputs-row {
    gap: 16px;
  }

  .date-inputs-container {
    flex-direction: column;
    gap: 14px;
  }

  .date-input {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .apply-date-btn {
    padding: 14px;
    font-size: 0.9rem;
    margin-top: 4px;
  }
  
  .card {
    padding: 15px;
    min-height: 140px; /* Increased from 120px for taller mobile cards */
  }

  
  .card-title {
    font-size: 0.7rem;
    letter-spacing: 0.3px;
  }
  
  .card-amount {
    font-size: 1.8rem;
  }
  
  .card-balance {
    bottom: 12px;
    right: 15px;
  }
  
  .balance-label {
    font-size: 0.65rem;
  }
  
  .balance-amount {
    font-size: 0.8rem;
  }
}

/* Even smaller screens */
@media (max-width: 400px) {
  .dashboard {
    gap: 8px;
    padding: 0 16px;
  }

  .dashboard.cards-section {
    padding: 0 16px;
    gap: 8px;
  }
  
  .dashboard #recentTransactionsContainer {
    padding: 0;
  }
  
  .card {
    padding: 12px;
    min-height: 90px;
  }
  
  .card-title {
    font-size: 0.65rem;
  }
  
  .card-amount {
    font-size: 1.2rem;
  }
  
  .card-balance {
    bottom: 10px;
    right: 12px;
  }
  
  .balance-amount {
    font-size: 0.75rem;
  }
}

.expense-log {
  padding: 20px;
}

.add-expense-income-btn {
  position: static;
  background-color: #2d2d2d;
  color: white;
  border: 1px solid #2d2d2d;
  cursor: pointer;
  box-shadow: none;
  height: 40px;
  width: 40px;
  border-radius: 4px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  transition: background-color 0.15s ease;
}

.add-expense-income-btn:hover {
  background-color: #333;
}

/* Enhanced Profile Section Styling */
.profile-section .profile {
  transition: all 0.3s ease;
  position: relative;
}

/* Loading state for profile */
.profile-section .profile.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: profileLoading 1.5s infinite;
  color: transparent;
  border-radius: 4px;
  min-width: 100px;
  display: inline-block;
}

@keyframes profileLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Hover effect when profile is clickable */
.profile-section .profile:not(.loading):hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Active state */
.profile-section .profile:not(.loading):active {
  transform: translateY(0);
}

/* Remove loading animation when content loads */
.profile-section .profile:not(.loading) {
  background: none;
  animation: none;
  color: #333;
}
