@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

:root {
  --primary: #4ea8ff;
  --primary-dark: #2279d4;
  --accent: #f2c94c;
  --background: #121212;
  --card: #1e1e1e;
  --text: #f0f0f0;
  --border: #2c2c2c;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--text);
  padding: 16px;
  max-width: 480px;
  margin: auto;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.6rem;
  color: var(--primary);
}

.budget-summary {
  background: var(--card);
  padding: 16px;
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  font-size: 1.2rem;
  font-weight: bold;
}

#remaining {
  font-size: 2rem;
  color: var(--accent);
  margin-top: 8px;
}

h2 {
  margin: 20px 0 10px;
  font-size: 1.2rem;
  color: var(--accent);
}

/* Cards & Forms */
form,
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
}

input,
select,
button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 1rem;
  background-color: #2b2b2b;
  color: var(--text);
}

input::placeholder,
select::placeholder {
  color: #aaa;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(78, 168, 255, 0.3);
}

input[type="date"] {
  background-color: #2b2b2b;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 1rem;
}

/* Ensures date text is visible on all platforms */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1); /* Makes the calendar icon white in dark mode */
}

button {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background-color: var(--primary-dark);
}

/* Toggle Button */
.toggle-btn {
  background-color: var(--accent);
  color: black;
  font-weight: 600;
  border: none;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  cursor: pointer;
}

/* Logout Button */
.logout-btn {
  background-color: #e74c3c;
  border: none;
  color: white;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: bold;
  margin-top: 10px;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Transaction List */
.card-list {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-list::-webkit-scrollbar {
  width: 6px;
}
.card-list::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
}

.card {
  padding: 14px 16px;
  border-left: 4px solid var(--primary);
}

.card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 4px;
}

.amount {
  color: var(--accent);
}

.card-body small {
  color: #ccc;
  display: block;
  font-size: 0.85rem;
}

/* Modals */
.modal {
  position: fixed;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 999;
}

.modal-content {
  background: #1e1e1e;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  position: relative;
}

.modal-content h2 {
  margin-bottom: 20px;
  text-align: center;
  color: var(--accent);
}

.modal-content input,
.modal-content button,
.modal-content label {
  width: 100%;
  display: block;
  margin-bottom: 12px;
  font-size: 1rem;
}

.modal-content input,
.modal-content button {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #2b2b2b;
  color: white;
}

.modal-content input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Modal Close Button */
.close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  font-weight: bold;
  position: absolute;
  top: 12px;
  right: 16px;
  color: #999;
  cursor: pointer;
}

.close-btn:hover {
  color: white;
}

/* Grid layout for protected sections */
main#appMain {
  display: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

/* Section spacing */
#transactions {
  margin-top: 24px;
}
