/* "Continue where I left off" recent-visits slide-out panel (RC-9052).
   Moved verbatim from css/Home/style.css so the panel can render on every page via
   RecentVisitsViewComponent. The Home-only content-shift rules (.home-content-wrapper,
   .home-main-content, .home-tiles-area.panel-open) intentionally stay in Home's stylesheet:
   Home pushes its tiles aside, every other page overlays. Class names keep the historical
   `home-` prefix to avoid churning markup and JS that reference them. */

/* ── Edge tab trigger (attached to right side) ── */
.home-panel-tab {
    position: fixed;
    right: 0;
    top: calc(var(--panel-top, 56px) + (100vh - var(--panel-top, 56px)) / 2);
    transform: translateY(-50%);
    z-index: 1025;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 5px 10px 8px;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    transition: right 0.3s ease, background 0.15s ease;
    writing-mode: vertical-lr;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.home-panel-tab:hover {
    background: #0b5ed7;
}
.home-panel-tab .tab-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.55rem;
    line-height: 1;
    gap: 0;
}
.home-panel-tab .tab-arrows i {
    display: block;
}
.home-panel-tab.is-open {
    right: 360px;
}
/* Match by icon class, not element: Font Awesome runs in SVG-JS mode in these layouts and
   replaces the <i> with an <svg>, so an `i.fa-chevron-*` selector would stop matching and both
   chevrons would show at once (RC-9052). */
.home-panel-tab.is-open .tab-arrows .fa-chevron-left {
    display: none;
}
.home-panel-tab:not(.is-open) .tab-arrows .fa-chevron-right {
    display: none;
}

/* ── The panel itself ── */
.home-history-panel {
    position: fixed;
    top: var(--panel-top, 56px);
    right: -360px;
    bottom: 0;
    width: 360px;
    z-index: 1025;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}
.home-history-panel.is-open {
    right: 0;
}
.home-history-panel-header {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
}
.home-history-panel-header h5 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
}
.home-history-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.home-history-close {
    background: none;
    border: none;
    padding: 3px 6px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
}
.home-history-close:hover {
    color: #334155;
}

/* ── Panel body (scrollable) ── */
.home-history-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 1rem 1rem;
}
.home-history-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}
.home-history-section-label:not(:first-child) {
    margin-top: 1rem;
}
.home-history-list {
    display: grid;
    gap: 0.5rem;
}
.home-history-item {
    display: block;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.home-history-item:hover {
    transform: translateY(-1px);
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.home-history-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    flex-shrink: 0;
    font-size: 0.85rem;
}
.home-history-context {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.1rem 0.45rem;
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 0.3rem;
    line-height: 1.4;
}
/* On small screens the panel is capped to the viewport width, and the tab tracks that width when
   open so it cannot be pushed off-screen on a narrow viewport (Copilot review, RC-9052). */
@media (max-width: 767px) {
    .home-history-panel {
        width: min(360px, 100vw);
    }
    .home-panel-tab.is-open {
        right: min(360px, 100vw);
    }
}
