/* Style dla frontendu widgetów */

.jcm-offers-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.6;
}

.jcm-offers-widget h3 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.jcm-offers-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jcm-offer-item {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.jcm-offer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: #0073aa;
}

.jcm-offer-image {
    height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.jcm-offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.jcm-offer-item:hover .jcm-offer-image img {
    transform: scale(1.05);
}

.jcm-no-image {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    margin: 10px;
}

.jcm-offer-details {
    padding: 20px;
}

.jcm-offer-details h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.3;
}

.jcm-location {
    color: #666;
    margin: 8px 0;
    font-size: 0.95em;
    display: flex;
    align-items: center;
}

.jcm-location:before {
    content: "📍";
    margin-right: 5px;
    font-size: 0.9em;
}

.jcm-price {
    font-weight: 700;
    color: #0073aa;
    margin: 12px 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

.jcm-price:before {
    content: "";
    margin-right: 0;
    font-size: 1em;
}

.jcm-price-per-sqm {
    color: #888;
    font-size: 0.9em;
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.jcm-price-per-sqm:before {
    content: "📊";
    margin-right: 5px;
    font-size: 0.9em;
}

.jcm-developer {
    color: #555;
    font-size: 0.9em;
    margin: 12px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
}

.jcm-developer:before {
    content: "🏢";
    margin-right: 5px;
    font-size: 0.9em;
}

/* Dodatkowe informacje */
.jcm-offer-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.85em;
    color: #777;
}

.jcm-offer-meta span {
    display: flex;
    align-items: center;
}

.jcm-offer-meta .jcm-area:before {
    content: "📐";
    margin-right: 3px;
}

.jcm-offer-meta .jcm-date:before {
    content: "📅";
    margin-right: 3px;
}

/* Przyciski akcji */
.jcm-offer-actions {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.jcm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jcm-btn-primary {
    background: #0073aa;
    color: #fff;
}

.jcm-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.jcm-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.jcm-btn-secondary:hover {
    background: #545b62;
    color: #fff;
}

.jcm-btn-outline {
    background: transparent;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.jcm-btn-outline:hover {
    background: #0073aa;
    color: #fff;
}

/* Responsywność */
@media (max-width: 768px) {
    .jcm-offers-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .jcm-offer-details {
        padding: 15px;
    }
    
    .jcm-offer-details h4 {
        font-size: 1.1em;
    }
    
    .jcm-offer-actions {
        flex-direction: column;
    }
    
    .jcm-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .jcm-offers-widget h3 {
        font-size: 1.3em;
    }
    
    .jcm-offer-image {
        height: 150px;
    }
    
    .jcm-offer-details {
        padding: 12px;
    }
}

/* Animacje ładowania */
.jcm-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.jcm-loading:before {
    content: "⏳";
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
    animation: spin 1s linear infinite;
}

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

/* Komunikaty */
.jcm-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.jcm-message.info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.jcm-message.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.jcm-message.error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Filtry i sortowanie */
.jcm-filters {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.jcm-filters select,
.jcm-filters input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.jcm-filters label {
    font-weight: 500;
    color: #555;
    margin-right: 5px;
}

/* Paginacja */
.jcm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 10px;
}

.jcm-pagination .jcm-page {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.2s ease;
}

.jcm-pagination .jcm-page:hover,
.jcm-pagination .jcm-page.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.jcm-pagination .jcm-page.disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Style dla historii zmian cen */
.jcm-price-history-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.jcm-price-history-section h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
    font-weight: 600;
}

.jcm-price-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.jcm-price-change {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.85em;
    transition: background-color 0.2s ease;
}

.jcm-price-change:hover {
    background-color: rgba(0,0,0,0.02);
}

.jcm-price-change.jcm-price-increase {
    background-color: #f8fff9;
    border-left: 3px solid #28a745;
    color: #155724;
}

.jcm-price-change.jcm-price-decrease {
    background-color: #fff8f8;
    border-left: 3px solid #dc3545;
    color: #721c24;
}

.jcm-price-change.jcm-price-no-change {
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
    color: #495057;
}

.jcm-change-date {
    color: #666;
    font-size: 0.8em;
    min-width: 70px;
    margin-right: 10px;
}

.jcm-change-details {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.jcm-change-icon {
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 3px;
}

.jcm-change-amount {
    font-weight: 500;
}

.jcm-change-percent {
    color: #666;
    font-size: 0.8em;
    margin-left: 5px;
}

.jcm-no-price-history {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 10px 0;
}

/* Ostatnia zmiana ceny w nagłówku oferty */
.jcm-last-price-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 10px;
}

.jcm-last-price-change.jcm-price-increase {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.jcm-last-price-change.jcm-price-decrease {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.jcm-last-price-change.jcm-price-no-change {
    background: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

/* Wskaźnik trendu w nagłówku */
.jcm-price-trend-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.jcm-price-trend-indicator.increase {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.jcm-price-trend-indicator.decrease {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

.jcm-price-trend-indicator.no-change {
    background: rgba(108, 117, 125, 0.9);
    color: white;
}

/* Kompaktowy widok historii */
.jcm-price-history-compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
}

.jcm-price-history-compact .jcm-price-change {
    padding: 4px 8px;
    margin-bottom: 2px;
    font-size: 0.8em;
}

.jcm-price-history-compact .jcm-change-date {
    min-width: 60px;
    font-size: 0.75em;
}

/* Responsywność dla historii cen */
@media (max-width: 768px) {
    .jcm-price-change {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
        text-align: left;
    }
    
    .jcm-change-date {
        min-width: auto;
        margin-right: 0;
        order: -1;
    }
    
    .jcm-change-details {
        width: 100%;
        justify-content: space-between;
    }
    
    .jcm-price-history-list {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .jcm-price-history-section {
        margin-top: 10px;
        padding-top: 10px;
    }
    
    .jcm-price-change {
        padding: 4px 6px;
        font-size: 0.8em;
    }
    
    .jcm-last-price-change {
        margin-left: 5px;
        padding: 2px 6px;
        font-size: 0.75em;
    }
}

/* Dostępność */
.jcm-offers-widget *:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.jcm-offers-widget .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== IMPORT STYLI METADANYCH ===== */
@import url('metadata.css');
