/* ===== COMMON ELEMENTS ===== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  padding: 16px 16px 8px;
}
.section-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  padding: 0 16px 12px;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  margin: 0 16px;
  gap: 8px;
  transition: border-color var(--transition);
}
.search-bar:focus-within { border-color: var(--orange-accent); }
.search-bar svg { width: 18px; height: 18px; color: var(--gray-400); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-700);
  background: transparent;
}
.search-bar input::placeholder { color: var(--gray-400); }

/* Chips */
.chips-scroll {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.chip:hover { border-color: var(--orange-accent); color: var(--orange-accent); }
.chip.active {
  background: var(--orange-accent);
  border-color: var(--orange-accent);
  color: var(--white);
}
.chip .chip-icon { font-size: 15px; }

/* Cards */
.event-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin: 0 16px 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  position: relative;
}
.event-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.event-sport-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--orange-accent-light);
  color: var(--orange-accent-dark);
}
.event-card-fav {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--gray-300);
  transition: color var(--transition), transform var(--transition);
}
.event-card-fav:hover { color: var(--red); }
.event-card-fav.favorited { color: var(--red); }
.event-card-fav svg { width: 20px; height: 20px; }
.event-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 6px;
  line-height: 1.3;
}
.event-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.event-info-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-500);
}
.event-info-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.event-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.event-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange-accent);
}
.event-price.paid { color: var(--orange); }
.btn-details {
  padding: 7px 16px;
  background: var(--orange-accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-details:hover { background: var(--orange-accent-dark); }
.btn-details:active { transform: scale(0.96); }


/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-content {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 601;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: default;
}
.modal-overlay.open .modal-content { transform: translateX(-50%) translateY(0); }

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-300);
  border-radius: 2px;
  margin: 10px auto;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.modal-close svg { width: 18px; height: 18px; color: var(--gray-600); }

.modal-header {
  padding: 8px 16px 12px;
}
.modal-sport-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: var(--orange-accent-light);
  color: var(--orange-accent-dark);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.2;
  padding-right: 32px;
}

.modal-details {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.modal-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--gray-600);
}
.modal-detail-row svg { width: 18px; height: 18px; color: var(--gray-400); flex-shrink: 0; }
.modal-detail-row strong { color: var(--gray-800); font-weight: 600; }

.modal-description {
  padding: 0 16px;
  margin-bottom: 16px;
}
.modal-description p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

.modal-participants {
  padding: 0 16px;
  margin-bottom: 16px;
}
.participants-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.participants-bar-fill {
  height: 100%;
  background: var(--orange-accent);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.participants-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.modal-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}
.modal-tag-price { background: #FFF3E0; color: var(--orange); }
.modal-tag-level { background: #E3F2FD; color: var(--blue); }

.modal-actions {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--gray-100);
  position: sticky;
  bottom: 0;
  background: var(--white);
}
.btn-register {
  flex: 1;
  padding: 13px;
  background: var(--orange-accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-register:hover { background: var(--orange-accent-dark); }
.btn-register:active { transform: scale(0.98); }
.btn-register.registered {
  background: var(--gray-200);
  color: var(--orange-accent-dark);
  cursor: default;
}
.btn-modal-fav,
.btn-modal-share {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-modal-fav svg,
.btn-modal-share svg { width: 20px; height: 20px; color: var(--gray-400); }
.btn-modal-fav:hover { border-color: var(--red); }
.btn-modal-fav.favorited { border-color: var(--red); background: var(--red-light); }
.btn-modal-fav.favorited svg { color: var(--red); }
.btn-modal-share:hover { border-color: var(--blue); }


/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100% - 32px);
}
.toast {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-10px);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}
.toast.success { background: var(--orange-accent-dark); }
.toast.error { background: var(--red); }
.toast-icon { font-size: 16px; }
@keyframes toastIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-10px); }
}


/* ===== PREVIEW CARD ===== */
.preview-card {
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 12px 16px;
}
.preview-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}


/* ===== SUCCESS CARD ===== */
.success-card {
  background: var(--orange-accent-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 12px 16px;
  text-align: center;
  display: none;
}
.success-card.show { display: block; }
.success-icon { font-size: 40px; margin-bottom: 8px; }
.success-title { font-size: 16px; font-weight: 700; color: var(--orange-accent-dark); }
.success-text { font-size: 13px; color: var(--gray-600); margin-top: 4px; }


/* ===== DIVIDER ===== */
.divider {
  height: 8px;
  background: var(--gray-100);
}


/* ===== SCROLLBAR ===== */
.tab-content::-webkit-scrollbar { width: 0; }


/* ===== ANIMATIONS ===== */
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.heart-pulse { animation: pulse 0.3s ease; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: slideUp 0.3s ease forwards; }

/* Loading spinner */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.loading-spinner::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--orange-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ===== EVENT CARD IMAGE ===== */
.event-card-image {
  width: calc(100% + 28px);
  margin: -14px -14px 10px -14px;
  height: 140px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  position: relative;
}
.event-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.event-card-image .image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--orange-accent-light) 0%, #FFE0CC 100%);
}
.event-card-image .sport-icon-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 32px;
  height: 32px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
}


/* ===== IMAGE UPLOAD ===== */
.image-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}
.image-upload-area:hover { border-color: var(--orange-accent); }
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  cursor: pointer;
  gap: 8px;
  color: var(--gray-500);
  font-size: 14px;
}
.upload-placeholder .upload-icon {
  font-size: 28px;
  opacity: 0.6;
}
.upload-placeholder:hover {
  background: var(--orange-accent-light);
  color: var(--orange-accent);
}
#upload-preview {
  max-width: 100%;
  border-radius: var(--radius-md);
}


/* ===== GENDER BADGES ===== */
.gender-badge { font-size: 14px; font-weight: 700; margin-left: 4px; }
.gender-male { color: #3B82F6; }
.gender-female { color: #EC4899; }


/* ===== CITY DROPDOWN ===== */
.city-dropdown {
  position: absolute;
  top: calc(var(--header-height) - 4px);
  left: 8px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 510;
  min-width: 220px;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.city-dropdown.open { display: block; }
.city-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.city-dropdown-item:hover { background: var(--gray-50); }
.city-dropdown-item.active { color: var(--orange-accent); font-weight: 600; }
.city-dropdown-item .city-icon { font-size: 16px; }
.city-dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 4px 0;
}


/* ===== MAP VIEW ===== */
.view-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 3px;
  margin: 8px 16px 0;
}
.view-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  background: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.view-toggle-btn.active {
  background: var(--white);
  color: var(--gray-800);
  box-shadow: var(--shadow-sm);
}
#search-map-container {
  display: none;
  margin: 12px 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 400px;
}
#search-map-container.visible { display: block; }
#search-map { width: 100%; height: 100%; }
