/* =============================================================
   ÖSBV Clubs Plugin – Frontend Styles
   ÖSBV Corporate Design: Red #008080, Dark #1a1a2e
   Split map + sidebar layout
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@400;500;600&display=swap');

:root {
    --oesbv-turquoise:        #008080;
    --oesbv-turquoise-dark:   #004040;
    --oesbv-turquoise-light:  #dceed1;
    --oesbv-dark:       #1a1a2e;
    --oesbv-mid:        #2d2d44;
    --oesbv-teal:       #1a6b55;
    --oesbv-border:     #e2e2e2;
    --oesbv-bg:         #f6f6f8;
    --oesbv-white:      #ffffff;
    --oesbv-text:       #1e1e1e;
    --oesbv-muted:      #666666;
    --oesbv-radius:     6px;
    --oesbv-shadow:     0 2px 12px rgba(0,0,0,0.08);
    --oesbv-shadow-lg:  0 6px 28px rgba(0,0,0,0.13);
    --oesbv-trans:      0.2s ease;
    --oesbv-font-head:  'Barlow Condensed', sans-serif;
    --oesbv-font-body:  'Barlow', sans-serif;
}

/* ── Base reset ──────────────────────────────────────────────── */
.oesbv-cl-wrap * { box-sizing: border-box; }
.oesbv-cl-wrap {
    font-family: var(--oesbv-font-body);
    font-size: 16px;
    color: var(--oesbv-text);
    line-height: 1.5;
}

/* ================================================================
   FILTERS BAR
================================================================ */
.oesbv-cl-filters {
    background: var(--oesbv-white);
    border: 1px solid var(--oesbv-border);
    border-radius: var(--oesbv-radius);
    padding: 14px 18px;
    margin-bottom: 14px;
    box-shadow: var(--oesbv-shadow);
}
.oesbv-cl-filters__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}
.oesbv-cl-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 180px;
}
.oesbv-cl-filter-group label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--oesbv-muted);
}
.oesbv-cl-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.oesbv-cl-search-wrap svg {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--oesbv-muted);
    pointer-events: none;
    display: none;
}
.oesbv-cl-search-wrap input,
.oesbv-cl-filter-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--oesbv-border);
    border-radius: var(--oesbv-radius);
    font-family: var(--oesbv-font-body);
    font-size: 14px;
    background: var(--oesbv-bg);
    transition: border-color var(--oesbv-trans);
    color: var(--oesbv-text);
}
.oesbv-cl-search-wrap input { padding-left: 34px; }
.oesbv-cl-search-wrap input:focus,
.oesbv-cl-filter-group select:focus {
    outline: none;
    border-color: var(--oesbv-turquoise);
    background: var(--oesbv-white);
}
.oesbv-cl-results-count {
    font-size: 13px;
    color: var(--oesbv-muted);
    margin-left: auto;
    align-self: center;
    white-space: nowrap;
}
.oesbv-cl-results-count span {
    font-weight: 700;
    color: var(--oesbv-dark);
    font-size: 16px;
}

/* ================================================================
   MAIN LAYOUT  (map + sidebar)
================================================================ */
.oesbv-cl-layout {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 0;
    border: 1px solid var(--oesbv-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--oesbv-shadow-lg);
}

/* ── Map column ─────────────────────────────────────────────── */
.oesbv-cl-map-col { position: relative; }
#oesbv-cl-map {
    width: 100%;
    z-index: 1;
}

/* ── List column ────────────────────────────────────────────── */
.oesbv-cl-list-col {
    border-left: 1px solid var(--oesbv-border);
    background: var(--oesbv-white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.oesbv-cl-list {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--oesbv-turquoise) var(--oesbv-bg);
    flex: 1;
}
.oesbv-cl-list::-webkit-scrollbar { width: 4px; }
.oesbv-cl-list::-webkit-scrollbar-thumb { background: var(--oesbv-turquoise); border-radius: 2px; }

/* ================================================================
   LOADING STATE
================================================================ */
.oesbv-cl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 20px;
    color: var(--oesbv-muted);
    font-size: 14px;
}
.oesbv-cl-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--oesbv-border);
    border-top-color: var(--oesbv-turquoise);
    border-radius: 50%;
    animation: oesbv-spin 0.7s linear infinite;
}
@keyframes oesbv-spin { to { transform: rotate(360deg); } }

.oesbv-cl-no-results {
    padding: 32px 20px;
    text-align: center;
    color: var(--oesbv-muted);
    font-size: 14px;
    font-style: italic;
}

/* ================================================================
   CLUB CARD  (in sidebar list)
================================================================ */
.oesbv-cl-card {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--oesbv-border);
    transition: background var(--oesbv-trans);
    cursor: pointer;
    position: relative;
}
.oesbv-cl-card:last-child { border-bottom: none; }
.oesbv-cl-card:hover { background: var(--oesbv-turquoise-light); }
.oesbv-cl-card.is-active {
    background: var(--oesbv-turquoise-light);
    border-left: 4px solid var(--oesbv-turquoise);
}
.oesbv-cl-card.is-active .oesbv-cl-card__focus-btn {
    background: var(--oesbv-turquoise);
    color: #fff;
}

/* image strip */
.oesbv-cl-card__img {
    width: 72px;
    flex-shrink: 0;
    background: var(--oesbv-white);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}
.oesbv-cl-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}
.oesbv-cl-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--oesbv-bg);
}
.oesbv-cl-card__img-placeholder svg {
    width: 26px; height: 26px;
    color: var(--oesbv-border);
}

/* body */
.oesbv-cl-card__body {
    flex: 1;
    padding: 12px 14px 12px 14px;
    min-width: 0;
}
.oesbv-cl-card__name {
    font-family: var(--oesbv-font-head);
    font-size: 17px;
    font-weight: 700;
    color: var(--oesbv-dark);
    line-height: 1.2;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.oesbv-cl-card__bundesland {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--oesbv-dark);
    color: #fff;
    padding: 1px 7px;
    border-radius: 20px;
    margin-bottom: 5px;
}
.oesbv-cl-card__address {
    font-size: 12px;
    color: var(--oesbv-muted);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 6px;
    line-height: 1.4;
}
.oesbv-cl-card__address svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 2px; }
.oesbv-cl-card__links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.oesbv-cl-card__link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    color: var(--oesbv-turquoise);
    transition: color var(--oesbv-trans);
}
.oesbv-cl-card__link:hover { color: var(--oesbv-turquoise-dark); text-decoration: underline; }
.oesbv-cl-card__link svg { width: 11px; height: 11px; }

/* focus map button */
.oesbv-cl-card__focus-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--oesbv-white);
    border: 1.5px solid var(--oesbv-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--oesbv-dark);
    transition: all var(--oesbv-trans);
    box-shadow: var(--oesbv-shadow);
}
.oesbv-cl-card__focus-btn:hover {
    background: var(--oesbv-turquoise);
    border-color: var(--oesbv-turquoise);
    color: #fff;
}
.oesbv-cl-card__focus-btn svg { width: 16px; height: 16px; }
.oesbv-cl-card--no-coords .oesbv-cl-card__focus-btn { opacity: 0.3; cursor: default; }

/* ================================================================
   LEAFLET OVERRIDES  (custom marker, popup)
================================================================ */

/* Custom SVG marker – injected as DivIcon in JS */
.oesbv-cl-marker {
    background: none;
    border: none;
}
.oesbv-cl-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
    transition: transform 0.15s ease;
}
.oesbv-cl-marker.is-active svg { transform: scale(1.25); }

a.oesbv-cl-popup__btn.oesbv-cl-popup__btn--primary {
    color: #fbfaee;
}

.leaflet-container a.leaflet-popup-close-button {
    margin-right: 8px;
    display: none;
}

/* Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: var(--oesbv-shadow-lg) !important;
    padding: 0 !important;
    overflow: hidden;
    min-width: 220px;
    max-width: 280px;
}
.leaflet-popup-content {
    margin: 0 !important;
    font-family: var(--oesbv-font-body) !important;
}
.leaflet-popup-tip-container { display: none; }
.leaflet-popup-close-button {
    color: var(--oesbv-dark) !important;
    font-size: 16px !important;
    padding: 6px 10px !important;
    z-index: 10;
}

/* Popup inner */
.oesbv-cl-popup {
    font-family: var(--oesbv-font-body);
}
.oesbv-cl-popup__img {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: var(--oesbv-white);
    border-bottom: 1px solid var(--oesbv-border);
    display: flex;
    justify-content: center;
    padding: 8px;
}
.oesbv-cl-popup__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}
.oesbv-cl-popup__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--oesbv-dark), var(--oesbv-mid));
}
.oesbv-cl-popup__img-placeholder svg {
    width: 36px; height: 36px;
    color: rgba(255,255,255,0.2);
}
.oesbv-cl-popup__body {
    padding: 14px 16px 16px;
}
.oesbv-cl-popup__name {
    font-family: var(--oesbv-font-head);
    font-size: 19px;
    font-weight: 700;
    color: var(--oesbv-dark);
    line-height: 1.15;
    margin: 0 0 6px;
}
.oesbv-cl-popup__bundesland {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--oesbv-dark);
    color: #fff;
    padding: 1px 7px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.oesbv-cl-popup__address {
    font-size: 12px;
    color: var(--oesbv-muted);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.oesbv-cl-popup__address svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 2px; }
.oesbv-cl-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oesbv-cl-popup__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--oesbv-radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--oesbv-trans);
}
.oesbv-cl-popup__btn--primary {
    background: var(--oesbv-turquoise);
    color: #fff;
}
.oesbv-cl-popup__btn--primary:hover { background: var(--oesbv-turquoise-dark); color: #fff; }
.oesbv-cl-popup__btn--secondary {
    background: var(--oesbv-bg);
    color: var(--oesbv-dark);
    border: 1px solid var(--oesbv-border);
}
.oesbv-cl-popup__btn--secondary:hover { border-color: var(--oesbv-turquoise); color: var(--oesbv-turquoise); }
.oesbv-cl-popup__btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 860px) {
    .oesbv-cl-layout { grid-template-columns: 1fr; }
    .oesbv-cl-list-col { border-left: none; border-top: 1px solid var(--oesbv-border); }
    .oesbv-cl-list { max-height: 340px !important; }
    #oesbv-cl-map { height: 340px !important; }
}
@media (max-width: 540px) {
    .oesbv-cl-filters__inner { flex-direction: column; }
    .oesbv-cl-filter-group { min-width: 100%; }
    .oesbv-cl-results-count { margin-left: 0; }
    .oesbv-cl-card__img { width: 56px; }
    .oesbv-cl-card__name { font-size: 15px; }
}
