/* Cancellations Tracker Page Styles */

.cancellations-page {
  min-height: 100vh;
  padding: 2rem 0;
}

.cancellations-container {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 1400px;
}

/* Main Layout: Map (75%) and Sidebar (25%) */
.main-layout {
  display: grid;
  grid-template-columns: 3fr 1fr; /* 75% and 25% */
  gap: 2rem;
}

/* Map Section (75%) */
.map-section {
  display: flex;
  flex-direction: column;
}

.map-section .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-section .card-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-section .card-body {
  flex: 1;
  overflow: hidden;
}

/* Sidebar Section (25%) */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Filter Section */
.filter-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem;
  flex-shrink: 0;
}

.filter-section h4 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
  font-size: 1rem;
  font-weight: 600;
}

.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-btn {
  background: white;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  width: 100%;
}

.filter-btn:hover {
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.filter-btn.active {
  background: #f8f9fa;
  border-color: #667eea;
}

.filter-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.all-color {
  background: #6c757d; /* Gray for all */
}

.active-color {
  background: #28a745; /* Green for active */
}

.cancelled-color {
  background: #dc3545; /* Red for cancelled */
}

.recent-color {
  background: #fd7e14; /* Orange for future */
}

.filter-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.filter-name {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
}

.filter-count {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
}

.filter-btn.active .filter-name {
  color: #667eea;
  font-weight: 700;
}

.filter-btn.active .filter-count {
  color: #667eea;
}

.search-container {
  position: relative;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: #6c757d;
  font-size: 1.2rem;
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.clear-search:hover {
  background: #f8f9fa;
  color: #dc3545;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e1e5e9;
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-result-item {
  padding: 1rem;
  border-bottom: 1px solid #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item:hover {
  background: #f8f9fa;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-info {
  flex: 1;
}

.search-result-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.search-result-location {
  font-size: 0.9rem;
  color: #6c757d;
}

.search-result-status {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: #e8f5e8;
  color: #28a745;
}

.status-cancelled {
  background: #fee;
  color: #dc3545;
}

.status-recent {
  background: #fff3cd;
  color: #856404;
}

/* Favorites Section */
.favorites-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex item to shrink */
}

.favorites-container h3 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.favorites-container h3 i {
  color: #e74c3c;
}

.favorites-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* Allow flex item to shrink */
}

.favorite-item {
  background: white;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e1e5e9;
}

.favorite-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.favorite-info {
  flex: 1;
}

.favorite-name {
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.favorite-location {
  font-size: 0.8rem;
  color: #6c757d;
}

.favorite-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.favorite-status {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.remove-favorite {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.remove-favorite:hover {
  background: #fee;
}

.no-favorites {
  text-align: center;
  padding: 2rem 1rem;
  color: #6c757d;
}

.no-favorites i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #adb5bd;
}

.no-favorites p {
  font-size: 0.9rem;
  margin: 0;
}

/* Card Component */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e1e5e9;
  background: #f8f9fa;
}

.card-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header i {
  color: #667eea;
  font-size: 1.3rem;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.card-body {
  padding: 0;
}

.map-container {
  height: 500px;
  width: 100%;
  position: relative;
  background: #f8f9fa;
  border: 1px solid #e1e5e9;
  border-radius: 12px;
}

.card-footer {
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-top: 1px solid #e1e5e9;
}

.map-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #6c757d;
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
}

/* Mapbox Styles */
#mapbox-container {
  border-radius: 0;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.mapboxgl-popup {
  max-width: 300px;
}

.mapboxgl-popup-content {
  padding: 1rem;
  border-radius: 8px;
}

.popup-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.popup-details {
  font-size: 0.9rem;
  color: #6c757d;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr; /* Stack vertically on tablets */
    height: auto;
    gap: 1.5rem;
  }
  
  .map-section .card {
    height: 60vh; /* Reduced height on tablets */
  }
  
  .sidebar-section {
    flex-direction: row;
    gap: 1rem;
  }
  
  .filter-section {
    order: -1;
    grid-template-columns: 1fr 1fr;
  }
  
  .search-container {
    flex: 1;
  }
  
  .favorites-container {
    flex: 1;
    min-height: 300px;
  }
}

@media (max-width: 768px) {
  .cancellations-container {
    margin: 1rem;
    padding: 1rem;
    max-width: none;
  }
  
  .main-layout {
    gap: 1rem;
  }
  
  .map-section .card {
    height: 50vh; /* Further reduced height on mobile */
  }
  
  .sidebar-section {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filter-buttons {
    gap: 0.4rem;
  }
  
  .filter-btn {
    padding: 0.6rem;
    gap: 0.5rem;
  }
  
  .filter-indicator {
    width: 14px;
    height: 14px;
  }
  
  .filter-name {
    font-size: 0.8rem;
  }
  
  .filter-count {
    font-size: 0.7rem;
  }
  
  .search-box input {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-size: 0.9rem;
  }
  
  .search-icon {
    left: 0.75rem;
    font-size: 1rem;
  }
  
  .clear-search {
    right: 0.75rem;
  }
  
  .favorites-container {
    padding: 1rem;
    min-height: 250px;
  }
  
  .favorites-container h3 {
    font-size: 1rem;
  }
  
  .favorite-item {
    padding: 0.5rem;
    margin-bottom: 0.25rem;
  }
  
  .favorite-name {
    font-size: 0.8rem;
  }
  
  .favorite-location {
    font-size: 0.7rem;
  }
  
  .no-favorites {
    padding: 1rem 0.5rem;
  }
  
  .no-favorites i {
    font-size: 1.5rem;
  }
  
  .no-favorites p {
    font-size: 0.8rem;
  }
  
  .card-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .map-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .card-header,
  .card-footer {
    padding: 1rem;
  }
  
  .map-section .card {
    height: 40vh; /* Even smaller on very small screens */
  }
  
  .map-container {
    min-height: 400px; /* Big min height on mobile sizes */
  }
}

.mapboxgl-map {
  min-height: 600px !important;
}