:root {
  --primary: #6366f1;
  --secondary: #a855f7;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
}

.app-container {
  width: 100%;
  max-width: 1000px;
}

/* Glassmorphism Classes */
.glass-header, .glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: slideDown 0.8s ease-out;
  position: sticky;
  top: 1rem;
  z-index: 100;
}

.glass-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.glass-header span {
  font-weight: 300;
  color: var(--text-main);
  -webkit-text-fill-color: var(--text-main);
}

.glass-header p {
  color: var(--text-muted);
}

/* Dashboard Layout */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 1s ease-out;
}

.summary-cards {
  display: flex;
}

.summary-cards .card {
  flex: 1;
  text-align: center;
  padding: 2.5rem;
}

.card h3 {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.charts-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.charts-section h3 {
  margin-bottom: 1.5rem;
  font-weight: 500;
  align-self: flex-start;
}

.chart-container {
  position: relative;
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1;
}

.transactions-section {
  overflow: hidden;
}

.transactions-section h3 {
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.table-responsive {
  width: 100%;
  max-height: 350px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Custom Scrollbar for Table */
.table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-responsive::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  position: sticky;
  top: 0;
  background: #111827; /* Dark background to cover scrolling text */
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.amount-col {
  font-weight: 600;
  color: #f43f5e; /* Red-ish to indicate expense */
}

.category-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #e2e8f0;
}

/* Forms & Inputs */
.glass-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.glass-input::placeholder {
  color: var(--text-muted);
}

.glass-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
}

.glass-btn {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.glass-btn:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

/* Animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  body {
    padding: 1rem;
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 400px;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-content h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.95rem;
  animation: slideInRight 0.3s ease-out forwards;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Weather Icons Animation */
.weather-icon {
  display: inline-block;
  margin-right: 5px;
  font-size: 1.2rem;
  vertical-align: middle;
}

@keyframes dropDown {
  0% { transform: translateY(0); }
  50% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

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

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.icon-rain {
  animation: dropDown 1s infinite ease-in-out;
}

.icon-sun {
  animation: spinSlow 10s infinite linear;
}

.icon-cloud {
  animation: floatY 3s infinite ease-in-out;
}
