/* ─────────────────────────────────────────────
   2. BASE / RESET
   ───────────────────────────────────────────── */
body { margin: 0; padding: 0; font-family: "Rubik", sans-serif; }
#map { height: 100vh; width: 100%; }
h3   { margin: 5px 0; }

/* ─────────────────────────────────────────────
   11. CLUB DETAIL / POPUP
   ───────────────────────────────────────────── */
.pop-up-club .club-info-item {
    background-color: #91f8de;
    padding: 5px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    font-size: 16px !important;
}

.club-detail-container { padding: 16px 8px 8px 8px; }

.popup-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.popup-links a {
    background-color: #1de9b6;
    text-decoration: none;
    border-radius: 5px;
    padding-top: 2px;
    padding-bottom: 2px;
}
.popup-links a:hover,
.popup-links a:focus,
.popup-links a:focus-visible {
    background-color: #16b58e !important;
    outline: none;
    box-shadow: none;
}

.btn.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 24px;
    color: white;
}

.membership-logo-link              { display: block; flex-shrink: 0; text-decoration: none; }
.membership-logo-link img          { transition: border-color 0.2s ease; }
.membership-logo-link:hover img    { border-color: #0a9e78 !important; }

.membership-table-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.membership-table-row:hover { background: #f0fdf8; }

/* ─────────────────────────────────────────────
   5. LAYOUT: DRAWERS
   ───────────────────────────────────────────── */

/* Mobile: slides up from bottom */
.detailDrawer {
    position: fixed;
    background: white;
    transition: transform 0.3s ease;
    z-index: 6000;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 50vh;
    transform: translateY(100%);
    box-shadow: 0 -3px 10px rgba(0,0,0,0.3);
    border-radius: 15px 15px 0 0;
}

.detailDrawer.open              { transform: translateY(0); }
.detailDrawer::-webkit-scrollbar { display: none; }
.detailDrawer p                 { font-size: 14px; }
.detailDrawer h5                { margin: 1rem 0 0.5rem 0; }

#editClubDrawer.detailDrawer { z-index: 6001; }
#filterDrawer.detailDrawer   { z-index: 9999; }
#imprintDrawer.detailDrawer  { z-index: 5999; }

/* Sticky headers: add/edit club drawers use flex so the h3 never scrolls */
#addClubDrawer,
#editClubDrawer {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

#addClubDrawer > h3,
#editClubDrawer > h3 {
    flex-shrink: 0;
}

#addClubDrawer > .container,
#editClubDrawer > .container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#addClubDrawer > .container::-webkit-scrollbar,
#editClubDrawer > .container::-webkit-scrollbar {
    display: none;
}

/* Desktop: slides in from left */
@media (min-width: 769px) {
    .detailDrawer {
        top: 0;
        left: 0;
        width: 450px;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 3px 0 10px rgba(0,0,0,0.2);
        border-radius: 0;
    }

    .detailDrawer.open           { transform: translateX(0); }
    #clubDrawer.detailDrawer     { height: 100vh; }
}

/* ── Membership section search bar ── */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-icon {
    position: absolute;
    left: 14px;
    color: #aaa;
    pointer-events: none;
    font-size: 14px;
}

.search-input {
    padding: 8px 38px 8px 38px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    line-height: 1;
    transition: color 0.15s;
    display: none;
}
.search-clear-btn:hover { color: #555; }

/* ─────────────────────────────────────────────
   8. FILTER PANEL
   ───────────────────────────────────────────── */
.filter-panel {
    width: 100%;
    display: flex;
    justify-content: center;
}

.filter-panel-inner {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    box-sizing: border-box;
    margin-left: 10px;
    margin-right: 12px;
}

.filter-panel label { display: block; margin-top: 6px; }

.filter-label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    font-size: 16px;
    color: #333;
    gap: 5px;
}

/* Type-filter toggle boxes (Federation / Club / Community) */
.select-box         { cursor: pointer; display: inline-block; }
.select-box input   { display: none; }
.select-box .box {
    width: 90px;
    height: 80px;
    border: 2px solid #91f8de;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #1de9b6;
    font-size: 14px;
    transition: 0.2s;
}
.select-box i { font-size: 20px; color: #1de9b6; }
.select-box input:checked + .box {
    border-color: #1de9b6;
    background: #1de9b6;
    color: #fff;
}
.select-box input:checked + .box i { color: #fff; }


/* noUiSlider — members range */
.noUi-tooltip {
    top: 100% !important;
    bottom: auto !important;
    margin-top: 8px;
}
.noUi-tooltip::before { top: -6px; bottom: auto; transform: rotate(180deg); }
.noUi-target  { background-color: #91f8de; }
.noUi-connect { background-color: #1de9b6 !important; }
.noUi-handle  { border: 2px solid #1de9b6; background-color: #ffffff; }

/* ─────────────────────────────────────────────
   9. FORMS (Add / Edit club)
   ───────────────────────────────────────────── */
.field {
    position: relative;
    margin-bottom: 1rem;
}

.field .form-control {
    padding: 1rem 0.75rem 0.5rem;
    border: 1px solid #9e9e9e;
    border-radius: 0.375rem;
    background: transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field .form-control:focus {
    border-color: #1de9b6;
    box-shadow: none !important;
    background: white;
    outline: none !important;
}

/* Floating label */
.field label {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #6c757d;
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
    transition: all 0.15s ease;
    line-height: 1.2;
}
.field .form-control:not(:placeholder-shown):not(:focus) ~ label,
.field .form-control:focus ~ label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    font-size: 0.875rem;
}
.field .form-control:not(:placeholder-shown):not(:focus) ~ label { color: #6c757d; }
.field .form-control:focus ~ label { color: #1de9b6; font-weight: 500; }

/* Textarea */
.field textarea.form-control { padding-top: 1.25rem; resize: vertical; }

.form-control.auto-grow {
    min-height: 3.5rem;
    max-height: 10rem;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.auto-grow::-webkit-scrollbar { display: none; }

/* Select */
.field select.form-control {
    padding-right: 2rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
}

/* Address field: label always floated (placeholder text set in HTML drives it up) */
.field:has(.form-control[name="address"]) label {
    top: 0 !important;
    transform: translateY(-50%) scale(0.85) !important;
    font-size: 0.875rem;
    color: #6c757d;
}
.field .form-control[name="address"]::placeholder   { color: #2b82cb; opacity: 1; }
.field:has(.form-control[name="address"]) .form-control { padding-top: 1.25rem; }

/* Verify-ID field: read-only appearance */
.field:has(.form-control[name="verify_id"]) label {
    top: 0 !important;
    transform: translateY(-50%) scale(0.85) !important;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400 !important;
}
.field:has(.form-control[name="verify_id"]) .form-control {
    padding-top: 1.25rem;
    color: #6c757d;
    border-color: #6c757d !important;
    cursor: default;
}

/* File input: hidden — its <label> acts as the visible trigger */
.logo-input         { display: none; }
.logo-input + label { position: static; }

/* ─────────────────────────────────────────────
   15. IMPRINT
   ───────────────────────────────────────────── */
.imprint-contact      { display: flex; gap: 12px; margin: 4px 0 12px; }
.imprint-contact-link { font-size: 1.4rem; color: #000; transition: color .2s; text-decoration: none; }
.imprint-contact-link:hover { color: #9e9e9e; }

/* ─────────────────────────────────────────────
   10. ADD / EDIT CLUB: LOGO & VERIFY-ID BUTTON
   ───────────────────────────────────────────── */
.logo-preview-container {
    position: relative;
    width: var(--croppie-size);
    height: var(--croppie-size);
    margin: 1rem auto;
}

.placeholder-icon {
    width: var(--croppie-size);
    height: var(--croppie-size);
    border-radius: 50%;
    border: 3px solid #6c757d;
}

.logo-upload-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(98, 0, 238, 0.3);
    transition: all 0.2s;
    z-index: 100;
}
.logo-upload-btn:hover { background: #0056b3; transform: scale(1.1); }

.logo-cropper {
    margin: 1rem auto;
    width: var(--croppie-size);
    height: var(--croppie-size);
}
.logo-cropper .cr-boundary { border-radius: 5% !important; overflow: hidden; }
.logo-cropper .cr-viewport  { border-radius: 50%; border: 3px solid #e0e0e0; }

/* Merged from two previously separate rule blocks */
.verify-refresh-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1de9b6;
    color: white;
    border: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(29, 233, 182, 0.35);
    transition: all 0.2s;
    z-index: 10;
}
.verify-refresh-btn:hover {
    background: #13c2a4;
    transform: translateY(-50%) rotate(180deg) scale(1.05);
}

/* ─────────────────────────────────────────────
   6. MAP ELEMENTS
   ───────────────────────────────────────────── */

.club-logo-map {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #666;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─────────────────────────────────────────────
   7. MODALS
   ───────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 20px 25px;
    border-radius: 10px;
    width: 300px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.modal-content h3 { margin-bottom: 15px; text-align: center; }
.modal-content button {
    width: 100%;
    padding: 8px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.modal-content button:hover { background: #0056b3; }
.modal-content .switch {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #007bff;
    cursor: pointer;
}

/* Modal-specific overrides */
#editIdMessage       { color: #28a745; }
#editIdMessage.error { color: #dc3545 !important; }

#shareModal        { z-index: 9999; }
#deleteClubModal   { z-index: 9999; }
#deleteAccountModal { z-index: 9999; }

#deleteClubModal .button-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}
#deleteCancel       { background: #dc3545; }
#deleteCancel:hover { background: #bb2d3b; }

#deleteAccountModal .button-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}
#deleteAccountConfirm       { background: #dc3545; }
#deleteAccountConfirm:hover { background: #bb2d3b; }
#deleteAccountCancel        { background: #6c757d; }
#deleteAccountCancel:hover  { background: #5a6268; }

/* ─────────────────────────────────────────────
   13. NOTIFICATIONS TOGGLE
   ───────────────────────────────────────────── */
.notif-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.notif-toggle input { opacity: 0; width: 0; height: 0; }
.notif-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: background .2s;
}
.notif-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform .2s;
}
.notif-toggle input:checked + .notif-slider        { background: #1de9b6; }
.notif-toggle input:checked + .notif-slider:before { transform: translateX(20px); }

/* ─────────────────────────────────────────────
   14. SEARCH DROPDOWN
   ───────────────────────────────────────────── */
#search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.22);
    z-index: 1000;
    max-height: 320px;
    overflow-x: hidden;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover      { background: #f0fdf9; }

.search-result-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.search-result-geo-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1de9b7;
    font-size: 16px;
    flex-shrink: 0;
}
.search-result-text    { display: flex; flex-direction: column; min-width: 0; }
.search-result-primary {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-secondary {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-no-clubs   { color: #bbb; font-style: italic; }
.search-result-club-count { color: #1de9b7; font-weight: 600; }
.search-result-loading    { padding: 12px 14px; font-size: 13px; color: #aaa; text-align: center; }

/* ─────────────────────────────────────────────
   4. LAYOUT: FLOATING TOP BAR
   ───────────────────────────────────────────── */
.floatingTopBar {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 90%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
}

@media (min-width: 769px) {
    .floatingTopBar {
        width: 30%;
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .leaflet-control-zoom { display: none !important; }
    #bottomButtons        { bottom: 20px !important; }
}

#mobile-search-input:focus {
    outline: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ─────────────────────────────────────────────
   12. USER MENU
   ───────────────────────────────────────────── */
.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.15s ease;
    white-space: nowrap;
}
.user-menu-item:hover { background: #f5f5f5; }

/* ─────────────────────────────────────────────
   3. SHARED UTILITIES
   ───────────────────────────────────────────── */
.btn {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.share-btn { background: white; }

.btn-success       { background: #007bff; }
.btn-success:hover { background: #0056b3; }

.message {
    text-align: center;
    color: #28a745;
    font-size: 14px;
    margin-top: 8px;
}

/* ─────────────────────────────────────────────
   1. CUSTOM PROPERTIES
   ───────────────────────────────────────────── */
:root {
    --croppie-size: 200px;
}