/**
 * Price History Modal - Shared CSS
 * Centralized modal styles used across all views (table, cards, single)
 */

/* Modal Overlay */
.price-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay-color, rgba(0, 0, 0, 0.5));
    z-index: var(--modal-z-index, 10000);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn var(--modal-animation-duration, 0.3s) ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.modal-content {
    background: var(--modal-background-color, white);
    border-radius: var(--modal-border-radius, 8px);
    max-width: var(--modal-max-width, 600px);
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--modal-box-shadow, 0 10px 30px rgba(0,0,0,0.3));
    animation: modalSlideIn var(--modal-animation-duration, 0.3s) ease;
}

@keyframes modalSlideIn {
    from { transform: scale(0.8) translateY(-20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Modal Header */
.modal-header {
    padding: var(--modal-padding, 20px);
    border-bottom: 1px solid var(--modal-header-border-color, #dee2e6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

/* Modal Close Button */
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--modal-close-btn-color, #666666);
    transition: color 0.2s ease;
}

.modal-close:hover {
    border-radius: 50%;
    color: var(--modal-close-btn-hover-color, #000000);
    background-color: rgba(0,0,0,0.1);
}

.modal-close:focus {
    outline: var(--focus-outline-width, 2px) solid var(--focus-outline-color, #007cba);
    outline-offset: var(--focus-outline-offset, 2px);
}

/* Modal Body */
.modal-body {
    padding: var(--modal-padding, 20px);
}

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

/* History Entries */
.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;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }
}
