/* ── Greentown Price Tracker – style front-end i admin ── */

/* ─── Sekcja historii cen (front-end) ─────────────────── */
.gpt-price-history {
    margin: 32px 0 24px;
    padding: 24px 28px;
    background: #f8f7ff;
    border: 1px solid #e0d9f7;
    border-radius: 6px;
    font-family: inherit;
}

.gpt-history-title {
    margin: 0 0 16px;
    font-size: 1.15em;
    font-weight: 700;
    color: #2c2c5a;
    border-bottom: 2px solid #e0d9f7;
    padding-bottom: 10px;
}

/* Aktualna cena */
.gpt-current-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.gpt-current-label {
    font-size: .85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.gpt-current-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #00728d;
}
.gpt-current-m2 {
    font-size: .9em;
    color: #555;
}

/* Badge: najniższa cena 30 dni */
.gpt-min30-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #b8ca46;
    color: #2c3a00;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .82em;
    font-weight: 600;
    margin-bottom: 16px;
}
.gpt-min30-value {
    font-weight: 700;
    font-size: 1.05em;
}

/* Tabela */
.gpt-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88em;
    margin-bottom: 12px;
}
.gpt-history-table th {
    background: #ece8fb;
    color: #3a2d6e;
    font-weight: 700;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #d5cef5;
}
.gpt-history-table td {
    padding: 7px 12px;
    border-bottom: 1px solid #ede9fb;
    color: #333;
    vertical-align: middle;
}
.gpt-history-table tbody tr:last-child td {
    border-bottom: none;
}
.gpt-history-table tbody tr:hover td {
    background: #f1eeff;
}

/* Wiersz bieżący */
.gpt-row-current td {
    background: #edf8fb !important;
}
.gpt-row-current strong {
    color: #00728d;
}

/* Zmiana ceny */
.gpt-down { color: #2e7d32; font-weight: 600; }
.gpt-up   { color: #c62828; font-weight: 600; }

/* Stopka prawna */
.gpt-legal-note {
    font-size: .75em;
    color: #999;
    margin: 8px 0 0;
    line-height: 1.4;
}

/* ─── Przycisk "Historia" w tabeli mieszkań ───────────── */
.gpt-btn-history {
    display: inline-block;
    padding: 4px 12px;
    background: #00728d;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: .8em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.gpt-btn-history:hover {
    background: #005f72;
}
.gpt-no-history {
    color: #bbb;
    font-size: .85em;
}

/* ─── Modal overlay ────────────────────────────────────── */
.gpt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.gpt-modal-box {
    background: #fff;
    border-radius: 8px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 32px 24px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.gpt-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
}
.gpt-modal-close:hover { color: #333; }

.gpt-modal-title {
    margin: 0 0 16px;
    font-size: 1.1em;
    font-weight: 700;
    color: #2c2c5a;
    padding-right: 28px;
}

/* ─── Wyszukiwarka ceny po dacie ─────────────────────── */
.gpt-date-lookup {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f4f2ff;
    border-radius: 6px;
}
.gpt-date-lookup input[type="date"] {
    border: 1px solid #c5bef5;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: .9em;
    color: #333;
    background: #fff;
}
.gpt-btn-fetch {
    display: inline-block;
    padding: 5px 14px;
    background: #3a2d6e;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: .85em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.gpt-btn-fetch:hover { background: #2c2255; }
.gpt-price-result {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 1em;
    min-height: 1em;
}
.gpt-price-found {
    background: #edf8fb;
    color: #00728d;
    border-left: 3px solid #00728d;
}
.gpt-price-found strong { font-size: 1.2em; }
.gpt-price-m2 { font-size: .85em; color: #555; }
.gpt-price-none {
    background: #fff5f5;
    color: #c62828;
    border-left: 3px solid #c62828;
}

/* ─── Admin: meta box ──────────────────────────────────── */
.gpt-admin-history .gpt-history-table {
    font-size: .85em;
}
.gpt-admin-history .gpt-history-table th {
    background: #f0f0f1;
    color: #1d2327;
    font-weight: 600;
    padding: 6px 10px;
}
.gpt-admin-history .gpt-history-table td {
    padding: 5px 10px;
}
.gpt-admin-history .gpt-current-row td {
    background: #e8f5e9;
    font-weight: 600;
}
.gpt-min30-info {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: #fffde7;
    border-left: 3px solid #b8ca46;
    font-size: .85em;
    color: #444;
}
