/*
 |------------------------------------------------------------------
 | guided-tour.css — topbar launcher, welcome modal, spotlight tour
 |------------------------------------------------------------------
 |
 | Loaded from AdminPanelProvider's HEAD_END hook with a ?v=<filemtime>
 | cache-buster (the plain-asset convention in this codebase — no build
 | step).  Paired with:
 |   resources/views/filament/guided-tour/launcher.blade.php
 |   resources/views/filament/guided-tour/overlay.blade.php
 |   public/js/guided-tour.js
 |
 | Light + html.dark variants throughout.  Deliberately uses plain
 | hex/rgba colours only — never Filament theme-token functions — so
 | these styles survive on pages where those variables are not in scope.
 */

/* ── Topbar launcher ─────────────────────────────────────────────── */

.lh-tour-launcher {
    position: relative;
    display: flex;
    align-items: center;
    margin-inline-end: 0.5rem;
}

.lh-tour-launcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #fff;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.lh-tour-launcher-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.lh-tour-launcher-btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.lh-tour-launcher-btn svg {
    width: 1rem;
    height: 1rem;
    flex: none;
}

html.dark .lh-tour-launcher-btn {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

html.dark .lh-tour-launcher-btn:hover {
    background: #374151;
    border-color: #4b5563;
}

.lh-tour-launcher-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    inset-inline-end: 0;
    z-index: 60;
    min-width: 13rem;
    padding: 0.35rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(2, 6, 23, 0.16);
}

.lh-tour-launcher-item {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: #111827;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.3;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.lh-tour-launcher-item:hover,
.lh-tour-launcher-item:focus-visible {
    background: #eef2ff;
    color: #3730a3;
    outline: none;
}

.lh-tour-launcher-link {
    border-top: 1px solid #f3f4f6;
    margin-top: 0.25rem;
    padding-top: 0.65rem;
    color: #4f46e5;
}

html.dark .lh-tour-launcher-menu {
    background: #111827;
    border-color: #374151;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

html.dark .lh-tour-launcher-item {
    color: #e5e7eb;
}

html.dark .lh-tour-launcher-item:hover,
html.dark .lh-tour-launcher-item:focus-visible {
    background: #1f2937;
    color: #a5b4fc;
}

html.dark .lh-tour-launcher-link {
    border-top-color: #1f2937;
    color: #a5b4fc;
}

/* ── First-time welcome modal (§33) ──────────────────────────────── */

.lh-tour-welcome {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.55);
}

.lh-tour-welcome[hidden] {
    display: none;
}

.lh-tour-welcome-card {
    width: min(26rem, 100%);
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #fff;
    color: #111827;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.28);
    text-align: center;
}

.lh-tour-welcome-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.lh-tour-welcome-card p {
    margin: 0 0 1.1rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.lh-tour-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.lh-tour-welcome-actions a,
.lh-tour-welcome-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.6rem;
    background: #fff;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.lh-tour-welcome-actions a:hover,
.lh-tour-welcome-actions button:hover {
    background: #f3f4f6;
}

.lh-tour-welcome-actions .lh-tour-welcome-primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.lh-tour-welcome-actions .lh-tour-welcome-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

html.dark .lh-tour-welcome-card {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

html.dark .lh-tour-welcome-card p {
    color: #9ca3af;
}

html.dark .lh-tour-welcome-actions a,
html.dark .lh-tour-welcome-actions button {
    background: #111827;
    border-color: #4b5563;
    color: #e5e7eb;
}

html.dark .lh-tour-welcome-actions a:hover,
html.dark .lh-tour-welcome-actions button:hover {
    background: #374151;
}

html.dark .lh-tour-welcome-actions .lh-tour-welcome-primary {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

/* ── Spotlight overlay ───────────────────────────────────────────── */

.lh-tour {
    position: fixed;
    inset: 0;
    z-index: 9999;
    /* The overlay never blocks the page — the target stays clickable
       (spec §35 wants users to perform the real action). */
    pointer-events: none;
}

.lh-tour[hidden] {
    display: none;
}

.lh-tour-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-radius: 0.65rem;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.6);
    pointer-events: none;
    transition: top 160ms ease, left 160ms ease, width 160ms ease, height 160ms ease;
}

.lh-tour-spotlight[hidden] {
    display: none;
}

/* Ring drawn around the highlighted element (class added by the JS). */
.lh-tour-target {
    outline: 2px solid #818cf8;
    outline-offset: 3px;
    border-radius: 0.5rem;
}

.lh-tour-card {
    position: fixed;
    z-index: 1;
    width: min(22rem, calc(100vw - 2rem));
    padding: 1rem 1rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.3);
    pointer-events: auto;
}

.lh-tour-card:focus {
    outline: none;
}

.lh-tour-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.lh-tour-desc {
    margin: 0 0 0.55rem;
    font-size: 0.845rem;
    line-height: 1.55;
    color: #4b5563;
}

.lh-tour-note {
    margin: 0 0 0.55rem;
    padding: 0.5rem 0.65rem;
    border-inline-start: 3px solid #818cf8;
    border-radius: 0.35rem;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.8rem;
    line-height: 1.5;
}

.lh-tour-note[hidden] {
    display: none;
}

.lh-tour-count {
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #6b7280;
}

.lh-tour-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lh-tour-btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 0.55rem;
    background: #fff;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
}

.lh-tour-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.lh-tour-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.lh-tour-btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.lh-tour-btn--next {
    margin-inline-start: auto;
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

.lh-tour-btn--next:hover:not(:disabled) {
    background: #4338ca;
    border-color: #4338ca;
}

.lh-tour-btn--skip {
    border-color: transparent;
    background: transparent;
    color: #6b7280;
    order: 3;
    margin-inline-start: 0.25rem;
}

.lh-tour-btn--skip:hover:not(:disabled) {
    background: transparent;
    color: #dc2626;
    text-decoration: underline;
}

/* Fallback: target not on this page — center the card, keep it terse. */
.lh-tour-card--fallback {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
}

/* Phones: pin the card to the bottom of the screen. */
.lh-tour-card--mobile {
    top: auto;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.9rem;
    width: auto;
    transform: none;
}

html.dark .lh-tour-card {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

html.dark .lh-tour-desc {
    color: #9ca3af;
}

html.dark .lh-tour-count {
    color: #9ca3af;
}

html.dark .lh-tour-note {
    background: #111827;
    border-inline-start-color: #6366f1;
    color: #c7d2fe;
}

html.dark .lh-tour-btn {
    background: #111827;
    border-color: #4b5563;
    color: #e5e7eb;
}

html.dark .lh-tour-btn:hover:not(:disabled) {
    background: #374151;
}

html.dark .lh-tour-btn--next {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

html.dark .lh-tour-btn--next:hover:not(:disabled) {
    background: #4338ca;
}

html.dark .lh-tour-btn--skip {
    background: transparent;
    border-color: transparent;
    color: #9ca3af;
}

/* Visually hidden live region — screen-reader step announcements. */
.lh-tour-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .lh-tour-spotlight {
        transition: none;
    }
}
