/**
 * @file
 * Styles for the main FAI Events page.
 */

.fai-events-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Page Header */
.events-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.events-title-section h1 {
  margin: 0 0 5px 0;
  font-size: 2.5em;
  color: #333;
}

.events-title-section .page-description {
  margin: 0;
  color: #666;
  font-size: 1.1em;
}

/* Page Content Layout */
.events-page-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

/* Sidebar Styles */
.events-sidebar {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 20px;
}

.events-sidebar h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.3em;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 10px;
}

.facet-section {
  margin-bottom: 25px;
}

.facet-section h4 {
  margin: 0 0 10px 0;
  color: #555;
  font-size: 1em;
  font-weight: 600;
}

.facet-section:last-child {
  margin-bottom: 0;
}

/* Search Box */
.event-search {
  display: flex;
  gap: 5px;
}

.event-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.event-search button {
  padding: 8px 12px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.event-search button:hover {
  background: #0052a3;
}

/* Clear filters button */
#clear-all-filters {
  width: 100%;
  padding: 10px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#clear-all-filters:hover {
  background: #c82333;
}

/* Main Content Area */
.events-main-content {
  min-height: 500px;
}

/* List Display Mode */
.events-list-display {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.events-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.section-header {
  background: linear-gradient(135deg, #0066cc, #004499);
  color: white;
  padding: 20px;
  margin-bottom: 0;
}

.section-title {
  margin: 0 0 5px 0;
  font-size: 1.5em;
  font-weight: 600;
}

.section-description {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95em;
}

.events-grid {
  padding: 20px;
}

/* Map Display Mode */
.events-map-display {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  height: 600px;
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.events-map {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1.1em;
}

.map-sidebar {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.map-sidebar h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.2em;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/* Timeline Display Mode */
.events-timeline-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-container {
  height: 500px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}

.events-timeline {
  width: 100%;
  height: 100%;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 1.1em;
}

.timeline-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.timeline-controls .btn {
  padding: 10px 20px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.timeline-controls .btn:hover {
  background: #0052a3;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  background: white;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .events-page-content {
    grid-template-columns: 250px 1fr;
    gap: 20px;
  }
  
  .events-map-display {
    grid-template-columns: 1fr 250px;
  }
}

@media (max-width: 768px) {
  .fai-events-page {
    padding: 15px;
  }
  
  .events-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .events-page-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .events-sidebar {
    order: 2;
    position: static;
  }
  
  .events-map-display {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .map-container {
    height: 400px;
  }
  
  .events-title-section h1 {
    font-size: 2em;
  }
}

/* Display mode specific styles */
.fai-events-page[data-display-mode="map"] .events-list-display {
  display: none;
}

.fai-events-page[data-display-mode="timeline"] .events-list-display {
  display: none;
}

.fai-events-page[data-display-mode="list"] .events-map-display,
.fai-events-page[data-display-mode="list"] .events-timeline-display {
  display: none;
}

.fai-events-page[data-display-mode="map"] .events-timeline-display {
  display: none;
}

.fai-events-page[data-display-mode="timeline"] .events-map-display {
  display: none;
}