/* fb Timetable Frontend Styles */
.fb-timetable-container {
  max-width: 100%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.fb-timetable-filters {
  margin-bottom: 20px;
}

.fb-timetable-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 2px solid #e1e5e9;
  margin-bottom: 20px;
}

.fb-timetable-tab {
  padding: 12px 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-bottom: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: #495057;
  text-decoration: none;
  border-radius: 4px 4px 0 0;
}

.fb-timetable-tab:hover {
  background: #e9ecef;
  color: #212529;
  text-decoration: none;
}

.fb-timetable-tab.active {
  background: #007cba;
  color: white;
  border-color: #007cba;
}

.fb-timetable-dropdown {
  margin-bottom: 20px;
}

.fb-timetable-dropdown select {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  min-width: 200px;
  background: white;
}

/* Desktop Timetable Grid */
.fb-timetable-grid {
  display: block;
  overflow-x: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fb-timetable-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  table-layout: fixed;
}

.fb-timetable-header {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.fb-timetable-header th {
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  color: #495057;
  border-right: 1px solid #dee2e6;
  font-size: 14px;
}

.fb-timetable-header th:first-child {
  width: 80px;
  background: #e9ecef;
}

.fb-timetable-header th:last-child {
  border-right: none;
}

.fb-timetable-time-column {
  background: #f8f9fa;
  text-align: center;
  font-weight: 500;
  color: #6c757d;
  border-right: 1px solid #dee2e6;
  padding: 10px 5px;
  vertical-align: top;
  font-size: 13px;
}

.fb-timetable-cell {
  border: 1px solid #dee2e6;
  padding: 0;
  vertical-align: top;
  position: relative;
  height: 60px;
  width: calc((100% - 80px) / 6);
}

.fb-timetable-event {
  display: block;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  padding: 8px;
  color: white;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  transition: opacity 0.3s ease;
  overflow: hidden;
  border-radius: 4px;
  margin: 2px;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.fb-timetable-event:hover {
  opacity: 0.9;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.fb-timetable-event-title {
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fb-timetable-event-time {
  font-size: 11px;
  opacity: 0.9;
  margin-bottom: 1px;
}

.fb-timetable-event-description {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile List View */
.fb-timetable-mobile {
  display: none;
}

.fb-timetable-day {
  margin-bottom: 30px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.fb-timetable-day-header {
  background: #007cba;
  color: white;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 18px;
}

.fb-timetable-day-events {
  padding: 0;
}

.fb-timetable-mobile-event {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
  transition: background-color 0.3s ease;
}

.fb-timetable-mobile-event:hover {
  background-color: #f8f9fa;
  text-decoration: none;
  color: #333;
}

.fb-timetable-mobile-event:last-child {
  border-bottom: none;
}

.fb-timetable-mobile-time {
  flex: 0 0 100px;
  font-weight: 600;
  color: #007cba;
  font-size: 14px;
}

.fb-timetable-mobile-details {
  flex: 1;
  margin-left: 15px;
}

.fb-timetable-mobile-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
  font-size: 16px;
}

.fb-timetable-mobile-description {
  font-size: 13px;
  color: #666;
}

.fb-timetable-mobile-color {
  flex: 0 0 4px;
  height: 40px;
  border-radius: 2px;
  margin-right: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .fb-timetable-grid {
    display: none;
  }

  .fb-timetable-mobile {
    display: block;
  }

  .fb-timetable-tabs {
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
  }

  .fb-timetable-tab {
    padding: 10px 15px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .fb-timetable-dropdown select {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .fb-timetable-tabs {
    flex-direction: column;
    gap: 2px;
  }

  .fb-timetable-tab {
    text-align: center;
    border-radius: 4px;
    border-bottom: 1px solid #dee2e6;
  }

  .fb-timetable-mobile-time {
    flex: 0 0 80px;
    font-size: 13px;
  }

  .fb-timetable-mobile-details {
    margin-left: 10px;
  }

  .fb-timetable-mobile-title {
    font-size: 15px;
  }

  .fb-timetable-day-header {
    padding: 12px 15px;
    font-size: 16px;
  }

  .fb-timetable-mobile-event {
    padding: 12px 15px;
  }
}

/* Loading State */
.fb-timetable-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.fb-timetable-loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-top: 2px solid #007cba;
  border-radius: 50%;
  animation: fb-spin 1s linear infinite;
  margin-left: 10px;
}

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

/* Empty State */
.fb-timetable-empty {
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Hidden elements for filtering */
.fb-timetable-event[style*="display: none"],
.fb-timetable-mobile-event[style*="display: none"] {
  display: none !important;
}
