/* css/history.css */
/**
 * Styling modal popup riwayat simulasi ARISTON Dream Studio
 */

/* ============================================================
   OVERLAY MODAL
   ============================================================ */
.history-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.history-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ============================================================
   PANEL MODAL
   ============================================================ */
.history-modal-panel {
    background: #ffffff;
    border-radius: 8px;
    width: 860px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.history-modal-overlay.active .history-modal-panel {
    transform: translateY(0);
}

/* Header modal */
.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.history-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-modal-title svg {
    color: var(--ariston-red, #C8102E);
}

.history-modal-title h3 {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
}

.history-modal-title span {
    font-size: 13px;
    color: #a0a0a0;
    font-weight: 500;
}

.history-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tombol hapus semua */
.history-btn-clear-all {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn-clear-all:hover,
.history-btn-clear-all.focused {
    border-color: var(--ariston-red, #C8102E);
    color: var(--ariston-red, #C8102E);
}

/* Tombol tutup */
.history-modal-close {
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 20px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.history-modal-close:hover,
.history-modal-close.focused {
    background: var(--ariston-red, #C8102E);
    color: #ffffff;
}

/* ============================================================
   DAFTAR ITEM HISTORY
   ============================================================ */
#history-list-container {
    overflow-y: auto;
    flex: 1;
    padding: 16px 24px;
}

/* State kosong */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    gap: 12px;
    color: #c0c0c0;
}

.history-empty svg {
    width: 56px;
    height: 56px;
    opacity: 0.4;
}

.history-empty p {
    font-size: 17px;
    font-weight: 700;
    color: #888;
    margin: 0;
}

.history-empty span {
    font-size: 14px;
    color: #bbb;
}

/* Item riwayat */
.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    cursor: pointer;
}

.history-item:hover,
.history-item.focused {
    background: #fef5f6;
    border-color: rgba(200, 16, 46, 0.2);
}

/* Thumbnail gambar */
.history-item-thumb {
    width: 88px;
    height: 66px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
    border: 1px solid #eee;
}

.history-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info item */
.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.history-product-name {
    font-size: 15px;
    font-weight: 800;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-date {
    font-size: 12px;
    color: #a0a0a0;
    font-weight: 500;
    white-space: nowrap;
}

/* Tag parameter */
.history-item-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.history-tag svg {
    color: #999;
}

.history-tag-style {
    background: rgba(200, 16, 46, 0.08);
    color: var(--ariston-red, #C8102E);
    text-transform: capitalize;
}

/* Tombol aksi item */
.history-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.history-btn-download {
    background: var(--ariston-red, #C8102E);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn-download:hover,
.history-btn-download.focused {
    background: #a60d26;
    transform: scale(1.05);
}

.history-btn-delete {
    background: #f5f5f5;
    color: #999;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-btn-delete:hover,
.history-btn-delete.focused {
    background: #ffe5e5;
    color: #cc0000;
}
