/**
 * LAWT Guided Tour — Custom Styles (Enhanced)
 * Overrides for Driver.js popover to match Taxheaven/LAWT design.
 * Includes: tour images, gallery, interactive tooltip support.
 *
 * Dependencies: driver.css (loaded from CDN before this file)
 * Remove this file + lawt-tour.js to disable the tour entirely.
 */


/* ── Tour Button (in title area) ──────────────────────────── */

/* Title row: flex layout for h1 + tour button side by side */
.lawt-page .lawt-law-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.lawt-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
    margin-left: auto;
    background-size: 200% 200%;
    background-image: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 35%, #ec4899 70%, #4f6ef7 100%);
    box-shadow:
        0 4px 14px rgba(124, 58, 237, 0.45),
        0 0 0 0 rgba(236, 72, 153, 0.55);
    animation: lawtTourBtnGradient 4s ease infinite,
               lawtTourBtnGlow 2.2s ease-in-out infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Shimmer sweep effect */
.lawt-tour-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg,
                transparent 0%,
                rgba(255, 255, 255, 0.45) 50%,
                transparent 100%);
    transform: skewX(-20deg);
    animation: lawtTourBtnShimmer 3.2s ease-in-out infinite;
    pointer-events: none;
}

.lawt-tour-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow:
        0 10px 28px rgba(124, 58, 237, 0.6),
        0 0 0 4px rgba(236, 72, 153, 0.18);
}

.lawt-tour-btn:active {
    transform: translateY(0) scale(1);
}

.lawt-tour-btn .fa {
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
    position: relative;
}

.lawt-tour-btn .lawt-tour-btn-text {
    position: relative;
}

@keyframes lawtTourBtnGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

@keyframes lawtTourBtnGlow {
    0%, 100% {
        box-shadow:
            0 4px 14px rgba(124, 58, 237, 0.45),
            0 0 0 0 rgba(236, 72, 153, 0.55);
    }
    50% {
        box-shadow:
            0 4px 14px rgba(124, 58, 237, 0.45),
            0 0 0 10px rgba(236, 72, 153, 0);
    }
}

@keyframes lawtTourBtnShimmer {
    0%      { left: -75%; }
    60%, 100% { left: 125%; }
}

/* First-visit extra pulse — boosts the existing glow briefly */
.lawt-tour-btn.lawt-tour-pulse {
    animation: lawtTourBtnGradient 4s ease infinite,
               lawtTourBtnGlowStrong 1.6s ease-in-out 4;
}

@keyframes lawtTourBtnGlowStrong {
    0%, 100% {
        box-shadow:
            0 4px 14px rgba(124, 58, 237, 0.45),
            0 0 0 0 rgba(236, 72, 153, 0.7);
    }
    50% {
        box-shadow:
            0 6px 20px rgba(124, 58, 237, 0.7),
            0 0 0 16px rgba(236, 72, 153, 0);
    }
}


/* ── Driver.js Popover Overrides ──────────────────────────── */

.driver-popover {
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid #e2e8f0;
    max-width: 420px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
}

.driver-popover-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    padding: 16px 16px 0;
    line-height: 1.4;
}

.driver-popover-description {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    padding: 8px 16px 0;
}

/* Arrow color */
.driver-popover-arrow-side-top { border-top-color: #fff; }
.driver-popover-arrow-side-bottom { border-bottom-color: #fff; }
.driver-popover-arrow-side-left { border-left-color: #fff; }
.driver-popover-arrow-side-right { border-right-color: #fff; }

/* Progress text */
.driver-popover-progress-text {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

/* Footer */
.driver-popover-footer {
    padding: 10px 16px 14px;
    border-top: 1px solid #f1f5f9;
    margin-top: 12px;
}

/* Buttons */
.driver-popover-footer button {
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.driver-popover-next-btn {
    background: #2563eb;
    color: #fff;
}

.driver-popover-next-btn:hover {
    background: #1d4ed8;
}

.driver-popover-prev-btn {
    background: transparent;
    color: #64748b;
}

.driver-popover-prev-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Close button */
.driver-popover-close-btn {
    color: #94a3b8;
    font-size: 18px;
}

.driver-popover-close-btn:hover {
    color: #475569;
}


/* ── Subscriber Badge ─────────────────────────────────────── */

.lawt-tour-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    line-height: 1;
}

.lawt-tour-sub-badge .fa {
    font-size: 10px;
    color: #f59e0b;
}


/* ── Tour Images in Popover ───────────────────────────────── */

.lawt-tour-img-wrap {
    margin-top: 12px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lawt-tour-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
}


/* ── Tour Image Gallery (2-up) ────────────────────────────── */

.lawt-tour-gallery {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.lawt-tour-gallery-item {
    flex: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.lawt-tour-gallery-item .lawt-tour-img {
    border-radius: 5px 5px 0 0;
}

.lawt-tour-gallery-caption {
    display: block;
    padding: 5px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    line-height: 1.3;
}


/* ── Interactive: Force show bar tooltip during tour ──────── */

.lawt-bar-trigger-wrap.lawt-tour-hover .lawt-bar-tooltip {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
}


/* ── Overlay ──────────────────────────────────────────────── */

.driver-overlay {
    background: rgba(15, 23, 42, 0.55);
}


/* ── Mobile adjustments ───────────────────────────────────── */

@media (max-width: 768px) {
    .lawt-tour-btn {
        height: 34px;
        padding: 0 10px;
        font-size: 12px;
        gap: 0;
    }

    .lawt-tour-btn .lawt-tour-btn-text {
        display: none;
    }

    .driver-popover {
        max-width: 320px;
    }

    .driver-popover-title {
        font-size: 15px;
        padding: 12px 12px 0;
    }

    .driver-popover-description {
        font-size: 13px;
        padding: 6px 12px 0;
    }

    .driver-popover-footer {
        padding: 8px 12px 10px;
    }

    /* Stack gallery vertically on mobile */
    .lawt-tour-gallery {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .driver-popover {
        max-width: 280px;
    }
}
