/* Publikatorcen Units Widget Styles */

.puw-units-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.puw-controls {
    margin-bottom: 20px;
    text-align: right;
}

.puw-refresh-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.puw-refresh-btn:hover {
    background: #005a87;
}

.puw-refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.puw-refresh-icon {
    margin-right: 5px;
}

/* Grid Layout */
.puw-units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.puw-unit-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.puw-unit-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.puw-unit-number {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 8px;
}

.puw-investment {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.puw-developer {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.puw-area {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.puw-prices {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.puw-price-per-sqm {
    font-size: 16px;
    color: #0073aa;
    font-weight: bold;
    margin-bottom: 4px;
}

.puw-total-price {
    font-size: 18px;
    color: #2c5530;
    font-weight: bold;
}

/* List Layout */
.puw-units-list {
    margin-top: 20px;
}

.puw-unit-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.puw-unit-info {
    flex: 1;
}

.puw-unit-header {
    margin-bottom: 8px;
}

.puw-unit-number {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

.puw-investment {
    color: #333;
    font-weight: 500;
}

.puw-developer {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.puw-area {
    font-size: 14px;
    color: #555;
}

.puw-prices {
    text-align: right;
    min-width: 150px;
}

.puw-price-per-sqm {
    font-size: 16px;
    color: #0073aa;
    font-weight: bold;
    margin-bottom: 4px;
}

.puw-total-price {
    font-size: 18px;
    color: #2c5530;
    font-weight: bold;
}

/* Table Layout */
.puw-units-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.puw-units-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.puw-units-table th {
    background: #0073aa;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.puw-units-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.puw-units-table tr:hover {
    background: #f8f9fa;
}

/* Unified table - Units and Price History together */
.puw-unified-table .puw-unit-row {
    background: #fff;
    font-weight: 500;
}

.puw-unified-table .puw-unit-row:hover {
    background: #f0f7ff;
}

.puw-unified-table .puw-ph-row {
    background: #fafafa;
    font-size: 0.95em;
}

.puw-unified-table .puw-ph-row:hover {
    background: #f0f0f0;
}

.puw-unified-table .puw-ph-cell {
    color: #555;
    font-style: italic;
}

.puw-unified-table .puw-unit-ref {
    color: #888;
    font-size: 0.9em;
}

.puw-unified-table .puw-ph-empty {
    background: #fafafa;
}

/* Status badges */
.puw-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2px;
}
.puw-status-wolne {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.puw-status-rezerwacja {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}
.puw-status-sprzedane {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

 

/* Error and No Units Messages */
.puw-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.puw-no-units {
    background: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

/* Loading State */
.puw-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.puw-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: puw-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes puw-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .puw-units-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .puw-unit-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .puw-prices {
        text-align: left;
        margin-top: 10px;
        min-width: auto;
    }
    
    .puw-units-table-container {
        font-size: 14px;
    }
    
    .puw-units-table th,
    .puw-units-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .puw-unit-card {
        padding: 15px;
    }
    
    .puw-unit-item {
        padding: 15px;
    }
    
    .puw-units-table {
        font-size: 12px;
    }
    
    .puw-units-table th,
    .puw-units-table td {
        padding: 6px;
    }
}
