/* ============================================================
   ZeroTier VPN - History Page Styles
   Reuses --zt-* variables from dashboard.css (linked alongside)
   ============================================================ */

/* ---- Header ---- */
.zt-hist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.zt-hist-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.zt-hist-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zt-hist-back {
    color: var(--zt-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--zt-radius-sm);
    transition: background 0.15s;
}

.zt-hist-back:hover {
    background: var(--zt-primary-light);
    text-decoration: none;
}

.zt-hist-auto-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--zt-text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.zt-hist-auto-label input[type="checkbox"] {
    accent-color: var(--zt-primary);
}

/* ---- Filters ---- */
.zt-hist-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.zt-hist-date-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.zt-hist-date-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--zt-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.zt-hist-date-input {
    padding: 6px 10px;
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius-sm);
    background: var(--zt-surface);
    color: var(--zt-text);
    font-size: 13px;
    font-family: inherit;
}

.zt-hist-date-input:focus {
    outline: none;
    border-color: var(--zt-primary);
    box-shadow: 0 0 0 2px var(--zt-primary-light);
}

.zt-hist-search {
    flex: 1;
    min-width: 180px;
}

/* ---- Summary ---- */
.zt-hist-summary {
    font-size: 13px;
    color: var(--zt-text-muted);
    margin-bottom: 12px;
    padding: 0 4px;
}

/* ---- Event List ---- */
.zt-hist-event-list {
    background: var(--zt-surface);
    border: 1px solid var(--zt-border);
    border-radius: var(--zt-radius);
    box-shadow: var(--zt-shadow);
    overflow: hidden;
}

.zt-hist-event-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--zt-border);
    transition: background 0.1s;
}

.zt-hist-event-item:last-child {
    border-bottom: none;
}

.zt-hist-event-item:hover {
    background: var(--zt-surface-hover);
}

.zt-hist-event-item .zt-history-dot {
    flex-shrink: 0;
    margin-top: 6px;
}

.zt-hist-event-content {
    flex: 1;
    min-width: 0;
}

.zt-hist-event-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.zt-hist-member-link {
    color: var(--zt-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.zt-hist-member-link:hover {
    text-decoration: underline;
}

.zt-hist-event-label {
    font-size: 13px;
    color: var(--zt-text);
}

.zt-hist-event-detail {
    font-size: 12px;
    color: var(--zt-text-muted);
    margin-top: 2px;
    word-break: break-all;
}

.zt-hist-event-time {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--zt-text-muted);
    white-space: nowrap;
    margin-top: 2px;
}

/* ---- Load More ---- */
.zt-hist-load-more {
    text-align: center;
    padding: 16px;
}

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

    .zt-hist-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .zt-hist-date-group {
        flex-wrap: wrap;
    }

    .zt-hist-search {
        min-width: unset;
    }

    .zt-hist-event-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .zt-hist-event-top {
        flex-direction: column;
        gap: 2px;
    }

    .zt-hist-event-time {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .zt-hist-date-group {
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
    }

    .zt-hist-date-input {
        width: 100%;
    }
}
