/**
 * PR4 - History Styles
 * Section "Mes impressions" — meme style que les templates
 */

/* Section wrapper — meme padding que les templates */
.history-section {
    padding: 0 0 20px;
    margin-bottom: 20px;
}

/* Header — meme style que .tpl-category-header */
.history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    margin-bottom: 8px;
}

.history-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(14, 165, 233, 0.1);
    color: var(--division-color, #0EA5E9);
}

.history-header-icon svg {
    width: 18px;
    height: 18px;
}

.history-title {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex: 1;
    margin: 0;
}

.history-count {
    font-size: 12px;
    color: var(--text-secondary, #666);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'Calibri', Arial, sans-serif;
    font-weight: 600;
}

/* Grid — meme que .tpl-grid */
.history-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Card — meme style que .tpl-card */
.history-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius, 12px);
    font-family: 'Calibri', Arial, sans-serif;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: visible;
}

.history-card-expired {
    opacity: 0.5;
}

/* Icon — meme que .tpl-card-icon */
.history-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-card-icon svg {
    width: 20px;
    height: 20px;
}

.history-card-icon.history-icon-active {
    background: rgba(15, 138, 79, 0.1);
    color: var(--success-color, #0F8A4F);
}

.history-card-icon.history-icon-expired {
    background: rgba(204, 41, 54, 0.08);
    color: var(--error-color, #CC2936);
}

/* Text zone — meme que .tpl-card-text */
.history-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.history-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1A1A1A);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-sub {
    font-size: 13px;
    color: var(--text-secondary, #666);
    margin-top: 2px;
    line-height: 1.5;
}

/* Action buttons — right side */
.history-card-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--surface, #F4F7FA);
    color: var(--primary-color, #1260A8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.history-icon-btn:hover {
    background: rgba(18, 96, 168, 0.1);
}

.history-action-btn {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    min-height: 32px;
    background: var(--primary-color, #1260A8);
    color: white;
    transition: background 0.2s;
}

.history-action-btn:hover {
    background: #0F4F8A;
}

.history-action-reimport {
    background: var(--surface, #F4F7FA);
    color: var(--text-secondary, #666);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.history-action-reimport:hover {
    background: #E8E8E8;
}

/* Status badge inline */
.history-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    display: inline-block;
    margin-left: 6px;
}

.history-badge-active {
    background: rgba(15, 138, 79, 0.1);
    color: var(--success-color, #0F8A4F);
}

.history-badge-expired {
    background: rgba(204, 41, 54, 0.08);
    color: var(--error-color, #CC2936);
}

.history-badge-printed {
    background: rgba(14, 165, 233, 0.1);
    color: var(--division-color, #0EA5E9);
}

.history-card-icon.history-icon-printed {
    background: rgba(14, 165, 233, 0.1);
    color: var(--division-color, #0EA5E9);
}

/* Delete button — straddling top-right corner */
.history-delete-btn {
    position: absolute;
    top: -10px;
    right: -6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--error-color, #CC2936);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    padding: 0;
    box-shadow: 0 2px 6px rgba(204, 41, 54, 0.3);
    z-index: 1;
}

.history-delete-btn:hover {
    transform: scale(1.1);
}

/* Empty state */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: var(--surface, #F4F7FA);
    border-radius: var(--radius, 12px);
    text-align: center;
}

.history-empty-text {
    font-family: 'Calibri', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-secondary, #666);
    margin: 0;
    line-height: 1.5;
}

/* Separator */
.history-separator {
    height: 1px;
    background: var(--border, #E8E8E8);
    margin: 24px 0;
}
