/*
  ui-enhancements.css
  Loads AFTER styles.css. Use this file for all visual improvements, overrides, and new UI components.
  Always adhere to the Eventbörse Design System and use CSS variables where appropriate.
*/

/* --- Global Enhancements --- */

/* Subtle gradient overlay for page headers */
.page-header {
  position: relative;
  overflow: hidden; /* Ensure gradient doesn't bleed outside if header has radius */
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(var(--brand-primary-rgb), 0.05), transparent);
  pointer-events: none; /* Allow interaction with elements behind the overlay */
  z-index: 1; /* Place above header background but below content */
}

/* --- Component Specific Enhancements --- */

/* Example: Add some shadow to cards on hover */
.listing-card:hover,
.review-card:hover,
.kanban-card:hover {
  box-shadow: var(--eb-shadow-2);
  transform: translateY(-2px);
  transition: transform var(--eb-transition-fast), box-shadow var(--eb-transition-fast);
}

/* Example: Dark mode adjustments */
[data-theme="dark"] .listing-card,
[data-theme="dark"] .review-card,
[data-theme="dark"] .kanban-card {
  background-color: var(--surface-2); /* Slightly darker card background in dark mode */
}

[data-theme="dark"] .page-header::before {
  background: linear-gradient(to bottom, rgba(var(--brand-primary-rgb), 0.08), transparent); /* Slightly more prominent in dark mode */
}

/* Example: Better focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--eb-radius-sm);
}

/* ===== MODAL BACKDROP BLUR ===== */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-body {
  max-height: 80vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ===== RESPONSIVE GRID HELPERS ===== */
.eb-grid {
  display: grid;
  gap: var(--eb-spacing-md);
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .eb-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Adjusting spacing for better readability on larger screens */
@media (min-width: 768px) {
  .page-content {
    padding-left: var(--eb-spacing-md);
    padding-right: var(--eb-spacing-md);
  }
}

@media (min-width: 1024px) {
  .page-content {
    padding-left: var(--eb-spacing-lg);
    padding-right: var(--eb-spacing-lg);
    max-width: 1280px; /* Constrain content width for very large screens */
    margin-left: auto;
    margin-right: auto;
  }
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: var(--eb-spacing-xl) var(--eb-spacing-md);
  color: var(--text-light);
  font-size: 1.1em;
  border: 2px dashed var(--border);
  border-radius: var(--eb-radius-md);
  margin-top: var(--eb-spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--eb-spacing-sm);
}

.empty-state .material-icons-round {
  font-size: 3em;
  color: var(--border);
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: var(--eb-spacing-xs);
}

/* ===== LISTING CARD STAGGERED FADE-IN ===== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* .listing-card animation removed — broken animation kept cards permanently invisible */

/* Assign --i variable using nth-child for staggered effect */
.listing-card:nth-child(1) { --i: 0; }
.listing-card:nth-child(2) { --i: 1; }
.listing-card:nth-child(3) { --i: 2; }
.listing-card:nth-child(4) { --i: 3; }
.listing-card:nth-child(5) { --i: 4; }
.listing-card:nth-child(6) { --i: 5; }
.listing-card:nth-child(7) { --i: 6; }
.listing-card:nth-child(8) { --i: 7; }
.listing-card:nth-child(9) { --i: 8; }
.listing-card:nth-child(10) { --i: 9; }
.listing-card:nth-child(11) { --i: 10; }
.listing-card:nth-child(12) { --i: 11; }
.listing-card:nth-child(13) { --i: 12; }
.listing-card:nth-child(14) { --i: 13; }
.listing-card:nth-child(15) { --i: 14; }
.listing-card:nth-child(16) { --i: 15; }
.listing-card:nth-child(17) { --i: 16; }
.listing-card:nth-child(18) { --i: 17; }
.listing-card:nth-child(19) { --i: 18; }
.listing-card:nth-child(20) { --i: 19; }

/* ===== PROVIDER CARD HOVER EFFECT ===== */
.provider-card:hover {
  box-shadow: var(--eb-shadow-2);
  transform: translateY(-2px);
  transition: transform var(--eb-transition-fast), box-shadow var(--eb-transition-fast);
}

/* ===== DROPDOWN MENU FOR FILTERING OPTIONS ===== */
.filter-dropdown {
  position: relative;
  display: inline-block; /* Allows side-by-side with other filters */
}

.dropdown-toggle {
  background-color: var(--surface);
  color: var(--text);
  padding: var(--eb-spacing-sm) var(--eb-spacing-md);
  border: 1px solid var(--border);
  border-radius: var(--eb-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--eb-spacing-xs);
  font-size: 0.9em;
  font-weight: 500;
  transition: background-color var(--eb-transition-fast), border-color var(--eb-transition-fast);
}

.dropdown-toggle:hover {
  background-color: var(--surface-2);
  border-color: var(--brand-primary);
}

.dropdown-toggle .material-icons-round {
  font-size: 1.2em;
  transition: transform var(--eb-transition-fast);
}

/* Rotate icon when dropdown is active */
.dropdown-toggle.is-active .material-icons-round {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none; /* Hidden by default */
  position: absolute;
  top: calc(100% + var(--eb-spacing-xs)); /* Position below the toggle */
  left: 0;
  background-color: var(--surface);
  min-width: 180px;
  box-shadow: var(--eb-shadow-2);
  border-radius: var(--eb-radius-sm);
  z-index: 100; /* Ensure it's above other content */
  padding: var(--eb-spacing-xs) 0;
  border: 1px solid var(--border);
}

.dropdown-menu.is-a

/* --- Responsive padding for .card-image on smaller screens --- */
.card-image {
  padding-bottom: var(--eb-spacing-sm); /* Adds space below the image container for visual separation */
}