@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

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

:root {
  --total: linear-gradient(135deg, #8b5cf6, #a78bfa);
  --Month: linear-gradient(135deg, #10b981, #34d399);
  --category: linear-gradient(135deg, #f97316, #fdba74);
  --background: #f7f7fb;
  --text: #f9fafb;
  --secondary-text: #6b7280;
}

body {
  background-color: #f5f7fa;
  font-family: "Inter", sans-serif;
}

body::-webkit-scrollbar {
  display: none;
}

.container {
  min-height: 100vh;
  width: 100%;
  margin: 10px auto;
  max-width: 980px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  /* box-sizing: border-box; */
}

.Total-Expenses {
  background: var(--total);
  /* height: 25%; */
  width: 100%;
  /* display: flex; */
  border-radius: 20px;
  padding: 40px;
  color: var(--text);
  font-size: 2em;
}

.Month-Category {
  /* height: 25%; */
  width: 100%;
  display: flex;
}

.Spent-This-Month {
  width: 50%;
  background: var(--Month);
  border-radius: 20px;
  margin: 5px;
  padding: 20px;
  color: var(--text);
  font-size: 1.5em;
}

.Spent-This-Month span,
.Top-Category span {
  font-size: 1rem;
}

.Top-Category {
  width: 50%;
  background: var(--category);
  border-radius: 20px;
  margin: 5px;
  padding: 20px;
  color: var(--text);
  font-size: 1.5em;
}

@media screen and (max-width: 320px) {
  .Total-Expenses {
    font-size: 1.5em;
  }
  .Spent-This-Month,
  .Top-Category {
    font-size: 0.8em;
  }
}

.form {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 500px;
  background-color: #f5f7fa;
  border-radius: 20px;
  margin: 30px auto;
  padding: 30px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.form input,
.form select {
  width: 100%;
  padding: 8px 10px;
  margin: 5px 0 12px 0;
  /* margin-bottom: 15px; */
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 12px;
}

.form input:focus,
.form select:focus {
  outline: none;
  border-color: #4f46e5;
}

.form button {
  background: var(--total);
  color: var(--text);
  width: 100%;
  padding: 8px;
  border-radius: 7px;
}

.history {
  width: 100%;
  background-color: #f9fafb;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
}

.history h2 {
  text-align: center;
  font-size: 1.2rem;
  color: var(--secondary-text);
  margin: 0;
  max-width: 80%;
}

#expense-list {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  align-items: center;
}

/* Main expense row */
.history-details {
  height: 100px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  background: #ffffff;
  padding: 16px;
  margin-bottom: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Description */
.description-item h2 {
  grid-column: 1;
  margin: 0;
  font-size: 18px;
  color: #1e293b;
  text-align: left;
  text-transform: capitalize;
}

/* Amount */
.amount-item {
  grid-column: 2;
  grid-row: 1;
  text-align: right;
  font-size: 18px;
  font-weight: bold;
  color: #dc2626;
}

.meta-info {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Category pill */
.category-item {
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  width: fit-content;
}

/* Date */
.date-item {
  font-size: 13px;
  color: #777;
  margin: 0;
}

.delete-btn {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: right;
  align-items: center;
  cursor: pointer;
  font-size: 18px;
  color: #94a3b8;
}

.delete-btn:hover {
  transform: scale(1.2);
  color: #ef4444;
}

@media (max-width: 400px) {
  .history-card {
    padding: 12px;
  }
  .meta-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

#limit-alert {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  border-left: 4px solid #dc2626;
  font-weight: 600;
  animation: shake 0.5s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}
