/* Demo modal styling */
.modal-header {
  background: linear-gradient(135deg, #a8b545 0%, #2570bd 100%);
  color: white;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
}

.modal-body img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* View Demo button styling */
.btn-outline-primary.btn-sm {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-outline-primary.btn-sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 112, 189, 0.2);
}

#budget-meta {
  background-color: #d5e3f2;
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}

.budget-meta-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.budget-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  height: 100px;
  width: 100px;
  flex: 1 1 250px; /* Grow, shrink, base width of 250px */
  min-width: 200px; /* Minimum width before wrapping */
}

.budget-meta-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #4a5568;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.budget-meta-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .budget-meta-item {
    min-height: 70px;
    flex: 1 1 100%; /* Stack on mobile */
  }

  .budget-meta-value {
    font-size: 1.25rem;
  }
}

/* When there are only 2 items visible, ensure they share space evenly */
.budget-meta-container:has(
    .budget-meta-item:nth-child(3)[style*='display: none']
  )
  .budget-meta-item {
  flex: 1 1 calc(50% - 0.5rem);
}

#budget-meta > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

#budget-meta h3 {
  margin: 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

#budget-meta p {
  margin: 0;
}

#budget-attribute-form > div {
  display: flex;
  align-items: baseline;
  padding-bottom: 10px;
}

#budget-categories .accordion-button {
  background-color: #769dc5;
  color: white;
  font-weight: bold;
}
.list-group-item:hover {
  background-color: #d5e3f2;
}

.auth-hidden {
  visibility: hidden;
}

.navbar {
  background-color: #cfd4a5;
}

.navbar-brand {
  font-weight: bold;
}

#user-greeting {
  font-size: 0.875rem;
  font-weight: 500;
  color: #a8b545;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* Welcome intro section */
#welcome-intro {
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #a8b545 0%, #2570bd 100%);
  color: black;
  padding: 1.5rem !important;
  border-radius: 12px;
  justify-content: center;
}

#welcome-intro ul {
  color: white;
}

#welcome-intro li {
  padding: 1.1rem;
  font-size: 1rem;
}

/* Feature cards */
.card.h-100 {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.card.h-100:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: #a8b545;
}

.card-title {
  color: #2570bd;
  font-weight: 600;
}

/* Call to action section */
section.text-center.py-5 {
  background: #d5e3f2;
  border-radius: 12px;
  margin-top: 3rem;
}

section.text-center.py-5 h3 {
  color: #2d3748;
  font-weight: 700;
}

section.text-center.py-5 .btn-lg {
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-weight: 600;
}

section.text-center.py-5 .btn-primary {
  background: linear-gradient(135deg, #a8b545 0%, #2570bd 100%);
  border: none;
}

/* Consistent form styling for create budget page */
#create-budget-form .form-control,
#create-budget-form .form-select,
#edit-budget-form .form-control,
#edit-budget-form .form-select {
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}

#create-budget-form .form-control:focus,
#create-budget-form .form-select:focus,
#edit-budget-form .form-control:focus,
#edit-budget-form .form-select:focus {
  border-color: #a8b545;
  box-shadow: 0 0 0 0.2rem rgba(168, 181, 69, 0.15);
}

/* Special handling for input group (gross income field) */
#create-budget-form .input-group .form-control,
#edit-budget-form .input-group .form-control {
  border-radius: 0 8px 8px 0;
}

#create-budget-form .input-group .input-group-text,
#edit-budget-form .input-group .input-group-text {
  border-radius: 8px 0 0 8px;
  border: 2px solid #e2e8f0;
  background-color: #f8f9fa;
}

#create-budget-form .input-group:focus-within .input-group-text,
#edit-budget-form .input-group:focus-within .input-group-text {
  border-color: #a8b545;
}

/* Modal styling to match theme */
#add-item-form .modal-header,
#edit-item-form .modal-header {
  background: #a8b545;
  color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

#add-item-form .modal-header .btn-close,
#edit-item-form .modal-header .btn-close {
  filter: brightness(0) invert(1);
}

#add-item-form .modal-content,
#edit-item-form .modal-content {
  border-radius: 8px;
  border: none;
}
