/**
 * Frontend Styles - Publiczne Ceny Pro
 * 
 * Style dla shortcode'ów wyświetlających mieszkania na froncie strony
 * 
 * @package    Ceny_Mieszkan_Deweloper
 * @version    2.0.0
 */

/* ========================================
   OGÓLNE STYLE
======================================== */

.cmd-properties-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}

.cmd-no-properties,
.cmd-error,
.cmd-no-history {
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    margin: 20px 0;
    font-size: 14px;
    color: #495057;
}

.cmd-error {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* ========================================
   TABELA MIESZKAŃ
======================================== */

.cmd-properties-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
}

.cmd-properties-table thead {
    background: #2c3e50;
    color: #fff;
}

.cmd-properties-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.cmd-properties-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

.cmd-properties-table tbody tr:hover {
    background-color: #f8f9fa;
}

.cmd-properties-table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Kolumny */
.cmd-property-number {
    font-weight: 600;
    color: #2c3e50;
}

.cmd-property-address {
    color: #495057;
}

.cmd-property-type {
    font-size: 13px;
    color: #6c757d;
}

.cmd-property-area {
    font-weight: 500;
}

.cmd-property-price-sqm,
.cmd-property-price-total {
    font-weight: 600;
    color: #28a745;
    font-size: 15px;
}

/* ========================================
   STATUSY
======================================== */

.cmd-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cmd-status-dostepny {
    background: #d4edda;
    color: #155724;
}

.cmd-status-rezerwacja {
    background: #fff3cd;
    color: #856404;
}

.cmd-status-sprzedany {
    background: #f8d7da;
    color: #721c24;
}

.cmd-status-archiwum {
    background: #e2e3e5;
    color: #383d41;
}

/* ========================================
   PRZYCISKI
======================================== */

.cmd-show-history {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.cmd-show-history:hover {
    background: #0056b3;
}

.cmd-show-history:active {
    transform: scale(0.98);
}

/* ========================================
   HISTORIA CEN
======================================== */

.cmd-history-row {
    background: #f8f9fa !important;
}

.cmd-history-container {
    padding: 20px;
}

.cmd-price-history h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.cmd-history-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cmd-history-table thead {
    background: #495057;
    color: #fff;
}

.cmd-history-table thead th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.cmd-history-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.cmd-history-table tbody td {
    padding: 10px 12px;
    font-size: 13px;
}

/* Zmiana ceny */
.cmd-price-up {
    color: #dc3545;
    font-weight: 600;
}

.cmd-price-down {
    color: #28a745;
    font-weight: 600;
}

.cmd-price-same {
    color: #6c757d;
}

.cmd-first-record {
    font-style: italic;
    color: #6c757d;
    font-size: 12px;
}

/* ========================================
   POJEDYNCZE MIESZKANIE
======================================== */

.cmd-single-property {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.cmd-property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.cmd-property-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
}

.cmd-property-details {
    margin-bottom: 30px;
}

.cmd-detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.cmd-detail-row:last-child {
    border-bottom: none;
}

.cmd-detail-label {
    flex: 0 0 180px;
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
}

.cmd-detail-value {
    flex: 1;
    color: #2c3e50;
    font-size: 14px;
}

.cmd-detail-value.cmd-price {
    font-size: 20px;
    font-weight: 700;
    color: #28a745;
}

.cmd-property-history-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

/* ========================================
   RESPONSYWNOŚĆ
======================================== */

@media screen and (max-width: 768px) {
    .cmd-properties-table {
        font-size: 12px;
    }

    .cmd-properties-table thead th,
    .cmd-properties-table tbody td {
        padding: 8px 10px;
    }

    .cmd-status-badge {
        font-size: 10px;
        padding: 4px 8px;
    }

    .cmd-single-property {
        padding: 20px;
    }

    .cmd-property-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cmd-property-header h2 {
        font-size: 22px;
    }

    .cmd-detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .cmd-detail-label {
        flex: none;
    }
}

@media screen and (max-width: 480px) {
    /* Ukryj niektóre kolumny na małych ekranach */
    .cmd-properties-table .cmd-property-type,
    .cmd-properties-table .cmd-property-area {
        display: none;
    }

    .cmd-properties-table thead th {
        font-size: 10px;
    }
}

/* ========================================
   INTERAKTYWNOŚĆ (dla JavaScript)
======================================== */

.cmd-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px !important;
}

.cmd-sortable:hover {
    background: rgba(255,255,255,0.1);
}

.cmd-sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    opacity: 0.5;
}

.cmd-sortable.cmd-sort-asc::after {
    content: '↑';
    opacity: 1;
}

.cmd-sortable.cmd-sort-desc::after {
    content: '↓';
    opacity: 1;
}

/* Filtry */
.cmd-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cmd-filters label {
    margin-right: 10px;
    font-weight: 600;
    font-size: 13px;
}

.cmd-filters select,
.cmd-filters input {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    margin-right: 15px;
    font-size: 13px;
}

/* Loading state */
.cmd-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cmd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: cmd-spin 1s linear infinite;
}

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





