/* 
 * Modern Events Page Styling - Enhanced Version
 * filepath: e:\Codes\Projects\Buizz\Buizz\buizz_backend\public\assets\css\events\modern-events.css
 */

:root {
  /* Base Colors */
  --primary-color: #2563eb;
  --primary-light: #dbeafe;
  --primary-hover: #1d4ed8;
  --primary-dark: #1e40af;
  --secondary-color: #475569;

  /* Text Colors */
  --text-color: #334155;
  --light-text: #64748b;
  --lighter-text: #94a3b8;

  /* Background and Border Colors */
  --border-color: #e2e8f0;
  --background: #f8fafc;
  --card-bg: #ffffff;

  /* Shadows and Effects */
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --focus-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);

  /* Radius and Transitions */
  --border-radius: 0.5rem;
  --border-radius-sm: 0.25rem;
  --border-radius-lg: 1rem;
  --transition: all 0.3s ease;
  --transition-fast: all 0.2s ease;
}

/* Base Styles */
body {
  background-color: var(--background);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
}

.page-title-section {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--light-text);
}

/* Layout */
.events-container {
  display: flex;
  gap: 2rem;
  position: relative;
}

/* Sidebar */
.events-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  align-self: flex-start;
}

.sidebar-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
}

.sidebar-content {
  padding: 0 1.25rem 6rem;
  overflow-y: auto;
  height: calc(100% - 70px);
}

.sidebar-content::-webkit-scrollbar {
  width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: var(--light-text);
  border-radius: 20px;
}

/* Filter Sections */
.filter-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
  border-bottom: none;
}

.filter-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.filter-title i {
  color: var(--light-text);
  transition: transform 0.3s ease;
}

.filter-title.open i {
  transform: rotate(180deg);
}

.filter-search {
  margin-bottom: 0.5rem;
}

.filter-search input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
}

.filter-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-options {
  margin-top: 0.5rem;
}

/* Checkboxes and Radio Buttons */
.filter-option {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.filter-checkbox,
.filter-radio {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.filter-checkbox input,
.filter-radio input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 18px;
  width: 18px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  margin-right: 10px;
  position: relative;
  transition: var(--transition);
}

.filter-radio .checkmark {
  border-radius: 50%;
}

.filter-checkbox input:checked ~ .checkmark,
.filter-radio input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkmark:after {
  content: '';
  position: absolute;
  display: none;
}

.filter-checkbox input:checked ~ .checkmark:after,
.filter-radio input:checked ~ .checkmark:after {
  display: block;
}

.filter-checkbox .checkmark:after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-radio .checkmark:after {
  left: 6px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

.filter-checkbox:hover .checkmark,
.filter-radio:hover .checkmark {
  border-color: var(--primary-color);
}

.custom-date-input {
  margin-top: 0.75rem;
  display: none;
}

.custom-date-input.active {
  display: block;
}

.custom-date-input input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
}

.custom-date-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Sidebar Filter Actions */
.sidebar-actions {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--card-bg);
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  gap: 0.75rem;
}

.btn-apply {
  flex: 1;
  padding: 0.75rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-apply:hover {
  background-color: var(--primary-dark);
}

.btn-reset {
  flex: 1;
  padding: 0.75rem;
  background-color: transparent;
  color: var(--light-text);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-reset:hover {
  background-color: var(--background);
  color: var(--text-color);
}

/* Events Content Area */
.events-content {
  flex: 1;
  min-width: 0;
}

/* Events Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Event Card */
.event-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.event-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.event-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.event-card:hover .event-image img {
  transform: scale(1.05);
}

.event-date-badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.featured-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--primary-color);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.event-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.event-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
  line-height: 1.4;
}

.event-meta {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  color: var(--light-text);
  font-size: 0.875rem;
}

.event-meta i {
  color: var(--primary-color);
  margin-right: 0.5rem;
  font-size: 1rem;
}

.event-description {
  margin: 0.75rem 0;
  color: var(--light-text);
  font-size: 0.875rem;
  line-height: 1.5;
  flex-grow: 1;
}

.event-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-price {
  font-weight: 600;
  color: var(--primary-color);
}

.event-action {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.btn-book {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
  border: none;
}

.btn-book:hover {
  background-color: var(--primary-dark);
  color: white;
  text-decoration: none;
}

/* Loading Indicator */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}

.loading-spinner {
  border: 3px solid var(--primary-light);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--light-text);
  font-weight: 500;
}

/* No Events Found */
.no-events {
  text-align: center;
  padding: 3rem 1.5rem;
  background-color: var(--background);
  border-radius: var(--border-radius);
}

.no-events-icon {
  font-size: 3rem;
  color: var(--light-text);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.no-events h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.no-events p {
  color: var(--light-text);
  max-width: 500px;
  margin: 0 auto;
}

/* Pagination */
.pagination-container {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-item {
  margin: 0 0.25rem;
}

.page-link,
.page-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--text-color);
  transition: var(--transition);
  font-weight: 500;
  text-decoration: none;
}

.page-item:not(.active) .page-link:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.page-item.active span {
  background-color: var(--primary-color);
  color: white;
}

.page-item.disabled span {
  color: var(--lighter-text);
  cursor: not-allowed;
}

/* Mobile Styles */
@media (max-width: 991.98px) {
  .events-container {
    flex-direction: column;
  }

  .events-sidebar {
    width: 100%;
    position: static;
    margin-bottom: 1.5rem;
    max-height: none;
  }

  .sidebar-content {
    max-height: none;
  }
}

@media (max-width: 767.98px) {
  .events-sidebar {
    display: none;
  }

  .events-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  .mobile-filter-visible {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background-color: var(--card-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
  }

  @keyframes slideIn {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .mobile-filter-visible .sidebar-header {
    flex-shrink: 0;
  }

  .mobile-filter-visible .sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 2rem;
  }

  .mobile-filter-visible .sidebar-actions {
    flex-shrink: 0;
  }

  .close-filters {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
  }

  .close-filters:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
  }
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  cursor: pointer;
}

.mobile-filter-toggle i {
  font-size: 1.25rem;
}

@media (max-width: 767.98px) {
  .mobile-filter-toggle {
    display: flex;
  }
}

/* Filter count badge */
.filter-count {
  background-color: var(--primary-color);
  color: white;
  border-radius: 100px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Filter Tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: var(--primary-light);
  color: var(--primary-color);
  padding: 0.375rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

.filter-tag i {
  margin-left: 0.5rem;
  cursor: pointer;
}

/* Top Filter Bar (mobile only) */
.top-filter-bar {
  display: none;
  margin-bottom: 1.5rem;
}

@media (max-width: 767.98px) {
  .top-filter-bar {
    display: block;
  }

  .filter-search-mobile {
    margin-bottom: 1rem;
  }

  .filter-search-mobile input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
  }
}

/* Backdrop */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1049;
  display: none;
}

.backdrop.show {
  display: block;
}
