/* ========================================
   Podemos Agenda - Table View Styles
   ======================================== */

/* ========================================
   Filter Section Styles
   ======================================== */

.podemos-agenda-filters {
  margin-bottom: 42px;
  padding: 20px;
  border-radius: 12px;
}

.podemos-filters-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

/* Custom State Dropdown */
.podemos-filter-state {
  flex-shrink: 0;
  position: relative;
}

.podemos-state-dropdown {
  position: relative;
  min-width: 280px;
}

.podemos-dropdown-trigger {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.podemos-dropdown-search-input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.podemos-dropdown-search-input:hover {
  border-color: #5a88c6;
}

.podemos-dropdown-search-input:focus {
  outline: none;
  border-color: #5a88c6;
  box-shadow: 0 0 0 3px rgba(90, 136, 198, 0.2);
  cursor: text;
}

.podemos-state-dropdown.open .podemos-dropdown-search-input {
  border-color: #5a88c6;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.podemos-search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #999;
  pointer-events: none;
}

.podemos-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #5a88c6;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  max-height: 350px;
  overflow: hidden;
}

.podemos-state-dropdown.open .podemos-dropdown-menu {
  display: block;
}

.podemos-dropdown-search-input::placeholder {
  color: #999;
}

.podemos-dropdown-options {
  max-height: 280px;
  overflow-y: auto;
}

.podemos-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.podemos-dropdown-option:hover {
  background-color: #f0f7ff;
}

.podemos-dropdown-option.selected {
  background-color: #e8f0fe;
}

.podemos-dropdown-option.hidden {
  display: none;
}

.podemos-option-text {
  color: #333;
  font-size: 14px;
}

.podemos-dropdown-option.selected .podemos-option-text {
  color: #5a88c6;
  font-weight: 600;
}

.podemos-option-badge {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  background: #b8d0ed;
  color: #4a70a8;
  font-size: 12px;
  font-weight: 600;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podemos-option-badge.has-events {
  background: #5a88c6;
  color: white;
}

/* Organization Filter Buttons */
.podemos-filter-orgs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.podemos-org-filter-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 12px;
  transition:
    background-color 0.2s,
    transform 0.2s;
}

.podemos-org-filter-btn.active .podemos-org-icon {
  box-shadow:
    0 0 0 2px #5a88c6,
    0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Circular Icon Container */
.podemos-org-icon {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.podemos-org-icon img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* Organization Badge Styles (Red/Coral) */
.podemos-org-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #f5a9a9;
  color: #c0392b;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.podemos-org-badge.has-events {
  background: #e74c3c;
  color: white;
}

/* Organization Label */
.podemos-org-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-align: center;
  line-height: 1.2;
  word-spacing: 100vw;
}

/* ========================================
   Main Container
   ======================================== */

.podemos-agenda-container {
  max-width: 1200px;
  margin: 0 auto;
  background: #f8f9fa;
  padding: 20px;
}

.podemos-agenda-content {
  padding: 20px;
  background-color: white;
}

/* State Section */
.podemos-estado-section {
  margin-bottom: 30px;
}

.podemos-estado-header {
  background: #5a88c6;
  color: white;
  padding: 12px 18px;
  margin: 0;
  font-size: 17px;
  font-weight: bold;
  border-radius: 8px 8px 0 0;
}

/* Table Styles */
.podemos-eventos-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.podemos-eventos-table thead {
  background: #f5f5f5;
}

.podemos-eventos-table th,
.podemos-eventos-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  color: #000;
}

.podemos-eventos-table th {
  font-weight: 600;
  color: #000;
  font-size: 13px;
}

.podemos-eventos-table tbody tr:hover {
  background: #fafafa;
}

.podemos-eventos-table tbody tr:last-child td {
  border-bottom: none;
}

.podemos-eventos-table td small {
  color: #000;
  font-size: 12px;
}

.podemos-empty-row td {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 25px;
  font-size: 13px;
  background-color: #fcfcfc;
}

/* Ver Mais Button */
.podemos-ver-mais-btn {
  background: #5a88c6;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s;
}

.podemos-ver-mais-btn:hover {
  background: #4a70a8;
}

/* Hidden content container */
.podemos-event-content-hidden {
  display: none !important;
}

/* ========================================
   Modal Styles
   ======================================== */

.podemos-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podemos-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
}

.podemos-modal-content {
  position: relative;
  background: white;
  max-width: 1050px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.podemos-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.podemos-modal-close:hover {
  background: #f0f0f0;
}

.podemos-modal-title {
  margin: 0 0 20px 0;
  padding-right: 40px;
  font-size: 24px;
  color: #333;
}

.podemos-modal-body {
  font-size: 16px;
  line-height: 1.6;
  color: #444;
}

.podemos-modal-body p {
  margin: 0 0 15px 0;
}

.podemos-modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.podemos-modal-body iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

.podemos-modal-body video {
  display: block;
  width: 100%;
  border-radius: 8px;
}

.podemos-modal-body .wp-video {
  width: 100% !important;
}

.podemos-modal-body .mejs-container {
  width: 100% !important;
  height: auto !important;
  padding-top: 56.25% !important;
  position: relative !important;
}

.podemos-modal-body .mejs-inner {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.podemos-modal-body .mejs-mediaelement {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
}

.podemos-modal-body .mejs-mediaelement video {
  width: 100% !important;
  height: 100% !important;
}

.podemos-modal-body .mejs-layers {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 2 !important;
}

.podemos-modal-body .mejs-controls {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 3 !important;
}

/* Modal Footer - Location, Address, Link */
.podemos-modal-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.podemos-modal-footer p {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #555;
}

.podemos-modal-footer p:last-child {
  margin-bottom: 0;
}

.podemos-modal-footer strong {
  color: #333;
}

.podemos-modal-link a {
  color: #5a88c6;
  text-decoration: none;
  font-weight: 500;
}

.podemos-modal-link a:hover {
  text-decoration: underline;
}

/* ========================================
   Responsive Styles
   ======================================== */

@media (max-width: 768px) {
  .podemos-agenda-container {
    padding: 10px;
  }

  .podemos-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .podemos-filter-state {
    width: 100%;
  }

  .podemos-state-dropdown {
    min-width: unset;
  }

  .podemos-filter-orgs {
    justify-content: center;
    margin-top: 15px;
  }

  .podemos-eventos-table {
    display: block;
    overflow-x: auto;
  }

  .podemos-eventos-table th,
  .podemos-eventos-table td {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .podemos-modal-content {
    width: 95%;
    padding: 20px;
    max-height: 90vh;
  }

  .podemos-modal-title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .podemos-agenda-filters {
    padding: 15px;
  }

  .podemos-filter-orgs {
    gap: 12px;
  }

  .podemos-org-icon {
    width: 56px;
    height: 56px;
  }

  .podemos-org-badge {
    min-width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .podemos-org-label {
    font-size: 11px;
    max-width: 70px;
  }

  .podemos-estado-header {
    font-size: 15px;
    padding: 10px 14px;
  }

  .podemos-ver-mais-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

  .podemos-modal-content {
    padding: 15px;
  }

  .podemos-modal-title {
    font-size: 18px;
    padding-right: 30px;
  }

  .podemos-modal-close {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 22px;
  }

  .podemos-modal-body {
    font-size: 14px;
  }
}
