/**
 * Seamless Addon - Events Widget Styles
 */

/* Common Item Styles */
.seamless-item {
  margin-bottom: 30px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.seamless-item-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px 0;
  color: #333;
}

.seamless-item-content {
  color: #666;
  line-height: 1.6;
}

.seamless-item-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.seamless-item-date,
.seamless-item-location,
.seamless-item-time {
  display: flex;
  align-items: center;
  margin: 8px 0;
  color: #666;
  font-size: 14px;
}

.seamless-icon {
  margin-right: 6px;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.seamless-item-excerpt {
  margin: 15px 0;
  color: #666;
}

.seamless-item-footer {
  margin-top: 15px;
}

.seamless-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #0073aa;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.seamless-btn:hover {
  background-color: #005177;
  color: #fff;
}

.seamless-btn-link {
  color: #0073aa;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.seamless-btn-link:hover {
  color: #005177;
}

/* Grid Layout */
.seamless-layout-grid {
  display: grid;
  gap: 30px;
}

.seamless-grid-cols-1 {
  grid-template-columns: 1fr;
}

.seamless-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.seamless-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.seamless-grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.seamless-layout-grid .seamless-item {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.seamless-layout-grid .seamless-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.seamless-layout-grid .seamless-item-content {
  padding: 20px;
}

/* Timeline Layout */
.seamless-layout-timeline {
  position: relative;
}

.seamless-timeline-item {
  display: grid;
  grid-template-columns: 80px 40px 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.seamless-timeline-date {
  text-align: center;
  padding: 10px;
}

.seamless-timeline-month {
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 600;
  color: #0073aa;
}

.seamless-timeline-day {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.seamless-timeline-connector {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seamless-timeline-dot {
  width: 16px;
  height: 16px;
  background: #0073aa;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #0073aa;
  flex-shrink: 0;
}

.seamless-timeline-line {
  width: 2px;
  flex-grow: 1;
  background: #e5e5e5;
  margin-top: 8px;
}

.seamless-timeline-item:last-child .seamless-timeline-line {
  display: none;
}

.seamless-timeline-content {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Calendar Layout */
.seamless-info {
  background: #f0f6fc;
  border-left: 4px solid #0073aa;
  padding: 15px;
  margin-bottom: 20px;
  color: #333;
}

/* No Events Message */
.seamless-no-events {
  padding: 40px;
  text-align: center;
  color: #666;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .seamless-grid-cols-3,
  .seamless-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .seamless-timeline-item {
    grid-template-columns: 60px 30px 1fr;
    gap: 15px;
  }

  .seamless-timeline-day {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .seamless-grid-cols-2,
  .seamless-grid-cols-3,
  .seamless-grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* Hide view toggle buttons immediately when default view is not "all" */
/* This CSS loads before JavaScript, preventing flash */
.seamless-elementor-wrapper[data-default-view="grid"]
  .view-toggle-button-container,
.seamless-elementor-wrapper[data-default-view="list"]
  .view-toggle-button-container,
.seamless-elementor-wrapper[data-default-view="calendar"]
  .view-toggle-button-container {
  display: none !important;
}

/* Also target when inside #eventWrapper */
.seamless-elementor-wrapper[data-default-view="grid"]
  #eventWrapper
  .view-toggle-button-container,
.seamless-elementor-wrapper[data-default-view="list"]
  #eventWrapper
  .view-toggle-button-container,
.seamless-elementor-wrapper[data-default-view="calendar"]
  #eventWrapper
  .view-toggle-button-container {
  display: none !important;
}

/* Hide search bar section immediately when show_search is false */
/* This CSS loads before JavaScript, preventing flash */
.seamless-elementor-wrapper[data-show-search="false"] .hero-section,
.seamless-elementor-wrapper[data-show-search="false"] .filter-form,
.seamless-elementor-wrapper[data-show-search="false"] .filter-controls,
.seamless-elementor-wrapper[data-show-search="false"] .event-search-filter,
.seamless-elementor-wrapper[data-show-search="false"]
  #eventWrapper
  .hero-section,
.seamless-elementor-wrapper[data-show-search="false"]
  #eventWrapper
  .filter-form,
.seamless-elementor-wrapper[data-show-search="false"]
  #eventWrapper
  .filter-controls,
.seamless-elementor-wrapper[data-show-search="false"]
  #eventWrapper
  .event-search-filter {
  display: none !important;
}

/* Filter By Select - Match existing filter styling */
#eventWrapper .filter-controls #seamless-filter-by-select,
#eventWrapper .filter-controls #seamless-filter-by-category,
#eventWrapper .filter-controls #seamless-filter-by-tag,
#eventWrapper .filter-controls .seamless-filter-by-select {
  width: 15%;
  border-radius: 50px !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
  padding-right: 40px;
  border-color: var(--seamless-secondary-color);
  text-transform: uppercase;
  color: var(--seamless-muted-text-color);
  background-color: var(--seamless-background-color);
  padding: 10px 14px;
  padding-right: 40px;
  border: 1px solid var(--seamless-secondary-color);
  font-size: 16px;
  transition: all 0.3s ease;
  max-height: 45px;
}

#eventWrapper .filter-controls #seamless-filter-by-select:focus,
#eventWrapper .filter-controls #seamless-filter-by-category:focus,
#eventWrapper .filter-controls #seamless-filter-by-tag:focus,
#eventWrapper .filter-controls .seamless-filter-by-select:focus {
  border-color: var(--seamless-focus-color);
  box-shadow: 0 0 0 3px #007bff33;
  outline: none;
}

/* ============================================
   Pagination Styles
   ============================================ */

/* Pagination Wrapper */
.seamless-pagination-wrapper {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.seamless-pagination-wrapper.text-left {
  justify-content: flex-start;
}

.seamless-pagination-wrapper.text-center {
  justify-content: center;
}

.seamless-pagination-wrapper.text-right {
  justify-content: flex-end;
}

/* Numbers Pagination Enhancement */
.seamless-pagination-numbers {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.seamless-pagination-numbers #pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}

/* Load More Button */
.seamless-load-more-wrapper {
  width: 100%;
}

.seamless-load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 30px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  background-color: #6ec1e4;
  color: #fff;
  transition: all 0.3s ease;
}

.seamless-load-more-btn:hover {
  background-color: #4fa8d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.seamless-load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.seamless-load-more-btn .btn-text {
  display: inline-block;
}

/* Hide Native Pagination when using Load More */
.seamless-elementor-wrapper[data-pagination-type="load_more"]
  #eventWrapper:not(.seamless-event-wrapper-without-dropdown)
  #pagination {
  display: none !important;
}

/* Hide All Pagination when type is none */
.seamless-elementor-wrapper[data-pagination-type="none"] #pagination,
.seamless-elementor-wrapper[data-pagination-type="none"]
  .seamless-pagination-wrapper {
  display: none !important;
}

/* Page Link Styling within wrapper */
.seamless-pagination-wrapper .seamless-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seamless-pagination-wrapper .seamless-page-link:hover {
  background-color: #e5e5e5;
  border-color: #6c5ce7;
  color: #6c5ce7;
}

.seamless-pagination-wrapper .seamless-page-link.seamless-active,
.seamless-pagination-wrapper .seamless-page-link.active {
  background-color: #6c5ce7;
  border-color: #6c5ce7;
  color: #fff;
}

.seamless-pagination-wrapper .seamless-page-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Responsive Pagination */
@media (max-width: 768px) {
  .seamless-load-more-btn {
    padding: 10px 24px;
    font-size: 14px;
  }

  .seamless-pagination-wrapper .seamless-page-link {
    min-width: 34px;
    height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .seamless-load-more-btn {
    width: 100%;
    padding: 12px 20px;
  }

  .seamless-pagination-wrapper {
    gap: 4px;
    margin-top: 0;
  }
}

/* Event Calendar Button */
.event-info-item.event-calendar-button-wrapper {
  line-height: 0;
}

/* Event Tickets */
.event-info-card .event-info-item {
  display: flex;
}

.event-info-card .ticket-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #eee;
}

.event-info-card .event-register-btn,
.event-info-card .event-past-btn,
.event-info-card .event-coming-soon-btn {
  display: block;
  text-align: center;
}

/* Event Schedule Table - Default Styling */
.event-schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: none;
  background: #fff;
  border-radius: 8px;
}

.event-schedule-table thead {
  background: transparent;
}

.event-schedule-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 12px 20px;
  text-align: left;
  border: 1px solid var(--seamless-primary-color);
}

.event-schedule-table tbody tr {
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
}

.event-schedule-table tbody tr:hover {
  background-color: #f9fafb;
}

.event-schedule-table tbody tr:last-child {
  border-bottom: none;
}

.event-schedule-table tbody td {
  font-size: 14px;
  color: #374151;
  padding: 12px 20px;
  text-align: left;
  border: none;
  vertical-align: middle;
  line-height: 1.5;
}

.event-schedule-table tbody td p {
  margin: 0;
  line-height: 1.5;
}

.event-schedule-table tbody td:first-child {
  font-weight: 500;
  color: #1f2937;
}

table.event-schedule-table thead tr th {
  background: var(--seamless-primary-color) !important;
}

table.event-schedule-table thead tr th:first-child {
  border-top-left-radius: 8px;
}

table.event-schedule-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

table.event-schedule-table thead tr th:last-child {
  border-top-right-radius: 8px;
}

table.event-schedule-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}
