/* ==================== HISTORY PANEL ==================== */
/* History panel - slides from bottom */
.history-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-panel.active {
    pointer-events: auto;
    opacity: 1;
}

/* Overlay background */
.history-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-panel.active .history-overlay {
    opacity: 1;
}

/* Panel content - 70% height */
.history-panel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

/* Panel header */
.history-panel-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    flex-shrink: 0;
}

/* History list container */
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Custom scrollbar for history list */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.5);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

/* History card */
.history-card {
    background: #f5f3f0;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.history-card:hover {
    background: #ebe7e2;
    border-color: rgba(203, 213, 225, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.history-card:active {
    transform: translateY(0);
}

/* History card action buttons */
.history-card-actions {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    gap: 4px;
}

.history-card:hover .history-card-actions {
    display: flex;
}

.history-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
}

.history-action-btn:hover {
    background: #ffffff;
    color: #334155;
}

.history-action-btn.delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* History card inline edit */
.history-card-edit {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card-edit.hidden {
    display: none;
}

.history-edit-input {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    background: #ffffff;
    color: #1e293b;
}

.history-edit-input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.history-edit-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.history-edit-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.history-edit-btn.save {
    color: #16a34a;
}

.history-edit-btn.save:hover {
    background: #f0fdf4;
    border-color: #16a34a;
}

.history-edit-btn.cancel {
    color: #64748b;
}

.history-edit-btn.cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Delete confirmation modal */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

.confirm-modal-overlay.hidden {
    display: none;
}

.confirm-modal {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.confirm-cancel-btn {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.confirm-cancel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.confirm-delete-btn {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: #dc2626;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.confirm-delete-btn:hover {
    background: #b91c1c;
}

.confirm-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Text utilities for truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
