/* =========================================================
   Trainings page — modern map-first explorer
   ========================================================= */

.trainings-page {
    --tr-teal: #099d79;
    --tr-teal-dark: #078066;
    --tr-blue: #00388a;
    --tr-ink: #0f172a;
    --tr-muted: #64748b;
    --tr-line: #e2e8f0;
    --tr-surface: #f8fafc;
    --tr-card: #ffffff;
    --tr-radius: 16px;
    --tr-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    background: var(--tr-surface);
}

/* ---------- Compact hero ---------- */
.tr-hero {
    position: relative;
    overflow: hidden;
    padding: 28px 0 20px;
    background:
        radial-gradient(ellipse 80% 120% at 100% 0%, rgba(9, 157, 121, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 100% at 0% 100%, rgba(0, 56, 138, 0.14), transparent 50%),
        linear-gradient(120deg, #e8f4ff 0%, #eef8f4 45%, #f5f0ea 100%);
}

.tr-hero__title {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 800;
    color: var(--tr-ink);
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.tr-hero__title span {
    color: var(--tr-teal);
}

.tr-hero__subtitle {
    margin: 0;
    color: var(--tr-muted);
    font-size: 0.95rem;
}

.tr-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: var(--tr-blue);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Search toolbar ---------- */
.tr-toolbar {
    margin-top: -8px;
    margin-bottom: 18px;
    position: relative;
    z-index: 3;
}

.tr-search-shell {
    background: var(--tr-card);
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow);
    padding: 12px 14px;
}

.tr-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tr-search-input {
    flex: 1 1 240px;
    min-width: 200px;
    position: relative;
}

.tr-search-input input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--tr-line);
    border-radius: 12px;
    padding: 0 44px 0 16px;
    font-size: 14px;
    background: #f8fafc;
    color: var(--tr-ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tr-search-input input:focus {
    border-color: var(--tr-teal);
    box-shadow: 0 0 0 3px rgba(9, 157, 121, 0.15);
    background: #fff;
}

.tr-search-input .tr-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--tr-muted);
    cursor: pointer;
}

.tr-distance-tabs {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}

.tr-distance-tabs button {
    border: 0;
    background: transparent;
    color: var(--tr-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: 0.2s ease;
}

.tr-distance-tabs button.active {
    background: #fff;
    color: var(--tr-teal-dark);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.tr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.tr-btn--primary {
    background: var(--tr-teal);
    color: #fff;
}

.tr-btn--primary:hover {
    background: var(--tr-teal-dark);
    color: #fff;
}

.tr-btn--ghost {
    background: #fff;
    border-color: var(--tr-line);
    color: var(--tr-ink);
}

.tr-btn--ghost:hover {
    border-color: var(--tr-teal);
    color: var(--tr-teal-dark);
}

.tr-btn--soft {
    background: rgba(9, 157, 121, 0.1);
    border-color: rgba(9, 157, 121, 0.25);
    color: var(--tr-teal-dark);
}

.tr-btn--soft:hover,
.tr-btn--soft.active {
    background: var(--tr-teal);
    border-color: var(--tr-teal);
    color: #fff;
}

.tr-location-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--tr-line);
}

.tr-location-bar .searchmap {
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
}

.tr-location-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tr-muted);
    font-size: 13px;
    min-width: 0;
}

.tr-location-text strong {
    color: var(--tr-teal-dark);
    font-weight: 700;
}

.tr-location-text #locationInput {
    color: var(--tr-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(640px, 70vw);
}

.tr-location-text .change-location-label {
    color: var(--tr-blue);
    font-weight: 600;
    margin-left: 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tr-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tr-view-toggle {
    display: inline-flex;
    border: 1px solid var(--tr-line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.tr-view-toggle button {
    border: 0;
    background: transparent;
    color: var(--tr-muted);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s ease;
}

.tr-view-toggle button + button {
    border-left: 1px solid var(--tr-line);
}

.tr-view-toggle button.active {
    background: var(--tr-blue);
    color: #fff;
}

/* ---------- Explorer (map + list) ---------- */
.tr-explorer {
    display: grid;
    gap: 16px;
    margin-bottom: 28px;
    align-items: stretch;
}

/* Map view (default): map only, full width */
.trainings-page--map-view .tr-explorer {
    grid-template-columns: 1fr;
    min-height: min(68vh, 720px);
    height: calc(100vh - 290px);
}

.trainings-page--map-view .tr-list-panel {
    display: none;
}

.trainings-page--list-view .tr-explorer {
    grid-template-columns: 1fr;
}

.trainings-page--list-view .tr-map-panel {
    display: none;
}

.tr-map-panel {
    position: relative;
    background: #fff;
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-radius);
    overflow: hidden;
    box-shadow: var(--tr-shadow);
    min-height: 420px;
}

.tr-map-panel #google-map {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

.trainings-page--map-view .tr-map-panel #google-map {
    min-height: 100%;
    height: 100%;
}

.tr-map-overlay {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100% - 28px);
    pointer-events: none;
}

.tr-map-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--tr-line);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    color: var(--tr-ink);
    font-size: 12px;
    font-weight: 700;
    pointer-events: auto;
}

.tr-map-chip i {
    color: var(--tr-teal);
}

.tr-map-hint {
    font-size: 12px;
    color: var(--tr-muted);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--tr-line);
    border-radius: 10px;
    padding: 8px 10px;
    width: fit-content;
    pointer-events: none;
}

.tr-list-panel {
    background: #fff;
    border: 1px solid var(--tr-line);
    border-radius: var(--tr-radius);
    box-shadow: var(--tr-shadow);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.tr-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tr-line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.tr-list-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--tr-ink);
}

.tr-list-header p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--tr-muted);
}

.tr-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(9, 157, 121, 0.12);
    color: var(--tr-teal-dark);
    font-size: 12px;
    font-weight: 800;
}

.trainings-page--map-view .tr-list-scroll {
    overflow-y: auto;
    padding: 12px;
    flex: 1;
    min-height: 0;
}

.trainings-page--list-view .tr-list-scroll {
    padding: 16px;
}

#trainingContainer {
    margin: 0;
}

.trainings-page--map-view #trainingContainer > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.trainings-page--list-view #trainingContainer > .training-card {
    flex: 0 0 50%;
    max-width: 50%;
}

/* ---------- Modern training cards ---------- */
.tr-card {
    background: var(--tr-card);
    border: 1px solid var(--tr-line);
    border-radius: 14px;
    padding: 14px 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tr-card:hover {
    transform: translateY(-2px);
    border-color: rgba(9, 157, 121, 0.35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.tr-card.active {
    border-color: var(--tr-teal);
    background: rgba(9, 157, 121, 0.06);
}

.tr-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.tr-card__institute {
    display: inline-flex;
    align-items: center;
    max-width: 85%;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 56, 138, 0.08);
    color: var(--tr-blue);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}

.tr-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--tr-muted);
    white-space: nowrap;
}

.tr-card__status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.tr-card__status.is-open {
    color: var(--tr-teal-dark);
}

.tr-card__status.is-upcoming {
    color: #b45309;
}

.tr-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 750;
    color: var(--tr-ink);
    line-height: 1.35;
}

.tr-card__meta {
    display: grid;
    gap: 6px;
    margin: 2px 0 4px;
}

.tr-card__meta-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--tr-muted);
    line-height: 1.4;
}

.tr-card__meta-row i {
    margin-top: 2px;
    width: 14px;
    color: var(--tr-teal);
}

.tr-card__meta-row strong {
    color: var(--tr-ink);
    font-weight: 600;
}

.tr-card__footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--tr-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.tr-card__seats {
    font-size: 13px;
    font-weight: 700;
    color: var(--tr-ink);
}

.tr-card__seats span {
    color: var(--tr-muted);
    font-weight: 500;
}

.tr-card__cta {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 157, 121, 0.12);
    color: var(--tr-teal-dark);
    text-decoration: none;
    transition: 0.2s ease;
}

.tr-card__cta:hover {
    background: var(--tr-teal);
    color: #fff;
}

.tr-card.pmky-card {
    background: var(--tr-card);
    border: 1px solid var(--tr-line);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: none;
}

.tr-card.pmky-card:hover {
    transform: translateY(-2px);
    border-color: rgba(9, 157, 121, 0.35);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.tr-card.pmky-card .pmky-tag {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.tr-card.pmky-card .pmky-title {
    font-size: inherit;
    margin-bottom: 0;
}

.tr-card.pmky-card .pmky-footer {
    padding-top: 10px;
    border-top: 1px solid var(--tr-line);
}

.tr-card.pmky-card .pmky-btn {
    background: transparent;
}

.tr-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tr-muted);
}

.tr-empty i {
    opacity: 0.45;
    margin-bottom: 12px;
}

.tr-empty h5 {
    color: var(--tr-ink);
    font-weight: 750;
}

/* City batches modal */
.tr-city-modal .modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
}

.tr-city-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--tr-line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.tr-city-modal .modal-header .btn-close {
    position: static !important;
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0.5rem !important;
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
    opacity: 0.55;
    border-radius: 8px;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.tr-city-modal .modal-header .btn-close:hover,
.tr-city-modal .modal-header .btn-close:focus {
    transform: none !important;
    opacity: 1;
    background: rgba(15, 23, 42, 0.06) !important;
}

.tr-city-modal .modal-header .btn-close::before {
    display: none;
}

.tr-city-modal__header {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.tr-city-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(9, 157, 121, 0.12);
    color: var(--tr-teal-dark);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tr-city-modal__titles {
    min-width: 0;
}

.tr-city-modal .modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--tr-ink);
    line-height: 1.3;
}

.tr-city-modal__subtitle {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--tr-muted);
    line-height: 1.4;
}

.tr-city-modal .modal-body {
    padding: 1rem 1.25rem 1.25rem;
    background: #f8fafc;
    max-height: min(68vh, 560px);
}

.tr-city-modal__empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    color: var(--tr-muted);
    font-size: 1.5rem;
    box-shadow: var(--tr-shadow);
}

.city-batches-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--tr-line);
}

.city-batches-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--tr-ink);
}

.city-batches-city {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tr-teal-dark);
    background: rgba(9, 157, 121, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
}

.city-batches-list {
    display: grid;
    gap: 12px;
}

.tr-batch-card {
    background: #fff;
    border: 1px solid var(--tr-line);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tr-batch-card:hover {
    border-color: rgba(9, 157, 121, 0.35);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.tr-batch-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tr-batch-card__institute {
    font-size: 11px;
    font-weight: 700;
    color: var(--tr-blue);
    background: rgba(0, 56, 138, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.3;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tr-batch-card__duration {
    font-size: 11px;
    font-weight: 700;
    color: var(--tr-teal-dark);
    background: rgba(9, 157, 121, 0.12);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.tr-batch-card__title {
    margin: 0 0 10px;
    font-size: 0.98rem;
    font-weight: 750;
    line-height: 1.35;
}

.tr-batch-card__title a {
    color: var(--tr-ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tr-batch-card__title a:hover {
    color: var(--tr-teal-dark);
}

.tr-batch-card__meta {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 6px;
}

.tr-batch-card__meta li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--tr-muted);
    line-height: 1.4;
}

.tr-batch-card__meta i {
    width: 14px;
    margin-top: 2px;
    color: var(--tr-teal);
    flex-shrink: 0;
}

.tr-batch-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tr-teal-dark);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(9, 157, 121, 0.1);
    transition: background 0.2s ease, color 0.2s ease;
}

.tr-batch-card__cta:hover {
    background: var(--tr-teal);
    color: #fff;
}

.tr-city-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.tr-city-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.tr-city-modal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.tr-city-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 575.98px) {
    .tr-city-modal .modal-header {
        padding: 1rem;
    }

    .tr-city-modal .modal-body {
        padding: 0.85rem 1rem 1rem;
    }

    .tr-city-modal__icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .tr-batch-card__institute {
        max-width: 58%;
    }
}

/* Upcoming section polish */
.trainings-page .training-section {
    background: linear-gradient(180deg, #0b3d2e 0%, #0f513f 100%);
}

.trainings-page .training-section h4 {
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.trainings-page .traing-slider .owl-nav {
    top: -18% !important;
}

/* Register CTA */
.trainings-page .reg-bg-color {
    background: linear-gradient(135deg, #eef2fb 0%, #e8f7f2 100%);
}

/* Institutes section spacing */
.trainings-page .tr-section {
    padding: 48px 0;
}

.trainings-page .tr-section__eyebrow {
    margin: 0;
    text-align: center;
    color: var(--tr-teal);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.trainings-page .tr-section__title {
    margin: 6px 0 8px;
    text-align: center;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 800;
    color: var(--tr-ink);
}

.trainings-page .tr-section__desc {
    margin: 0 auto 24px;
    text-align: center;
    max-width: 560px;
    color: var(--tr-muted);
    font-size: 14px;
}

/* Results count message inside list */
.results-count-message .alert {
    margin-bottom: 12px;
}

/* Toast / notification (Upcoming, map filter, etc.) */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    min-width: 300px;
    max-width: 500px;
    padding: 12px 44px 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: trNotificationSlideIn 0.5s ease;
}

.custom-notification--warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #664d03;
}

.custom-notification--info {
    background: #d1ecf1;
    border: 1px solid #0dcaf0;
    color: #055160;
}

.custom-notification__message {
    flex: 1;
    line-height: 1.45;
    font-size: 14px;
}

.custom-notification .btn-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    margin: 0 !important;
    padding: 0;
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.65;
    flex-shrink: 0;
}

.custom-notification .btn-close:hover {
    opacity: 1;
}

@keyframes trNotificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .trainings-page--map-view .tr-explorer {
        height: auto;
        min-height: 0;
    }

    .trainings-page--map-view .tr-map-panel {
        min-height: 380px;
        height: 55vh;
    }

    .trainings-page--list-view #trainingContainer > .training-card {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .tr-location-text #locationInput {
        white-space: normal;
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .tr-search-shell {
        padding: 10px;
    }

    .tr-btn,
    .tr-view-toggle button {
        flex: 1 1 auto;
    }

    .tr-toolbar-actions {
        width: 100%;
    }

    .tr-view-toggle {
        width: 100%;
    }

    .tr-view-toggle button {
        flex: 1;
        justify-content: center;
    }
}
