/**
 * Monthly Event Chart CSS
 * 
 * A responsive, mobile-first Event chart for Events and Shows Management System
 * 
 * Version 3.47.2
 * Implementation Date: 2024-12-20
 * 
 * Latest Updates (v3.47.2):
 * - COMPLETED: Event spanner bar colors working with gradient/fade effect
 * - Maintained CSS custom properties and multi-layered color approach
 * - Clean implementation without debug overhead
 * 
 * Previous Updates (v3.47.1):
 * - ENHANCED: Added CSS custom properties support for event colors
 * - Added .dynamic-color class with CSS variable fallback mechanism
 * - Enhanced color system with multiple fallback approaches
 * - CSS now uses var(--event-color) with !important for reliable color display
 * 
 * Previous Updates (v3.47.0):
 * - FIX: Removed default background-color from .event-event-bar class
 * - Event colors now set dynamically by JavaScript without CSS override conflicts
 * - Enhanced color system to properly display individual event colors
 * - Fixed CSS specificity issues that prevented custom event colors
 * 
 * Previous Updates (v3.46.5):
 * - No CSS changes required for multi-day popup fix
 * - Multi-day event date formatting handled entirely in JavaScript
 * - Maintains all existing responsive design features
 * 
 * Previous Updates (v3.46.4):
 * - No CSS changes required for mobile hover fix
 * - Mobile hover detection handled entirely in JavaScript
 * - Maintains all existing responsive design features
 * 
 * Previous Updates (v3.45.1):
 * - Added car badge styling for events with show_id
 * - Car badge appears as small gold circle with car icon next to event number badge
 * - Responsive sizing to fit within spanner bars
 * 
 * Previous Updates (v3.45.0):
 * - Added styling for blank day cells (.blank-day class)
 * - Blank days have dashed borders and reduced opacity
 * - Supports Sunday-to-Saturday calendar layout with blank cells
 * 
 * Previous Updates (v3.44.1):
 * - Reduced spanner bar thickness from 32px to 16px (50% reduction)
 * - Adjusted border-radius from 16px to 8px for proportional appearance
 * - Reduced event bar badge size from 22px to 16px to fit thinner bars
 * - Updated font sizes and padding for better visual balance
 * - Maintained timeline background bar consistency with event bar height
 * 
 * Previous Updates (v3.44.0):
 * - Added timeline dates at bottom of white space area
 * - Shows event's actual start/end times with full span
 * - Format: Single-day "Dec 1 • 9:00 AM - 5:00 PM", Multi-day "Dec 1, 9:00 AM - Dec 3, 5:00 PM"
 * - Small, non-intrusive text positioned at bottom left of timeline
 * 
 * Previous Updates (v3.43.1):
 * - Fixed timeline background: created thin grey bar using ::before pseudo-element
 * - Timeline bar spans entire week width with same height as event bars (16px)
 * - Event bars appear on top with proper z-index layering
 * - White space maintained above and below the thin timeline bar
 * 
 * Previous Updates (v3.43.0):
 * - Fixed event bar positioning to use CSS Grid instead of absolute positioning
 * - Enhanced badge styling for prominence (badges only in spanner bars)
 * - Added proper margins and centering for event bars
 * - Updated hover and drag effects for grid-based positioning
 * 
 * Previous Updates (v3.42.0):
 * - Added colored week header backgrounds
 * - Implemented badge styles for events and spanner bars
 * - Enhanced event info layout with date/time and location
 * - Improved drag and drop visual feedback
 * - Added hover effects for clickable elements
 */

/* Global box-sizing for consistent sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Event Container */
.event-container {
  width: 100%;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

/* Event Header */
.event-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  position: sticky;
  top: 0;
  z-index: 100;
}

.event-timeline-header {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 60px;
  align-items: center;
  overflow: hidden; /* Prevent overflow */
}

.event-timeline-header .event-event-column-header {
  padding: 15px 20px;
  font-weight: 600;
  color: #495057;
  border-right: 1px solid #dee2e6;
  background-color: #f8f9fa;
}

.event-timeline-days {
  display: grid;
  gap: 1px;
  background-color: #dee2e6;
  padding: 1px;
  overflow: hidden; /* Prevent day headers from overflowing */
  /* Grid columns will be set dynamically by JavaScript */
}

.event-day-header {
  background-color: #fff;
  padding: 8px 2px; /* Reduced padding to prevent overflow */
  text-align: center;
  font-size: 0.8rem; /* Slightly smaller font */
  font-weight: 500;
  color: #495057;
  border-radius: 2px;
  transition: background-color 0.2s ease;
  min-width: 0; /* Allow shrinking */
  overflow: hidden; /* Hide overflow text */
}

.event-day-header.today {
  background-color: #3788d8;
  color: white;
  font-weight: 600;
}

.event-day-header.weekend {
  background-color: #f8f9fa;
  color: #6c757d;
}

.event-day-header.blank-day {
  background-color: #f8f9fa;
  color: transparent;
  border: 1px dashed #dee2e6;
  opacity: 0.5;
}

/* Event Body */
.event-body {
  position: relative;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.event-events-container {
  position: relative;
}

/* Event Rows */
.event-event-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 50px;
  border-bottom: 1px solid #e9ecef;
  align-items: center;
  transition: background-color 0.2s ease;
  position: relative;
  overflow: hidden; /* Prevent content from overflowing */
}

.event-event-row:hover {
  background-color: #f8f9fa;
}

.event-event-row:last-child {
  border-bottom: none;
}

/* Event Info Column */
.event-event-info {
  padding: 12px 20px;
  border-right: 1px solid #dee2e6;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.event-event-info::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--event-color, #3788d8);
}

.event-event-title {
  font-weight: 600;
  color: #212529;
  margin-bottom: 4px;
  font-size: 0.95rem;
  line-height: 1.3;
}

.event-event-details {
  font-size: 0.8rem;
  color: #6c757d;
  line-height: 1.2;
}

.event-event-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-event-location i {
  width: 12px;
  text-align: center;
}

/* Event Badge Styles */
.event-badge {
  display: inline-block;
  background-color: #3788d8;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0;
}

.event-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.event-title {
  font-weight: 600;
  color: #212529;
  font-size: 0.95rem;
  line-height: 1.3;
  cursor: pointer;
}

.event-title:hover {
  color: #3788d8;
  text-decoration: underline;
}



/* Timeline Column */
.event-timeline {
  position: relative;
  padding: 8px 0;
  display: grid;
  gap: 1px;
  background-color: transparent;
  overflow: hidden; /* Prevent timeline from overflowing */
  /* Grid columns will be set dynamically by JavaScript to match header */
}

/* Event Bars */
.event-event-bar {
  height: 16px;
  background: linear-gradient(135deg, var(--event-color, #3788d8), var(--event-color-dark, #2d6fae));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  margin: 4px 2px; /* Add small margin for visual separation */
  align-self: center; /* Center vertically in grid cell */
}

.event-event-bar:hover {
  transform: scale(1.05) translateZ(0);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  z-index: 20;
  border-color: rgba(255, 255, 255, 0.4);
}

.event-event-bar:hover::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent, rgba(255, 255, 255, 0.3));
  border-radius: 18px;
  z-index: -1;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.event-event-bar.dragging {
  opacity: 0.8;
  transform: scale(1.05);
  z-index: 30;
}

.event-event-bar-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.2;
}

/* Event Bar Badge */
.event-bar-badge {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.95);
  color: #333;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Car Badge for Car Show Events (general) */
.event-car-badge {
  display: inline-block;
  background-color: rgba(255, 215, 0, 0.95); /* Gold background */
  color: #333;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  text-align: center;
  line-height: 14px;
  font-size: 0.5rem;
  margin-left: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}



.event-bar-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Draggable styles */
.event-event-bar.draggable {
  cursor: move;
}

.event-event-bar.dragging {
  opacity: 0.6;
  transform: scale(1.05);
  z-index: 1000;
}

/* Today Indicator Line */
.event-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #dc3545, #c82333);
  z-index: 50;
  pointer-events: none;
  opacity: 0.9;
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
  animation: todayLinePulse 3s ease-in-out infinite;
}

.event-today-line::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  width: 15px;
  height: 15px;
  background: radial-gradient(circle, #dc3545, #c82333);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  animation: todayMarkerPulse 2s ease-in-out infinite;
}

.event-today-line::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 9px;
  height: 9px;
  background-color: rgba(220, 53, 69, 0.3);
  border-radius: 50%;
  animation: todayRipple 2s ease-out infinite;
}

@keyframes todayLinePulse {
  0%, 100% { opacity: 0.9; box-shadow: 0 0 10px rgba(220, 53, 69, 0.5); }
  50% { opacity: 1; box-shadow: 0 0 20px rgba(220, 53, 69, 0.8); }
}

@keyframes todayMarkerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes todayRipple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* Navigation Controls */
.event-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-nav-controls .btn {
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.event-nav-controls .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced Event Popup */
.event-event-popup {
  position: absolute;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 0;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  max-width: 320px;
  min-width: 280px;
  border: 1px solid #e9ecef;
}

.event-event-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.event-event-popup .popup-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.event-event-popup .popup-header h5 {
  margin: 0;
  color: #212529;
  font-weight: 600;
  font-size: 1.1rem;
}

.event-event-popup .popup-body {
  padding: 16px 20px;
}

.event-event-popup .popup-detail {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #495057;
}

.event-event-popup .popup-detail:last-child {
  margin-bottom: 0;
}

.event-event-popup .popup-detail i {
  width: 20px;
  color: #6c757d;
  flex-shrink: 0;
}

.event-event-popup .popup-description {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e9ecef;
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
}

.event-event-popup .popup-actions {
  padding: 12px 20px 16px;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Event Table Enhancements */
.event-events-table .table {
  margin-bottom: 0;
}

.event-events-table .event-color-indicator {
  width: 4px;
  height: 20px;
  border-radius: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}

.event-event-row {
  cursor: pointer;
  transition: all 0.2s ease;
}

.event-event-row:hover {
  background-color: #f8f9fa;
  transform: translateX(2px);
}

/* Mobile Responsive Design */
@media (max-width: 991.98px) {
  /* Hide desktop event chart */
  .event-container {
    display: none !important;
  }
  
  /* Show mobile list view */
  .event-mobile {
    display: block !important;
  }
  
  .mobile-events-list {
    padding: 0;
  }
  
  .mobile-event-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--event-color, #3788d8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }
  
  .mobile-event-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  }
  
  .mobile-event-card:active {
    transform: translateY(-2px) scale(1.01);
    transition: all 0.1s ease;
  }
  
  .mobile-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--event-color, #3788d8), var(--event-color-dark, #2d6fae));
  }
  
  .mobile-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
  }
  
  .mobile-event-title {
    font-weight: 600;
    color: #212529;
    font-size: 1.1rem;
    line-height: 1.3;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .mobile-event-title .event-car-badge {
    font-size: 0.8rem;
    margin-left: 8px;
  }
  
  .mobile-event-date {
    background: var(--event-color, #3788d8);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
  }
  
  .mobile-event-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
  }
  
  .mobile-event-detail {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
  }
  
  .mobile-event-detail i {
    width: 16px;
    margin-right: 8px;
    color: #495057;
  }
  
  .mobile-event-timeline {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
  }
  
  .mobile-timeline-bar {
    height: 6px;
    background: linear-gradient(90deg, var(--event-color, #3788d8), var(--event-color-dark, #2d6fae));
    border-radius: 3px;
    position: relative;
    margin: 4px 0;
  }
  
  .mobile-timeline-dates {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
  }
  
  .mobile-event-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
  }
  
  .mobile-event-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
  .mobile-event-details {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Small mobile adjustments */
@media (max-width: 575.98px) {
  .mobile-event-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .mobile-event-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .event-timeline-header {
    grid-template-columns: 200px 1fr;
  }
  
  .event-event-info {
    padding: 8px 12px;
  }
  
  .event-event-title {
    font-size: 0.9rem;
  }
  
  .event-event-details {
    font-size: 0.75rem;
  }
}

/* Animation keyframes */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Staggered animation for event rows */
.event-event-row {
  animation: slideInFromLeft 0.6s ease-out;
}

.event-event-row:nth-child(1) { animation-delay: 0.1s; }
.event-event-row:nth-child(2) { animation-delay: 0.2s; }
.event-event-row:nth-child(3) { animation-delay: 0.3s; }
.event-event-row:nth-child(4) { animation-delay: 0.4s; }
.event-event-row:nth-child(5) { animation-delay: 0.5s; }
.event-event-row:nth-child(n+6) { animation-delay: 0.6s; }

/* Staggered animation for mobile cards */
.mobile-event-card {
  animation: scaleIn 0.5s ease-out;
}

.mobile-event-card:nth-child(1) { animation-delay: 0.1s; }
.mobile-event-card:nth-child(2) { animation-delay: 0.2s; }
.mobile-event-card:nth-child(3) { animation-delay: 0.3s; }
.mobile-event-card:nth-child(4) { animation-delay: 0.4s; }
.mobile-event-card:nth-child(5) { animation-delay: 0.5s; }
.mobile-event-card:nth-child(n+6) { animation-delay: 0.6s; }

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Loading states */
.event-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: #6c757d;
}

.event-loading i {
  animation: pulse 1.5s ease-in-out infinite;
  font-size: 2rem;
  margin-right: 12px;
}

/* Accessibility improvements */
.event-event-bar:focus,
.mobile-event-card:focus {
  outline: 2px solid #3788d8;
  outline-offset: 2px;
}

/* Event Hover Popup */
.event-event-hover-popup {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 12px;
  max-width: 300px;
  font-size: 0.875rem;
  line-height: 1.4;
  pointer-events: none;
}

.event-event-hover-popup::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

.event-event-hover-popup::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #dee2e6;
  z-index: -1;
}

.hover-popup-header h6 {
  color: #495057;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.hover-popup-header .event-car-badge {
  font-size: 0.7rem;
  margin-left: 6px;
}

.hover-popup-body {
  color: #6c757d;
  font-size: 0.8rem;
}

.hover-popup-body div {
  margin-bottom: 4px;
}

.hover-popup-body div:last-child {
  margin-bottom: 0;
}

.hover-popup-body i {
  width: 14px;
  color: #6c757d;
}

/* Weekly Event Chart Layout */
.event-weeks-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem 0;
}

.event-week-section {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.event-week-header {
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.event-week-title {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.event-week-title h5 {
  color: #495057;
  font-weight: 600;
}

.event-week-days {
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  min-height: 60px;
}

.event-event-column-header {
  padding: 1rem;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  text-align: center;
}

.event-day-headers {
  display: grid;
  gap: 1px;
  background-color: #dee2e6;
  padding: 1px;
}

.event-day-header {
  background-color: #fff;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.875rem;
  color: #495057;
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.event-day-header.today {
  background-color: #e3f2fd;
  color: #1976d2;
  font-weight: 600;
}

.event-day-header.weekend {
  background-color: #f5f5f5;
  color: #6c757d;
}

.event-day-header .day-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.event-day-header .day-number {
  font-size: 1.1rem;
  font-weight: 700;
}

.event-week-events {
  position: relative;
}

.event-event-row {
  position: relative; /* Enable absolute positioning for timeline dates */
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 60px;
  border-bottom: 1px solid #e9ecef;
  align-items: stretch; /* Allow timeline to fill full height */
  transition: background-color 0.2s ease;
}

.event-event-row:hover {
  background-color: #f8f9fa;
}

.event-event-row:last-child {
  border-bottom: none;
}

.event-event-info {
  padding: 12px 16px;
  border-right: 1px solid #dee2e6;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center content vertically */
}

.event-event-info:hover {
  background-color: rgba(55, 136, 216, 0.05);
}

.event-event-info .event-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.event-event-info .event-badge {
  display: inline-block;
  background-color: #3788d8;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0;
}

.event-event-info .event-title {
  font-weight: 600;
  color: #212529;
  font-size: 0.95rem;
  line-height: 1.3;
  cursor: pointer;
}

.event-event-info .event-title:hover {
  color: #3788d8;
  text-decoration: underline;
}



.event-timeline {
  position: relative;
  padding: 8px; /* Back to normal padding */
  display: grid;
  gap: 1px;
  background-color: transparent;
  align-items: center; /* Keep event bars centered */
  height: 100%; /* Fill the full row height */
  box-sizing: border-box;
}

/* Thin grey timeline bar that spans the entire week */
.event-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 16px; /* Same height as event bars */
  background-color: #f8f9fa;
  border-radius: 8px;
  z-index: 1;
}

/* Timeline dates at bottom of white space - positioned relative to timeline */
.event-timeline-dates {
  position: absolute;
  bottom: 0px; /* Move to very bottom edge */
  left: 8px; /* Match timeline padding */
  right: 8px; /* Match timeline padding */
  font-size: 0.7rem;
  color: #6c757d; /* Normal grey color */
  font-weight: 500;
  z-index: 10; /* Higher z-index to ensure visibility */
  line-height: 1.2;
  pointer-events: none;
  text-align: left; /* Ensure left alignment */
  height: 14px; /* Smaller height */
  display: flex;
  align-items: center; /* Center text vertically within the small area */
}

.event-event-bar {
  /* background-color removed - set dynamically by JavaScript */
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2; /* Appear above the grey timeline bar */
}

/* Dynamic color classes for event bars */
.event-event-bar.dynamic-color {
  /* This class will be added to bars with custom colors */
  /* Use CSS custom property as fallback if inline styles don't work */
  background-color: var(--event-color, #3788d8) !important;
}

.event-event-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.event-event-bar .event-bar-badge {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.9);
  color: #333;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
  font-size: 0.6rem;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Car Badge for Car Show Events */
.event-event-bar .event-car-badge {
  display: inline-block;
  background-color: rgba(255, 215, 0, 0.95); /* Gold background */
  color: #333;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  text-align: center;
  line-height: 14px;
  font-size: 0.5rem;
  margin-left: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.event-event-bar .event-bar-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.event-event-bar.draggable {
  cursor: move;
}

.event-event-bar.dragging {
  opacity: 0.6;
  transform: translateY(-1px) scale(1.05);
  z-index: 1000;
}

/* Drop zone styles for drag and drop */
.event-timeline.drop-zone {
  background-color: rgba(55, 136, 216, 0.1);
  border: 2px dashed #3788d8;
}

.event-timeline.drop-zone-active {
  background-color: rgba(55, 136, 216, 0.2);
  border-color: #2d6fae;
}

.event-no-events {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 60px;
  align-items: center;
  color: #6c757d;
  font-style: italic;
}

.event-no-events .event-event-column {
  padding: 1rem;
  text-align: center;
  border-right: 1px solid #dee2e6;
}

.event-timeline-empty {
  background-color: transparent;
  display: grid;
  gap: 1px;
  padding: 1px;
}

.event-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #dc3545;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(220, 53, 69, 0.5);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .event-week-days {
    grid-template-columns: 200px 1fr;
  }
  
  .event-event-row {
    grid-template-columns: 200px 1fr;
  }
  
  .event-event-info {
    padding: 8px 12px;
  }
  
  .event-event-info .event-title {
    font-size: 0.875rem;
  }
  
  .event-event-info .event-details {
    font-size: 0.75rem;
  }
  
  .event-day-header {
    padding: 8px 4px;
    font-size: 0.75rem;
  }
  
  .event-day-header .day-name {
    font-size: 0.65rem;
  }
  
  .event-day-header .day-number {
    font-size: 0.9rem;
  }
  
  .event-event-bar {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-height: 28px;
  }
}

@media (max-width: 576px) {
  .event-week-days {
    grid-template-columns: 150px 1fr;
  }
  
  .event-event-row {
    grid-template-columns: 150px 1fr;
  }
  
  .event-event-column-header {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  .event-day-header {
    padding: 6px 2px;
  }
  
  .event-day-header .day-name {
    display: none; /* Hide day names on very small screens */
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .event-event-bar {
    border: 2px solid currentColor;
  }
  
  .event-today-line {
    background-color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .event-event-bar,
  .mobile-event-card,
  .event-event-popup {
    transition: none;
  }
  
  .event-loading i {
    animation: none;
  }
}

/* Print styles */
@media print {
  .event-nav-controls,
  .mobile-event-actions,
  .popup-actions {
    display: none;
  }
  
  .event-container,
  .mobile-events-list {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .event-event-popup {
    display: none;
  }
}