/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: white;
  width: 100%;
  max-width: 800px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

.logo i {
  font-size: 2.5rem;
}

.logo h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Stats Section */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 25px;
}

.stat-card {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-left: 5px solid #667eea;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  background: #667eea;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-info h3 {
  color: #6c757d;
  font-size: 0.9rem;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-amount {
  color: #28a745;
  font-size: 2rem;
  font-weight: 700;
}

.stat-count {
  color: #6c757d;
  font-size: 1.8rem;
  font-weight: 700;
}

/* Input Section */
.input-section {
  padding: 0 25px 25px;
  border-bottom: 1px solid #e9ecef;
}

.input-section h2 {
  color: #495057;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.input-field {
  display: flex;
  flex-direction: column;
}

.input-field label {
  color: #495057;
  margin-bottom: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-field input,
.input-field select {
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-field input:focus,
.input-field select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-weight: 600;
  transition: all 0.3s ease;
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.add-btn:active {
  transform: translateY(0);
}

.input-hints {
  margin-top: 15px;
  color: #6c757d;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-hints i {
  color: #ffc107;
}

/* Expenses Section */
.expenses-section {
  padding: 25px;
}

.expenses-section h2 {
  color: #495057;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.expenses-container {
  min-height: 300px;
}

#expenseList {
  list-style: none;
}

.expense-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 5px solid;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.expense-item:hover {
  transform: translateX(5px);
  background: #e9ecef;
}

/* Category Colors */
.expense-item[data-category="food"] {
  border-color: #ff6b6b;
}

.expense-item[data-category="transport"] {
  border-color: #4ecdc4;
}

.expense-item[data-category="shopping"] {
  border-color: #ffd166;
}

.expense-item[data-category="entertainment"] {
  border-color: #9d4edd;
}

.expense-item[data-category="bills"] {
  border-color: #06d6a0;
}

.expense-item[data-category="health"] {
  border-color: #118ab2;
}

.expense-item[data-category="other"] {
  border-color: #6a994e;
}

.expense-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.expense-name {
  font-weight: 600;
  color: #212529;
  font-size: 1.1rem;
}

.expense-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: #6c757d;
}

.expense-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.expense-category.food {
  background: #ff6b6b20;
  color: #ff6b6b;
}

.expense-category.transport {
  background: #4ecdc420;
  color: #4ecdc4;
}

.expense-category.shopping {
  background: #ffd16620;
  color: #ffd166;
}

.expense-category.entertainment {
  background: #9d4edd20;
  color: #9d4edd;
}

.expense-category.bills {
  background: #06d6a020;
  color: #06d6a0;
}

.expense-category.health {
  background: #118ab220;
  color: #118ab2;
}

.expense-category.other {
  background: #6a994e20;
  color: #6a994e;
}

.expense-amount {
  font-size: 1.3rem;
  font-weight: 700;
  color: #28a745;
  min-width: 100px;
  text-align: right;
}

.expense-date {
  color: #adb5bd;
  font-size: 0.85rem;
}

.expense-actions {
  display: flex;
  gap: 10px;
}

.delete-btn {
  background: #ff4757;
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.delete-btn:hover {
  background: #ff3838;
  transform: rotate(90deg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  display: none;
}

.empty-state.show {
  display: block;
}

.empty-icon {
  font-size: 4rem;
  color: #adb5bd;
  margin-bottom: 20px;
}

.empty-state h3 {
  color: #6c757d;
  margin-bottom: 10px;
}

.empty-state p {
  color: #adb5bd;
}

/* Footer */
footer {
  padding: 25px;
  text-align: center;
  border-top: 1px solid #e9ecef;
  color: #6c757d;
  font-size: 0.9rem;
}

.clear-btn {
  background: #f8f9fa;
  color: #dc3545;
  border: 2px solid #dc3545;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #dc3545;
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    border-radius: 15px;
  }
  
  .logo h1 {
    font-size: 2rem;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .input-group {
    grid-template-columns: 1fr;
  }
  
  .expense-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .expense-amount {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0;
  }
  
  .header {
    padding: 20px;
  }
  
  .logo {
    flex-direction: column;
    gap: 10px;
  }
  
  .logo h1 {
    font-size: 1.8rem;
  }
}