/* Default light theme */
body[data-theme="light"] {
  --bg-color: #ffffff;
  --text-color: #222;
  --card-bg: #f5f5f5;
}

/* Dark theme */
body[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #fff;
  --card-bg: #2a2a2a;
}

.popup {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2563eb;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
}

.popup.show {
  opacity: 1;
  transform: translateY(0);
}

.popup.error {
  background: #dc2626; /* red for errors */
}

.hidden {
  display: none;
}


main h1 {
  max-width: 650px; /* ✅ was width: 650px */
  width: 100%;
  display: block;
  margin: 0 auto 24px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
}

form {
  padding: 24px;
  background: var(--bg-color);
  max-width: 650px; /* ✅ was width: 650px */
  width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-des,
.form-amount {
  display: flex;
  flex-direction: column;
}

label {
  font-size: 14px;
  margin: 0 0 6px;
  color: var(--text-color);
  font-weight: 500;
}

input,
select {
  width: 100%;
  padding: 10px 14px;
  font-size: 16px;
  border-radius: 6px;
  outline: none;
  border: 1px solid #e5e7eb;
  color: var(--text-color);
 background: var(--bg-color);
}

input:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-line2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

/* Currency styling */
.amount-input {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.amount-input span {
  padding: 10px 12px;
  color: #6b7280;
}

.amount-input input {
  border: none;
  flex: 1;
  padding: 10px 14px 10px 0;
  font-size: 16px;
  outline: none;
}

/* Date input wrapper with calendar icon */
.date-input {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  color: var(--text-color);
 background: var(--bg-color);
}

.date-input input[type="date"] {
  border: none;
  width: 100%;
  padding: 10px 14px;
  padding-left: 44px;
  font-size: 16px;
  outline: none;
  background: transparent;
  box-sizing: border-box;
  -webkit-appearance: none; 
}

.date-input .calendar-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-color);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.date-input:hover .calendar-icon {
  background: rgba(37,99,235,0.04);
}

.date-input:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.06);
}

/* Button */
.add-transaction-btn {
  background: #2563eb;
  color: white;
  padding: 12px 16px;
  font-size: 16px;
  width: 100%;
  border: none;
  margin-top: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
}

.add-transaction-btn:hover {
  background: #1d4ed8;
}

@media only screen and (max-width: 767px) {
  .form-line2 {
    grid-template-columns: 1fr;
  }
}
