/* ============================================
   TRAINER - Tabbed Profile Directory
   Branded Header, City Tabs, Profile Cards,
   Bottom-Sheet Map
   ============================================ */

/* Override shared main.css styles */
body.page-trainer .listings-container { height: auto; overflow: visible; padding: 0; background: transparent; }
body.page-trainer .listings-header,
body.page-trainer .filters-row { display: none; }
body.page-trainer .map-column { display: none !important; }
body.page-trainer .listPage { padding: 0; }
body.page-trainer .pagination-wrapper { display: none; }

/* ---- Branded Page Header ---- */
.tr-page-header {
    margin-top: 80px;
    background: #526432;
    padding: 22px 32px;
}

.tr-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.tr-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.tr-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e6f972, #b6d400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tr-header-icon i { color: #526432; font-size: 20px; }

.tr-header-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.tr-header-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: rgba(230,249,114,0.7);
    font-weight: 600;
}

.tr-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tr-header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 9px 14px;
    min-width: 220px;
    transition: all 0.2s;
}

.tr-header-search:focus-within {
    background: rgba(255,255,255,0.15);
    border-color: #e6f972;
}

.tr-header-search i { color: rgba(255,255,255,0.4); font-size: 13px; flex-shrink: 0; }

.tr-header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    font-family: inherit;
}

.tr-header-search input::placeholder { color: rgba(255,255,255,0.4); }

.tr-header-select {
    padding: 9px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}

.tr-header-select:focus { border-color: #e6f972; }
.tr-header-select option { background: #526432; color: #fff; }

.tr-header-add {
    padding: 9px 18px;
    border-radius: 10px;
    background: #e6f972;
    color: #526432;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}

.tr-header-add:hover {
    background: #d4e85a;
    box-shadow: 0 4px 14px rgba(230,249,114,0.3);
}

/* ---- City Tab Bar ---- */
.tr-tab-bar {
    background: #fff;
    border-bottom: 2px solid #f0f0ec;
    position: sticky;
    top: 80px;
    z-index: 98;
}

.tr-tab-scroll {
    display: flex;
    align-items: center;
    padding: 0 32px;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0;
}

.tr-tab-scroll::-webkit-scrollbar { display: none; }

.tr-tabs-dynamic { display: contents; }

.tr-tab {
    padding: 14px 24px;
    border: none;
    background: transparent;
    color: #8a9ea6;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: color 0.2s;
    font-family: inherit;
}

.tr-tab:hover { color: #526432; }

.tr-tab.active {
    color: #526432;
    font-weight: 700;
}

.tr-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 24px;
    right: 24px;
    height: 3px;
    background: #e6f972;
    border-radius: 3px 3px 0 0;
}

/* ---- Split Layout ---- */
.tr-split {
    display: flex;
    min-height: calc(100vh - 180px);
}

.tr-profiles-col {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 24px 28px;
    background: #fafaf8;
}

.tr-map-col {
    width: 34%;
    flex-shrink: 0;
    position: relative;
    transition: width 0.3s ease, opacity 0.3s ease;
}

.tr-map-col.hidden {
    width: 0;
    overflow: hidden;
    opacity: 0;
}

.tr-map-sticky {
    position: sticky;
    top: 130px;
    height: calc(100vh - 130px);
}

.tr-map-sticky #map {
    width: 100%;
    height: 100%;
}

.tr-map-close {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 999;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #fff;
    color: #526432;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.tr-map-close:hover {
    background: #526432;
    color: #e6f972;
}

.tr-map-reopen {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 98;
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: #526432;
    color: #e6f972;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(1,49,61,0.3);
    transition: all 0.2s;
    font-family: inherit;
}

.tr-map-reopen.visible {
    display: flex;
}

.tr-map-reopen:hover {
    background: #024a5e;
    box-shadow: 0 6px 20px rgba(1,49,61,0.4);
}

/* ---- Profile List ---- */
.tr-profile-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- Profile Card ---- */
.tr-profile-card {
    display: flex;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(1,49,61,0.06), 0 1px 2px rgba(1,49,61,0.04);
    position: relative;
}

.tr-profile-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #e6f972, #b6d400);
    border-radius: 16px 0 0 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tr-profile-card:hover {
    box-shadow: 0 12px 32px rgba(1,49,61,0.10), 0 4px 12px rgba(1,49,61,0.06);
    transform: translateY(-2px);
}

.tr-profile-card:hover::before { opacity: 1; }

/* Card Avatar */
.tr-profile-avatar {
    width: 160px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.tr-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tr-profile-card:hover .tr-profile-avatar img { transform: scale(1.06); }

.tr-profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(1,49,61,0.5) 100%);
    pointer-events: none;
}

.tr-profile-rating-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    color: #526432;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tr-profile-stars { display: flex; gap: 1px; }
.tr-profile-stars i { color: #f5a623; font-size: 9px; }
.tr-profile-stars i.empty { color: #ddd; }

/* Card Body */
.tr-profile-body {
    flex: 1;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.tr-profile-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tr-profile-name {
    font-size: 17px;
    font-weight: 700;
    color: #526432;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.tr-profile-type {
    font-size: 12px;
    color: #6b8a92;
    font-weight: 500;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tr-profile-type::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b6d400;
    flex-shrink: 0;
}

.tr-profile-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.tr-profile-verified {
    background: linear-gradient(135deg, rgba(5,150,105,0.08), rgba(5,150,105,0.14));
    color: #059669;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.tr-profile-verified i { font-size: 10px; }

.tr-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tr-profile-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
    background: #f7f7f5;
    padding: 4px 11px;
    border-radius: 6px;
}

.tr-profile-meta-item i {
    color: #526432;
    font-size: 11px;
    width: 13px;
    text-align: center;
    opacity: 0.6;
}

.tr-profile-meta-item.location { background: rgba(182,212,0,0.08); }
.tr-profile-meta-item.location i { color: #b6d400; opacity: 1; }

.tr-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tr-profile-tag {
    background: transparent;
    color: #3a5a60;
    border: 1.5px solid #e8e8e2;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    transition: all 0.2s;
}

.tr-profile-card:hover .tr-profile-tag {
    border-color: rgba(182,212,0,0.3);
    background: rgba(182,212,0,0.04);
}

/* Card Action */
.tr-profile-action {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 14px;
    background: linear-gradient(180deg, #fafaf8 0%, #f5f5f2 100%);
    border-left: 1px solid #f0f0ec;
}

.tr-profile-price {
    font-size: 18px;
    font-weight: 800;
    color: #526432;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.tr-profile-price small {
    font-size: 11px;
    font-weight: 600;
    color: #8a9ea6;
    display: block;
    margin-top: 1px;
}

.tr-profile-cta {
    padding: 8px 16px;
    border-radius: 10px;
    border: none;
    background: #526432;
    color: #e6f972;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.25s;
    white-space: nowrap;
}

.tr-profile-cta:hover {
    background: #024a5e;
    box-shadow: 0 4px 14px rgba(1,49,61,0.25);
    transform: translateY(-1px);
}

.tr-profile-cta i { font-size: 10px; transition: transform 0.2s; }
.tr-profile-card:hover .tr-profile-cta i { transform: translateX(2px); }


/* ---- Loading & Empty ---- */
.tr-profile-list .loading-state,
.tr-profile-list .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8a9ea6;
}

.tr-profile-list .loading-state i { font-size: 28px; color: #b6d400; }
.tr-profile-list .empty-state i { font-size: 40px; color: #e0dcd4; margin-bottom: 12px; }

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .tr-header-inner { flex-wrap: wrap; }
    .tr-header-right { width: 100%; }
    .tr-header-search { flex: 1; min-width: 0; }
    .tr-header-select { font-size: 12px; padding: 7px 10px; }
    .tr-tab-scroll { padding: 0 20px; }
    .tr-tab { font-size: 12px; padding: 8px 16px; }
    .tr-split { flex-direction: column; }
    .tr-map-col { width: 100%; height: 250px; }
    .tr-map-col.hidden { height: 0; width: 100%; }
    .tr-map-sticky { position: relative; top: 0; height: 250px; }
    .tr-profiles-col { padding: 20px; }
}

@media (max-width: 767px) {
    .tr-page-header { margin-top: 70px; padding: 14px 16px; }
    .tr-tab-bar { top: 70px; }
    .tr-header-inner { gap: 10px; }
    .tr-header-left { gap: 10px; }
    .tr-header-icon { width: 36px; height: 36px; }
    .tr-header-icon i { font-size: 14px; }
    .tr-header-title { font-size: 17px; }
    .tr-header-right { flex-wrap: wrap; gap: 6px; }
    .tr-header-search { min-width: 100%; }
    .tr-header-select { flex: 1; font-size: 11px; padding: 7px 8px; }
    .tr-header-add { padding: 7px 12px; font-size: 11px; }
    .tr-tab-scroll { padding: 0 16px; gap: 0; }
    .tr-tab { font-size: 11px; padding: 8px 12px; white-space: nowrap; }

    .tr-profile-card {
        flex-direction: column;
    }

    .tr-profile-card::before {
        left: 0; top: 0; right: 0; bottom: auto;
        width: auto; height: 4px;
        border-radius: 16px 16px 0 0;
    }

    .tr-profile-card:hover { transform: translateY(-2px); }

    .tr-profile-avatar {
        width: 100%;
        height: 180px;
    }

    .tr-profile-body { padding: 12px 14px; }
    .tr-profile-name { font-size: 15px; }
    .tr-profile-meta { gap: 6px; }
    .tr-profile-tags { gap: 4px; }
    .tr-profile-tag { font-size: 10px; padding: 2px 8px; }

    .tr-profile-action {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        border-left: none;
        border-top: 1px solid #f0f0ec;
        background: #fff;
        padding: 10px 14px;
    }

    .tr-profiles-col { padding: 16px; }
    .tr-profile-list { gap: 12px; }
    .tr-map-col { height: 200px; }
    .tr-map-sticky { height: 200px; }
}

@media (max-width: 480px) {
    .tr-header-select { min-width: calc(50% - 6px); }
    .tr-profile-action { flex-wrap: wrap; gap: 8px; }
    .tr-profile-cta { width: 100%; text-align: center; justify-content: center; }
}
