/* Resources List Frontend Styles - Clean structure for blocks and shortcodes */

/* Container classes */
.resources-list-block,
.ujc-shortcode-resources-list {
    margin: 20px 0;
}

/* Base table structure */
.resources-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.resources-table th,
.resources-table td {
    padding: 12px 15px;
    text-align: left;
}

/* Table styling with CSS variables */
.resources-table th {
    background-color: var(--header-bg-color, #f9f9f9);
    color: var(--header-text-color, #333333);
    font-family: var(--header-font-family, inherit);
}

.resources-table td {
    color: var(--text-color, #333333);
    font-family: var(--content-font-family, inherit);
}

.resources-table tbody tr:hover {
    background-color: var(--hover-bg-color, #f5f5f5);
}

/* Common Button Styles */
.ujc-historia-btn,
.ujc-karta-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875em;
    transition: background-color 0.2s;
}

/* Historia Button */
.ujc-historia-btn {
    background-color: var(--historia-btn-bg-color, #007cba);
    color: var(--historia-btn-text-color, #ffffff);
}

.ujc-historia-btn:hover {
    opacity: 0.8;
}

.ujc-historia-btn:focus {
    outline: 2px solid var(--historia-btn-bg-color, #007cba);
    outline-offset: 2px;
}

/* Karta Button */
.ujc-karta-btn,
.download-floorplan-btn {
    background-color: var(--karta-btn-bg-color, #007cba);
    color: var(--karta-btn-text-color, #ffffff);
}

.ujc-karta-btn:hover,
.download-floorplan-btn:hover {
    opacity: 0.8;
}

/* Status Styles */
.ujc-shortcode-resources-list [class*="ujc-status-"] {
    padding: var(--status-padding, 4px 8px);
    border-radius: var(--status-border-radius, 4px);
    font-size: var(--status-font-size, 0.875em);
    font-weight: var(--status-font-weight, normal);
}

.ujc-status-available {
    background-color: var(--status-available-bg, #28a745);
    color: var(--status-available-color, #ffffff);
}

.ujc-status-sold {
    background-color: var(--status-sold-bg, #dc3545);
    color: var(--status-sold-color, #ffffff);
}

.ujc-status-reserved {
    background-color: var(--status-reserved-bg, #ffc107);
    color: var(--status-reserved-color, #000000);
}

/* Modal Styles */
.price-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    border-radius: 50%;
}

.modal-body {
    padding: 20px;
}

#history-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.history-entry {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.history-entry:last-child {
    border-bottom: none;
}

.history-date {
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.history-change {
    margin: 5px 0;
    padding: 5px 0;
}

.history-change-type {
    font-weight: 500;
    color: #666;
}

.price-change {
    margin-left: 10px;
}

.price-old {
    text-decoration: line-through;
    color: #999;
}

.price-new {
    color: #007cba;
    font-weight: 500;
}

/* Status Display Style Variations */
/* Badge style (default) */
.ujc-shortcode-resources-list [class*="ujc-status-"].ujc-status-style-badge {
    border: 1px solid rgba(0,0,0,0.1);
}

/* Pill style */
.ujc-shortcode-resources-list [class*="ujc-status-"].ujc-status-style-pill {
    border-radius: 50px !important;
    border: none;
}

/* Highlight style */
.ujc-shortcode-resources-list [class*="ujc-status-"].ujc-status-style-highlight {
    opacity: 0.9;
    font-weight: bold;
}

/* Underline style */
.ujc-shortcode-resources-list [class*="ujc-status-"].ujc-status-style-underline {
    background-color: transparent !important;
    border-bottom: 2px solid currentColor;
    border-radius: 0 !important;
    padding-top: 2px;
    padding-bottom: 2px;
}

/* Plain style */
.ujc-shortcode-resources-list [class*="ujc-status-"].ujc-status-style-plain {
    background-color: transparent !important;
    border: none;
    border-radius: 0 !important;
    padding: 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .resources-table {
        font-size: 0.875em;
    }

    .resources-table th,
    .resources-table td {
        padding: 8px 10px;
    }

    .resources-table th:nth-child(2),
    .resources-table td:nth-child(2) {
        display: none;
    }
}

@media (max-width: 480px) {
    .resources-table th,
    .resources-table td {
        padding: 6px 8px;
        font-size: 0.8em;
    }

    .resources-table th:nth-child(4),
    .resources-table td:nth-child(4) {
        display: none;
    }
}