/*
 * System Dewelopera v2.0
 *
 * © 2026 Let's Build Mateusz Kliś
 * Biczyce Dolne 166, 33-395 Chełmiec
 * NIP: 7343577547
 *
 * Wszelkie prawa zastrzeżone.
 */

/* ================================================
   SYSTEM DEWELOPERA — ZMIENNE (edytuj tutaj)
   Zmień tylko tę sekcję, aby zmienić cały wygląd.
   ================================================ */
:root {
    /* Kolory główne */
    --sd-primary:             #111111;
    --sd-primary-hover:       #333333;

    /* Tło i tekst */
    --sd-bg:                  #ffffff;
    --sd-text:                #111111;
    --sd-border:              #e0e0e0;
    --sd-text-muted:          #777777;

    /* Statusy */
    --sd-status-dostepne:     #2e7d32;
    --sd-status-zarezerwowane:#e65100;
    --sd-status-sprzedane:    #c62828;
    --sd-status-niedostepne:  #9e9e9e;

    /* Wyszukiwarka 3D — przyciski budynków/pięter */
    --sd-3d-btn-bg:           transparent;
    --sd-3d-btn-text:         var(--sd-primary);
    --sd-3d-btn-border:       var(--sd-primary);
    --sd-3d-btn-hover-bg:     var(--sd-primary);
    --sd-3d-btn-hover-text:   #ffffff;
    --sd-3d-btn-active-bg:    var(--sd-primary);
    --sd-3d-btn-active-text:  #ffffff;

    /* Tooltip */
    --sd-tooltip-bg:          #ffffff;
    --sd-tooltip-border:      #f0f0f0;
    --sd-tooltip-shadow:      rgba(0,0,0,0.10);
    --sd-tooltip-text:        var(--sd-text);
    --sd-tooltip-accent:      var(--sd-primary);

    /* Loading overlay */
    --sd-loading-bg:          #f5f5f5;
    --sd-spinner-border:      rgba(17,17,17,0.08);
    --sd-spinner-top:         #111111;

    /* Zaokrąglenia */
    --sd-radius:              5px;
    --sd-radius-canvas:       5px;
}


/* ================================================
   LAYOUT GŁÓWNY
   ================================================ */

.system-dewelopera {
    position: relative;
}

.system-dewelopera .container {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

.system-dewelopera div#wybor {
    background: var(--sd-primary);
    color: #ffffff;
    padding: 10px 0;
    margin-bottom: 5px;
}

.system-dewelopera .left-panel {
    display: none !important;
    width: 100%;
    overflow-y: auto;
    background-color: transparent;
    padding: 0 1rem;
    margin-top: 71px;
    max-width: 250px;
    position: relative;
    padding-bottom: 0;
}

.system-dewelopera .right-panel {
    width: 100%;
    position: relative;
    z-index: 3;
}


/* ================================================
   WIZUALIZACJA (obraz + canvas)
   ================================================ */

.system-dewelopera .inwestycja {
    position: relative;
    display: flex;
}

.system-dewelopera .inwestycja img {
    border-radius: var(--sd-radius-canvas);
    width: 100%;
    height: auto;
}

.system-dewelopera #myCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}

.system-dewelopera .tooltip {
    position: absolute;
    z-index: 10;
}


/* ================================================
   PANEL LEWEGO (przyciski budynków)
   ================================================ */

.buildings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.system-dewelopera .panel .btn-plan {
    display: block;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border: 1px solid var(--sd-3d-btn-border);
    background-color: var(--sd-3d-btn-bg);
    color: var(--sd-3d-btn-text);
    border-radius: var(--sd-radius);
    padding: 0.25rem 0.75rem;
    transition: background-color 0.15s, color 0.15s;
}

.system-dewelopera .panel .btn-plan:hover {
    background: var(--sd-3d-btn-hover-bg);
    color: var(--sd-3d-btn-hover-text);
}

.system-dewelopera .panel .btn-plan.active {
    background-color: var(--sd-3d-btn-active-bg);
    color: var(--sd-3d-btn-active-text);
}

.system-dewelopera .panel .btn-plan .name {
    font-weight: 400;
    font-size: 14px;
}

.system-dewelopera .panel .btn-plan .count {
    float: right;
    font-size: 14px;
}

.system-dewelopera .floors.active {
    display: block;
}


/* ================================================
   NAWIGACJA PIĘTER (right-panel)
   ================================================ */

.floors-navigation {
    position: absolute;
    top: 20px;
    right: 36px;
    z-index: 999999;
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.floors-navigation.active {
    display: flex;
}

.floors-navigation h3 {
    display: none;
    font-size: 14px !important;
    font-weight: 500;
    margin: 0;
    text-align: left;
}

.floors-navigation .floors-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.floors-navigation .floor-button {
    border: 1px solid var(--sd-3d-btn-border);
    background: var(--sd-3d-btn-bg);
    color: var(--sd-3d-btn-text);
    cursor: pointer;
    border-radius: var(--sd-radius);
    font-size: 16px;
    font-weight: 300;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
    padding: 8px 16px;
}

.floors-navigation .floor-button:hover {
    background: var(--sd-3d-btn-hover-bg);
    color: var(--sd-3d-btn-hover-text);
}

.floors-navigation .floor-button.active {
    background: var(--sd-3d-btn-active-bg);
    color: var(--sd-3d-btn-active-text);
}


/* ================================================
   PRZYCISK POWRÓT
   ================================================ */

.powrot {
    position: absolute;
    padding: 8px 32px;
    border-radius: var(--sd-radius);
    background: var(--sd-primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 300;
    left: 36px;
    display: none;
    gap: 10px;
    align-items: center;
    top: 16px;
    z-index: 4;
    cursor: pointer;
    transition: background 0.15s;
}

.powrot:hover {
    background: var(--sd-primary-hover);
    color: #ffffff;
}

.powrot img {
    width: 20px;
}


/* ================================================
   TYTUŁ
   ================================================ */

.tytul {
    color: var(--sd-text);
    margin-bottom: 0;
    padding: 1rem;
    font-size: 40px;
    display: none;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

.tytul2 {
    backdrop-filter: blur(4px);
    position: absolute;
    z-index: 99999;
    color: var(--sd-text);
    width: 100%;
    background: rgba(255, 255, 255, 0.5);
    font-size: 36px;
    font-weight: 400;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
}

.system-dewelopera.main-view .tytul2 {
    display: none;
}


/* ================================================
   TOOLTIP (canvas hover)
   ================================================ */

#tooltip {
    position: fixed;
    pointer-events: none;
    padding: 20px 18px;
    border-radius: var(--sd-radius-canvas);
    font-size: 12px;
    display: none;
    z-index: 1000;
    transition: opacity 0.2s;
    top: 0;
    left: 0;
    max-width: 350px;
    width: auto;
    min-width: 150px;
    min-height: 50px;
    background: var(--sd-tooltip-bg);
    border: 1px solid var(--sd-tooltip-border);
    box-shadow: 2px 2px 45px var(--sd-tooltip-shadow);
    color: var(--sd-tooltip-text);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

#tooltip .divider {
    width: 100%;
    height: 1px;
    background-color: var(--sd-border);
}

#tooltip .title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sd-tooltip-text);
    margin: 0;
}

/* === Header tooltipa: kropka statusu po lewej + tytuł === */
#tooltip .tooltip-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
#tooltip .tooltip-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 1.5s infinite;
}
#tooltip .tooltip-status-dot[data-status="Dostępny"]      { background: var(--sd-status-dostepne); }
#tooltip .tooltip-status-dot[data-status="Zarezerwowany"] { background: var(--sd-status-zarezerwowane); }
#tooltip .tooltip-status-dot[data-status="Sprzedany"]     { background: var(--sd-status-sprzedane); }
#tooltip .tooltip-status-dot[data-status="Niedostępny"]   {
    background: var(--sd-status-niedostepne);
    animation: none;
}

/* === Cena na samym dole — bold, w rozmiarze tytułu === */
#tooltip .tooltip-cena {
    font-size: 14px;
    font-weight: 700;
    color: var(--sd-tooltip-text);
    margin: 0;
    text-align: left;
}

/* Blok ceny — stack pionowy, wszystkie ceny do lewej */
#tooltip .tooltip-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}

/* Cena przed obniżką (przekreślona, drobna, szara) */
#tooltip .tooltip-cena-przed {
    font-size: 12px;
    color: #999999;
    text-decoration: line-through;
    line-height: 1.2;
    margin: 0;
    text-align: left;
}

/* Cena promocyjna główna - w kolorze promocji */
#tooltip .tooltip-cena--promo {
    color: var(--sd-promo-color, #c1272d);
}

/* Cena za metr — pod główną, mniejsza, szara, do lewej */
#tooltip .tooltip-cena-m2 {
    font-size: 12px;
    color: var(--sd-text-muted, #777777);
    line-height: 1.3;
    margin: 0;
    text-align: left;
}

/* Najniższa cena z 30 dni (Omnibus) — bardzo cicha, italic */
#tooltip .tooltip-cena-min30 {
    font-size: 10px;
    color: #999999;
    font-style: italic;
    line-height: 1.3;
    margin: 4px 0 0 0;
    text-align: left;
}

/* Kontener pillsa "Promocja" — nad cenami */
#tooltip .tooltip-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

/* Pill "Promocja" nad cenami w tooltipie - mniejszy niż w kafelku */
#tooltip .tooltip-promo-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--sd-radius);
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    background: var(--sd-promo-color, #c1272d);
    width: fit-content;
}

#tooltip .podpis {
    background: transparent;
    text-align: left;
    color: var(--sd-tooltip-accent);
    width: 100%;
    padding: 5px 0;
    margin-bottom: -7px;
    border-radius: var(--sd-radius);
}

#tooltip p {
    font-size: 14px;
    margin: 0;
    color: var(--sd-tooltip-text);
}

#tooltip .status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

#tooltip .status[data-status="Dostępny"]      { color: var(--sd-status-dostepne); }
#tooltip .status[data-status="Zarezerwowany"] { color: var(--sd-status-zarezerwowane); }
#tooltip .status[data-status="Sprzedany"]     { color: var(--sd-status-sprzedane); }
#tooltip .status[data-status="Niedostępny"]   { color: var(--sd-status-niedostepne); }

#tooltip .status p {
    color: inherit;
}

#tooltip .status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

#tooltip .status[data-status="Dostępny"] .dot      { background-color: var(--sd-status-dostepne); }
#tooltip .status[data-status="Zarezerwowany"] .dot { background-color: var(--sd-status-zarezerwowane); }
#tooltip .status[data-status="Sprzedany"] .dot     { background-color: var(--sd-status-sprzedane); }
#tooltip .status[data-status="Niedostępny"] .dot   {
    background-color: var(--sd-status-niedostepne);
    animation: none;
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1);   opacity: 1; }
}


/* ================================================
   LOADING OVERLAY
   ================================================ */

.loading-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: var(--sd-loading-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    border: 4px solid var(--sd-spinner-border);
    border-top: 4px solid var(--sd-spinner-top);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: var(--sd-text-muted);
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}


/* ================================================
   SCROLLBAR PANEL
   ================================================ */

.left-panel::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
}

.left-panel::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .3);
}

.gradient-overlay {
    width: 258px;
    position: absolute;
    height: 50px;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
}


/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .system-dewelopera .container {
        display: none;
    }
}

