/**
 * History Timeline - Frontend Styles
 */

.ht-timeline-wrapper {
    --ht-primary: #255BAB;
    --ht-primary-dark: #1d4d97;
    --ht-border-strong: #b7cae8;
    --ht-border-light: #d8e4f5;
    --ht-text-strong: #1e3e68;
    --ht-text-body: #2b4e7f;

    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.ht-timeline-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--ht-border-strong);
}

.ht-timeline-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: var(--ht-text-strong);
    display: flex;
    align-items: center;
}

.ht-timeline-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--ht-primary);
    margin-right: 10px;
}

.ht-period-label {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* Timeline table */
.ht-timeline-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 2px solid var(--ht-border-strong);
}

.ht-timeline-table tr {
    border-bottom: 1px solid var(--ht-border-light);
}

.ht-timeline-table tr:last-child {
    border-bottom: 2px solid var(--ht-border-strong);
}

.ht-timeline-table td {
    padding: 12px 15px;
    vertical-align: top;
}

/* Year column */
.ht-year-cell {
    width: 100px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: var(--ht-text-strong);
    border-right: 1px solid var(--ht-border-light);
}

/* Date column */
.ht-date-cell,
.ht-timeline-table .ht-date-cell,
.ht-timeline-table td.ht-date-cell {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    text-align: center !important;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--ht-primary) !important;
    padding: 12px 5px !important;
    box-sizing: border-box !important;
}

/* Content column */
.ht-content-cell {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ht-text-body);
}

/* Responsive */
@media (max-width: 768px) {
    .ht-timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ht-timeline-title {
        font-size: 20px;
    }

    .ht-timeline-table {
        display: block;
    }

    .ht-timeline-table tbody {
        display: block;
    }

    .ht-timeline-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 15px 0;
    }

    .ht-year-cell {
        width: 100%;
        text-align: left;
        padding: 10px 15px;
        font-size: 20px;
        border-right: none;
        border-bottom: 1px solid var(--ht-border-light);
    }

    .ht-date-cell {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
        text-align: center !important;
        color: var(--ht-primary) !important;
        padding: 10px 5px 5px !important;
        box-sizing: border-box !important;
    }

    .ht-content-cell {
        width: calc(100% - 140px);
        padding: 10px 15px 5px 0;
    }
}

/* Print */
@media print {
    .ht-timeline-wrapper {
        margin: 10px 0;
    }

    .ht-period-label {
        border: 1px solid var(--ht-primary-dark);
        color: var(--ht-primary-dark) !important;
        background: transparent !important;
    }

    .ht-timeline-table tr {
        page-break-inside: avoid;
    }
}
