/* ============================================================
 *  Визия Русе — Карта: Sidebar layout + Идея-картички (v5)
 *  Свръхспецифични селектори + проправен mobile layout
 * ============================================================ */

/* ── 0. ТОПБАР — категориите на 2 реда на десктоп ── */
html body.page-karta-full .karta-filters {
    flex-wrap: wrap !important;
    overflow: visible !important;
    height: auto !important;
    gap: 6px !important;
    justify-content: center;
    padding: 10px 18px !important;
}
html body.page-karta-full #karta-topbar {
    height: auto !important;
    min-height: 60px;
    padding-bottom: 6px;
}


/* ── 1. LAYOUT: split-screen (десктоп) ── */
html body.page-karta-full #karta-main {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 0 !important;
    position: relative;
}

html body.page-karta-full #karta-map-area {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-height: 720px;
    position: relative;
    overflow: hidden;
}

html body.page-karta-full #karta-map-area svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

html body.page-karta-full #karta-panel {
    flex: 0 0 400px !important;
    width: 400px !important;
    max-width: 400px !important;
    min-height: 600px;
    background: #0d1f35;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0;
    overflow-y: auto;
    display: none !important;
}
html body.page-karta-full #karta-panel.open {
    display: flex !important;
    flex-direction: column !important;
}


/* ── 2. MOBILE LAYOUT: вертикално, картата заема цял екран ── */
@media (max-width: 900px) {
    html body.page-karta-full #karta-main {
        flex-direction: column !important;
    }

    /* Картата заема цялата ширина + минимум 70vh височина */
    html body.page-karta-full #karta-map-area {
        flex: none !important;
        width: 100% !important;
        min-height: 70vh !important;
        height: auto !important;
    }

    /* SVG-то на картата трябва да се запълни в map-area */
    html body.page-karta-full #karta-map-area svg,
    html body.page-karta-full #ruse-svg {
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        display: block !important;
    }

    /* Панелът става bottom-section */
    html body.page-karta-full #karta-panel {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* На мобилно категориите по-малки */
    html body.page-karta-full .karta-filters {
        padding: 8px 12px !important;
        gap: 4px !important;
    }
    html body.page-karta-full .karta-filters .map-filter-pill {
        font-size: 12px !important;
        padding: 5px 10px !important;
    }
}


/* ── 3. PANEL HEADER ── */
.dp-header {
    padding: 24px 22px 20px;
    background: linear-gradient(180deg, #1a2d4d 0%, #0d1f35 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 5;
}
.dp-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    line-height: 1.05;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}
.dp-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.dp-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(244, 196, 48, 0.15);
    color: #F4C430;
    border-radius: 99px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dp-count-badge::before {
    content: '💡';
    font-size: 13px;
}
.dp-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.dp-btn-solid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    background: #1D9E75;
    color: #fff !important;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s, transform 0.15s;
    flex: 1;
    text-align: center;
}
.dp-btn-solid:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.dp-btn-solid::before {
    content: '+';
    font-size: 16px;
    font-weight: 400;
    margin-right: 2px;
}


/* ── 4. PANEL SECTIONS ── */
.dp-section {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dp-section:last-child {
    border-bottom: none;
}
.dp-section-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
}


/* ── 5. КАТЕГОРИИ В КВАРТАЛА ── */
.dp-cat-row {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    font-family: 'DM Sans', sans-serif;
}
.dp-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dp-cat-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dp-cat-bar {
    display: none;
}
.dp-cat-count {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    min-width: 24px;
    text-align: right;
}


/* ── 6. КАРТИЧКА НА ИДЕЯ ── */
.dp-idea-card {
    display: grid !important;
    grid-template-columns: 92px 1fr !important;
    gap: 0;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px !important;
    overflow: hidden;
    text-decoration: none !important;
    margin-bottom: 10px;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    width: auto !important;
}
.dp-idea-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(244, 196, 48, 0.3);
    transform: translateY(-1px);
}
.dp-idea-card:last-child {
    margin-bottom: 0;
}

.dp-idea-thumb {
    width: 92px !important;
    height: 100% !important;
    min-height: 92px;
    background-size: cover !important;
    background-position: center !important;
    background-color: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.dp-idea-body {
    padding: 12px 14px !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.dp-idea-cat {
    font-family: 'DM Mono', monospace !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em;
    line-height: 1;
}
.dp-idea-title {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.dp-idea-meta {
    display: flex !important;
    align-items: center;
    gap: 12px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: auto;
}
.dp-idea-votes {
    color: #1D9E75 !important;
    font-weight: 600;
}


/* ── 7. SEE ALL LINK ── */
.dp-see-all {
    display: block;
    margin-top: 12px;
    padding: 10px 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #F4C430 !important;
    text-decoration: none !important;
    transition: background 0.15s;
}
.dp-see-all:hover {
    background: rgba(244, 196, 48, 0.1);
}
.dp-see-all::after {
    content: ' →';
}


/* ── 8. EMPTY STATE ── */
.dp-empty {
    text-align: center;
    padding: 30px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.dp-empty::before {
    content: '💡';
    display: block;
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.6;
}
.dp-empty p {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 16px;
    line-height: 1.55;
}
.dp-empty a {
    display: inline-block;
    padding: 9px 18px;
    background: #1D9E75;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: filter 0.15s;
}
.dp-empty a:hover {
    filter: brightness(1.1);
}


/* ── 9. CLOSE BUTTON ── */
.dp-close, .karta-panel-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 10;
}
.dp-close:hover, .karta-panel-close:hover {
    background: rgba(255, 255, 255, 0.18);
}


/* ============================================================
 *  ZOOM CONTROLS (бутони долу вдясно на картата)
 * ============================================================ */

html body.page-karta-full #karta-map-area {
    overflow: hidden;
}

html body.page-karta-full #karta-map-area svg {
    cursor: grab;
    transition: none !important;
}
html body.page-karta-full #karta-map-area svg:active {
    cursor: grabbing;
}

#vr-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vr-zoom-btn {
    width: 40px;
    height: 40px;
    background: #0d1f35;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
    padding: 0;
}
.vr-zoom-btn:hover {
    background: #1a2d4d;
    color: #F4C430;
}
.vr-zoom-btn:active {
    transform: scale(0.92);
}
.vr-zoom-btn:focus {
    outline: none;
    background: #1a2d4d;
}

@media (max-width: 900px) {
    #vr-zoom-controls {
        bottom: 16px;
        right: 16px;
    }
    .vr-zoom-btn {
        width: 44px;
        height: 44px;
    }
}


/* ============================================================
 *  HEATMAP — hover state остава приоритетен
 * ============================================================ */

html body.page-karta-full #karta-map-area [data-district]:hover {
    fill: #F4C430 !important;
    fill-opacity: 1 !important;
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1.2;
}
html body.page-karta-full #karta-map-area [data-district].selected,
html body.page-karta-full #karta-map-area [data-district].active {
    fill: #F4C430 !important;
    fill-opacity: 1 !important;
    stroke: #fff;
    stroke-width: 1.5;
}
