/* ==========================
   Housing Map
========================== */

.housing-map-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.housing-map {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================
   Housing Marker
========================== */

.housing-marker {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 36px;
    height: 36px;

    transform: translate(-50%, -50%);
    cursor: pointer;
    user-select: none;
    transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.housing-marker:hover {

    transform: translate(-50%, -100%) scale(1.12);

}

/* ==========================
   Housing Information
========================== */

.housing-debug-panel {

    margin-top: 20px;
    padding: 22px 26px;

    background: rgba(22, 27, 34, .95);

    border: 1px solid var(--border);

    border-radius: 10px;

}

.housing-debug-panel h4 {

    margin: 0 0 18px;

    color: var(--gold);

    font-size: 22px;

    font-weight: 600;

}

.housing-info-row {

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 8px 0;

    border-bottom: 1px solid var(--border);

}

.housing-info-row:last-child {

    border-bottom: none;

}

.housing-info-label {

    color: var(--text-secondary);

    font-weight: 600;

}

.housing-info-value {

    color: var(--text);

    font-weight: 500;

}

.housing-neighborhood {

    margin-top: 22px;

    padding-top: 16px;

    border-top: 1px solid var(--border);

    text-align: center;

    color: var(--gold);

    font-size: 15px;

    font-style: italic;

}

.housing-marker.selected {

    transform: translate(-50%, -100%) scale(1.25);

    filter: drop-shadow(0 0 8px gold);

    z-index: 100;

}

.housing-tooltip {

    position: absolute;

    display: none;

    pointer-events: none;

    transform: translate(-50%, -120%);

    background: rgba(13, 17, 23, 0.95);

    border: 1px solid var(--border-strong);

    border-radius: 8px;

    padding: 8px 12px;

    color: white;

    font-size: 14px;

    white-space: nowrap;

    z-index: 1000;

}

/* ==========================
   Mobile
========================== */

@media (max-width: 768px) {

    .housing-marker {

        width: 26px;
        height: 26px;

    }

}

@media (max-width: 480px) {

    .housing-marker {

        width: 22px;
        height: 22px;

    }

}

/* ==========================
   WoW Klassenfarben
========================== */

.class-1  { color: #C79C6E; }  /* Warrior */
.class-2  { color: #F58CBA; }  /* Paladin */
.class-3  { color: #ABD473; }  /* Hunter */
.class-4  { color: #FFF569; }  /* Rogue */
.class-5  { color: #FFFFFF; }  /* Priest */
.class-6  { color: #C41F3B; }  /* Death Knight */
.class-7  { color: #0070DE; }  /* Shaman */
.class-8  { color: #69CCF0; }  /* Mage */
.class-9  { color: #9482C9; }  /* Warlock */
.class-10 { color: #00FF96; }  /* Monk */
.class-11 { color: #FF7D0A; }  /* Druid */
.class-12 { color: #A330C9; }  /* Demon Hunter */
.class-13 { color: #33937F; }  /* Evoker */

/* Status und Besitzer im geöffneten Grundstück übernehmen dieselbe
   Farbzuordnung wie der Besitzer im Karten-Tooltip. */
.housing-status--occupied { color: #ee6a70 !important; }
.housing-status--free { color: #62d69a !important; }

.housing-owner.class-1  { color: #C79C6E !important; }  /* Warrior */
.housing-owner.class-2  { color: #F58CBA !important; }  /* Paladin */
.housing-owner.class-3  { color: #ABD473 !important; }  /* Hunter */
.housing-owner.class-4  { color: #FFF569 !important; }  /* Rogue */
.housing-owner.class-5  { color: #FFFFFF !important; }  /* Priest */
.housing-owner.class-6  { color: #C41F3B !important; }  /* Death Knight */
.housing-owner.class-7  { color: #0070DE !important; }  /* Shaman */
.housing-owner.class-8  { color: #69CCF0 !important; }  /* Mage */
.housing-owner.class-9  { color: #9482C9 !important; }  /* Warlock */
.housing-owner.class-10 { color: #00FF96 !important; }  /* Monk */
.housing-owner.class-11 { color: #FF7D0A !important; }  /* Druid */
.housing-owner.class-12 { color: #A330C9 !important; }  /* Demon Hunter */
.housing-owner.class-13 { color: #33937F !important; }  /* Evoker */
/* ===================================================
   Nachbarschaft Button
=================================================== */

.neighborhood-open-button {
    width: fit-content;
    max-width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 18px;
    border: 1px solid rgba(64,214,248,.2);
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(18,29,42,.96), rgba(16,22,32,.92));
    color: #e8edf3;
    font: 700 15px var(--font-body);
    text-align: left;
    cursor: pointer;
    transition: .2s ease;
}

.neighborhood-open-button span:last-child {
    color: var(--accent-cyan);
    font-size: 20px;
}

.neighborhood-open-button:hover {
    border-color: rgba(64,214,248,.5);
    background: linear-gradient(90deg, rgba(23,42,58,.98), rgba(18,27,39,.96));
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,0,0,.25);
}

/* ===================================================
   Nachbarschaft Modal
=================================================== */

.housing-modal {
    position: fixed;
    inset: 0;
    padding: 82px 16px 16px;
    overflow-y: auto;
    z-index: 7000;
    display: none;
}

.housing-modal.open {
    display: block;
}

.housing-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3,7,12,.76);
    backdrop-filter: blur(5px);
}

.housing-modal-window {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    max-height: calc(100vh - 98px);
    margin: 0 auto;
    overflow: auto;
    background: linear-gradient(180deg, #151d29, #0e151f);
    border: 1px solid rgba(140,175,255,.2);
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(0,0,0,.58);
}

.housing-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(140,175,255,.12);
    background: rgba(9,14,22,.48);
}

.housing-modal-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-cyan);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.housing-modal-header h3 {
    margin: 0;
    color: #f1f5f8;
    font-size: 24px;
    font-weight: 800;
}

.housing-modal-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(140,175,255,.16);
    border-radius: 9px;
    background: #121a26;
    color: #bac4d0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.housing-modal-close:hover {
    color: #fff;
    border-color: rgba(64,214,248,.42);
}

.housing-modal-content {
    padding: 20px;
}

.housing-modal-content .housing-map-container {
    border: 1px solid rgba(140,175,255,.12);
    background: #090e15;
}

@media (max-width: 760px) {
    .housing-modal-window {
        width: min(100%, 1180px);
        max-height: calc(100vh - 98px);
        margin: 0 auto;
    }

    .housing-modal-content {
        padding: 12px;
    }

    .housing-modal { padding: 72px 9px 9px; }
}

body.modal-open {
    overflow: hidden;
}

/* ===================================================
   Final housing modal alignment
   - scrolls below the fixed site header
   - uses the same scrollbar styling as the homepage
=================================================== */
.neighborhood-section .neighborhood-open-button {
    width: auto;
    display: inline-flex;
}

.housing-modal {
    position: fixed;
    top: 74px;
    right: 0;
    bottom: 0;
    left: 224px;
    width: auto;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1100;
}

.housing-modal-backdrop {
    position: absolute;
    inset: 0;
}

.housing-modal-window {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    max-height: calc(100vh - 98px);
    margin: 0 auto;
    overflow: auto;
}

@media (max-width: 760px) {
    .housing-modal {
        top: 62px;
        left: 0;
        padding: 10px;
    }

    .housing-modal-window {
        width: min(100%, 1180px);
        max-height: calc(100vh - 82px);
    }
}

@media (max-width: 820px) {
    .housing-modal-header {
        align-items: flex-start !important;
    }

    .housing-modal-plot-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .housing-modal-plot-row {
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .housing-modal-title-block {
        gap: 8px;
    }
}
