/**
 * Jain Yuva Junior brand overrides (primary blue + accent orange from logo).
 */
:root,
[data-bs-theme=light] {
  --bs-blue: #005696;
  --bs-primary: #005696;
  --bs-primary-rgb: 0, 86, 150;
  --bs-warning: #f37021;
  --bs-warning-rgb: 243, 112, 33;
  --bs-link-color: #005696;
  --bs-link-hover-color: #004a7c;
}

[data-color-theme=Blue_Theme] {
  --bs-primary: #005696;
  --bs-primary-rgb: 0, 86, 150;
}

.btn-primary {
  --bs-btn-bg: #005696;
  --bs-btn-border-color: #005696;
  --bs-btn-hover-bg: #004a7c;
  --bs-btn-hover-border-color: #004a7c;
  --bs-btn-active-bg: #003d66;
  --bs-btn-active-border-color: #003d66;
}

.text-primary {
  color: #005696 !important;
}

.bg-primary {
  background-color: #005696 !important;
}

.link-primary {
  color: #005696 !important;
}

.border-primary {
  border-color: #005696 !important;
}

.btn-outline-primary {
  --bs-btn-color: #005696;
  --bs-btn-border-color: #005696;
  --bs-btn-hover-bg: #005696;
  --bs-btn-hover-border-color: #005696;
}

.badge.bg-primary,
.rounded-pill.bg-primary {
  background-color: #005696 !important;
}

.text-warning.brand-accent,
.brand-accent {
  color: #f37021 !important;
}

.left-sidebar .brand-logo img {
  max-height: 52px;
  width: auto;
}

.header-fp .header-fp-brand img.jyj-navbar-logo {
  max-height: 80px;
}

/* Admin sidebar — compact vertical spacing */
.left-sidebar .brand-logo {
  min-height: auto;
  padding: 8px 16px 4px;
}

.left-sidebar .scroll-sidebar {
  padding: 0 16px;
  height: calc(100vh - 120px);
}

.left-sidebar .nav-small-cap {
  margin-top: 10px;
  margin-bottom: 0;
  padding: 2px 10px;
  line-height: 20px;
}

.left-sidebar #sidebarnav > .nav-small-cap:first-child {
  margin-top: 2px;
}

.left-sidebar .sidebar-nav ul .sidebar-item .sidebar-link {
  padding: 6px 10px;
  margin: 0 0 1px;
  line-height: 22px;
  gap: 12px;
}

.left-sidebar .fixed-profile {
  padding: 0.5rem 0.75rem !important;
  margin: 0.35rem 0.75rem 0.5rem !important;
}

/* Admin layout — gap between sidebar and main content */
[data-layout=vertical] .page-wrapper {
  box-sizing: border-box;
  padding: 1rem 1rem 1.5rem;
}

@media (min-width: 768px) {
  [data-layout=vertical] .page-wrapper {
    padding: 1.15rem 1.35rem 1.75rem;
  }
}

@media (min-width: 1300px) {
  [data-layout=vertical] .page-wrapper {
    width: calc(100% - 270px);
    padding: 1.25rem 1.5rem 2rem 1.35rem;
    min-height: 100vh;
    background-color: #f4f7fb;
  }

  [data-layout=vertical] body[data-sidebartype=mini-sidebar] .page-wrapper {
    width: calc(100% - 87px);
  }
}

[data-layout=vertical] .page-wrapper > .col-12 > .card {
  border-radius: 12px;
  border: 1px solid #e8eef5;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

[data-layout=vertical] .page-wrapper > .col-12 > .card.border-0.shadow-none {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
}

/* Event banner images — 4:2 aspect ratio (2:1 wide) */
.event-image-4x2 {
  width: 100%;
  aspect-ratio: 4 / 2;
  overflow: hidden;
  display: block;
  background: #f1f5f9;
}

.event-image-4x2 > img,
.event-image-4x2 img.event-image-4x2-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* ── User portal event UI (matches mobile app) ── */
:root {
  --jyj-surface-page: #f0f3f7;
  --jyj-surface-hero: #f1f5f9;
  --jyj-surface-elevated: #ffffff;
  --jyj-surface-muted: #e5ebf2;
  --jyj-outline-variant: #d5dde8;
  --jyj-on-surface: #1e293b;
  --jyj-on-surface-variant: #64748b;
  --jyj-radius-list-card: 24px;
  --jyj-radius-detail-overlap: 28px;
  --jyj-overlap-list: 24px;
  --jyj-overlap-detail: 36px;
  --jyj-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 18px rgba(0, 0, 0, 0.1);
  --jyj-shadow-overlap: 0 -4px 12px rgba(15, 23, 42, 0.08);
}

.jyj-events-page {
  background: var(--jyj-surface-page);
  min-height: calc(100vh - 120px);
}

.jyj-events-page .jyj-events-list {
  max-width: 640px;
  margin: 0 auto;
}

.jyj-event-list-card {
  display: block;
  margin-bottom: calc(var(--jyj-overlap-list) + 8px);
  border-radius: var(--jyj-radius-list-card);
  text-decoration: none;
  color: inherit;
  background: var(--jyj-surface-elevated);
  box-shadow: var(--jyj-shadow-card);
  border: 1px solid rgba(213, 221, 232, 0.55);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.jyj-event-list-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 12px 24px rgba(0, 0, 0, 0.12);
  color: inherit;
}

.jyj-event-list-card__hero {
  border-radius: var(--jyj-radius-list-card) var(--jyj-radius-list-card) 0 0;
}

.jyj-event-list-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--jyj-on-surface);
}

.jyj-overlap-card {
  position: relative;
  z-index: 2;
  background: var(--jyj-surface-elevated);
  padding: 6px 16px 14px;
}

.jyj-overlap-card--list {
  margin-top: calc(-1 * var(--jyj-overlap-list));
  border-radius: var(--jyj-radius-list-card) var(--jyj-radius-list-card) 0 0;
  box-shadow: var(--jyj-shadow-overlap);
}

.jyj-overlap-card--detail {
  margin-top: calc(-1 * var(--jyj-overlap-detail));
  border-radius: var(--jyj-radius-detail-overlap) var(--jyj-radius-detail-overlap) 0 0;
  box-shadow: var(--jyj-shadow-overlap);
  padding: 12px 20px 24px;
}

.jyj-card-handle {
  display: block;
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 2px;
  background: var(--jyj-outline-variant);
}

.jyj-meta-tile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}

.jyj-meta-tile__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--jyj-surface-muted);
  color: var(--jyj-on-surface-variant);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.jyj-meta-tile__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.jyj-meta-tile__label {
  font-size: 12px;
  color: var(--jyj-on-surface-variant);
}

.jyj-meta-tile__value {
  font-size: 15px;
  font-weight: 600;
  color: var(--jyj-on-surface);
  line-height: 1.35;
  word-break: break-word;
}

.jyj-meta-tile--link {
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  margin: 0 -8px;
  padding: 8px;
}

.jyj-meta-tile--link:hover .jyj-meta-tile__value {
  color: #005696;
}

.jyj-location-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--jyj-on-surface-variant);
  line-height: 1.35;
}

.jyj-location-row i {
  font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Event detail page */
.jyj-event-detail-page {
  background: var(--jyj-surface-hero);
  min-height: calc(100vh - 120px);
  padding-bottom: 88px;
}

.jyj-event-detail-card {
  border: 0;
  border-radius: var(--jyj-radius-list-card);
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.jyj-event-detail-hero .event-image-4x2 {
  position: relative;
}

.jyj-event-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.jyj-event-detail-title {
  margin: 0;
  flex: 1;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--jyj-on-surface);
}

.jyj-event-detail-share {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #005696;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  padding: 0;
}

.jyj-event-detail-share:hover {
  background: rgba(0, 86, 150, 0.08);
}

.jyj-event-description {
  color: var(--jyj-on-surface-variant);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.jyj-map-preview {
  display: block;
  margin-top: 20px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--jyj-surface-muted);
  text-decoration: none;
  color: inherit;
}

.jyj-map-preview__canvas {
  position: relative;
  height: 160px;
  background:
    linear-gradient(90deg, transparent 27%, #e0e0e0 27%, #e0e0e0 28%, transparent 28%),
    linear-gradient(90deg, transparent 71%, #e0e0e0 71%, #e0e0e0 72%, transparent 72%),
    linear-gradient(0deg, transparent 34%, #e0e0e0 34%, #e0e0e0 36%, transparent 36%),
    linear-gradient(0deg, transparent 67%, #e0e0e0 67%, #e0e0e0 69%, transparent 69%),
    #f5f5f5;
}

.jyj-map-preview__pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
  color: #005696;
  font-size: 1.5rem;
}

.jyj-map-preview__label {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 600;
  color: var(--jyj-on-surface);
  display: flex;
  align-items: center;
  gap: 6px;
}

.jyj-event-sponsor-ad {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  height: 72px;
  background: var(--jyj-surface-muted);
  border: 1px solid var(--jyj-outline-variant);
}

.jyj-event-sponsor-ad img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jyj-event-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  background: var(--jyj-surface-elevated);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.12);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}

.jyj-ticket-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}

.jyj-ticket-panel__prices {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.jyj-price-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.jyj-price-chip .label {
  font-size: 11px;
  color: var(--jyj-on-surface-variant);
}

.jyj-price-chip .value {
  font-size: 14px;
  font-weight: 700;
  color: var(--jyj-on-surface);
}

.jyj-price-divider {
  width: 1px;
  height: 28px;
  margin: 0 8px;
  background: var(--jyj-outline-variant);
  flex-shrink: 0;
}

.jyj-ticket-panel__action {
  flex-shrink: 0;
}

.jyj-ticket-panel__action.is-hidden {
  display: none;
}

.jyj-btn-add-ticket {
  border-radius: 22px !important;
  padding: 10px 14px !important;
  font-weight: 600;
  white-space: nowrap;
}

.jyj-btn-add-ticket i {
  margin-right: 4px;
}

/* Event image zoom (detail page) */
.event-detail-card .event-image-open-btn,
.jyj-event-detail-card .event-image-open-btn {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: zoom-in;
}

.event-image-open-btn:hover .event-image-open-overlay {
  opacity: 1;
}

.event-image-open-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.35);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.event-image-modal-content {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
}

.event-image-modal-viewport {
  position: relative;
  width: 100%;
  min-height: 55vh;
  max-height: 70vh;
  overflow: auto;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.event-image-modal-viewport.is-dragging {
  cursor: grabbing;
}

.event-image-modal-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.event-image-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.event-image-modal-level {
  min-width: 64px;
  text-align: center;
  font-weight: 600;
  color: #475569;
}

/* Slots table */
.jyj-event-slots-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #005696;
  margin: 8px 0 0.75rem;
}

.jyj-event-slot-table {
  background: #fff;
  border: 1px solid var(--jyj-outline-variant);
  border-radius: 12px;
  overflow: hidden;
}

.jyj-event-slot-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--jyj-outline-variant);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--jyj-on-surface-variant);
  font-weight: 700;
  padding: 0.7rem 0.9rem;
}

.jyj-event-slot-table tbody td {
  padding: 0.8rem 0.9rem;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.92rem;
  color: #334155;
}

.jyj-event-slot-table tbody tr:last-child td {
  border-bottom: 0;
}

.jyj-event-slot-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.jyj-event-slot-status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.jyj-event-slot-status.is-open {
  color: #005696;
  background: #eff6ff;
}

.jyj-event-slot-status.is-full {
  color: #b45309;
  background: #fff7ed;
}

@media (min-width: 768px) {
  .jyj-ticket-panel {
    gap: 12px;
  }

  .jyj-event-detail-page {
    padding-bottom: 96px;
  }
}

