:root {
  --bg: #111827;
  --card-bg: #1f2937;
  --accent: #7c3aed;
  --accent-soft: #a78bfa;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --green: #22c55e;
  --radius: 1rem;
  --font: 'Inter', sans-serif;
}

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

.lock-note {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.3rem;
  display: block;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  padding: 2rem;
}

.app-container {
  width: 100%;
  max-width: 960px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-inline: 1rem;
}


header {
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  color: var(--accent);
}

.subtitle {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 1rem;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.2rem;
}

.card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

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

.card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.card h2 {
  margin-top: 0.3rem;
  font-size: 1.6rem;
  font-weight: 600;
}

.remaining h2 {
  color: var(--green);
}

.forms {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.budget-form, .expense-form {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

input, select {
  padding: 0.9rem;
  background-color: #111827;
  color: var(--text);
  border: 1px solid #374151;
  border-radius: 0.6rem;
  font-size: 1rem;
}

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

button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 0.9rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

button:hover {
  background-color: var(--accent-soft);
}

.expenses-list ul {
  list-style: none;
  margin-top: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.expenses-list li {
  display: flex;
  justify-content: space-between;
  background: #111827;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  border-left: 5px solid var(--accent);
  border-radius: 0.6rem;
  font-size: 0.95rem;
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#reset-btn {
  background-color: crimson;
}

.tip-box {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.expense-item {
  background-color: #1e293b;
  border-radius: 0.6rem;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  margin-bottom: 0.8rem;
}

.expense-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.category-tag {
  background-color: #334155;
  color: #a78bfa;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 0.5rem;
  width: fit-content;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}


.right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}


.amount {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

/* 🗑 Clean delete button */
.delete-btn {
  background: #334155;
  border: none;
  color: #e2e8f0;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.delete-btn:hover {
  background: #ef4444;
  color: white;
}

.popup {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--card-bg);
  color: var(--text);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-weight: 500;
}

.popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.popup.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}


@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .forms {
    flex-direction: column;
    gap: 1.5rem;
  }

  .expenses-list li,
  .expense-item {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .expense-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .right {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .amount {
    font-size: 1rem;
  }

  .delete-btn {
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .popup {
    font-size: 0.9rem;
    padding: 0.75rem 1.2rem;
    width: calc(100% - 3rem);
    max-width: 90%;
    box-sizing: border-box;
  }
}
