/* ═══════════════════════════════════════════════════════════════
   Tutorial Tour — Driver.js overrides
   Matches MokhbirPro design: Forest Green + Gold on warm white
   ═══════════════════════════════════════════════════════════════ */

/* ── Popover card ─────────────────────────────────────────────── */
.driver-popover {
    font-family: var(--font-ar), var(--font-en), sans-serif;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 340px;
    padding: 0;
    direction: rtl;
    text-align: right;
}

/* ── Arrow ─────────────────────────────────────────────────────── */
.driver-popover-arrow {
    border: 5px solid transparent;
}
.driver-popover-arrow-side-top    { border-bottom-color: var(--bg-card); }
.driver-popover-arrow-side-bottom { border-top-color: var(--bg-card); }
.driver-popover-arrow-side-left   { border-right-color: var(--bg-card); }
.driver-popover-arrow-side-right  { border-left-color: var(--bg-card); }

/* ── Title ─────────────────────────────────────────────────────── */
.driver-popover-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand);
    padding: 1rem 1rem 0.25rem;
    line-height: 1.5;
    direction: rtl;
}

/* ── Description ───────────────────────────────────────────────── */
.driver-popover-description {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.25rem 1rem 0.75rem;
    line-height: 1.7;
    direction: rtl;
}

.driver-popover-description .tutorial-en {
    display: block;
    direction: ltr;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.35rem;
    font-family: var(--font-en), sans-serif;
}

/* ── Progress (Step X of Y) ────────────────────────────────────── */
.driver-popover-progress-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0 1rem 0.5rem;
    direction: ltr;
    text-align: center;
}

/* ── Footer (buttons row) ──────────────────────────────────────── */
.driver-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid var(--border);
    gap: 0.5rem;
    direction: rtl;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.driver-popover-footer button {
    font-family: var(--font-ar), var(--font-en), sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

/* Next / Done button — accent gold */
.driver-popover-next-btn {
    background: var(--accent);
    color: #fff;
}
.driver-popover-next-btn:hover {
    background: var(--accent-hover);
    color: var(--text-primary);
}

/* Previous button — subtle */
.driver-popover-prev-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.driver-popover-prev-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Close button — top-left (RTL) */
.driver-popover-close-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: auto;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    border-radius: var(--radius-xs);
    transition: color var(--transition);
}
.driver-popover-close-btn:hover {
    color: var(--text-primary);
}

/* ── Overlay — dimmed translucent, not opaque black ────────────── */
.driver-overlay {
    /* overlay color + opacity set via Driver.js config */
}

/* ── Highlighted element — elevated above overlay via JS ────────── */
.driver-active-element {
    border-radius: var(--radius-sm);
    box-shadow:
        0 0 0 3px var(--accent),
        0 0 0 7px rgba(255, 255, 255, 0.35),
        0 0 30px 8px rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .driver-active-element {
    box-shadow:
        0 0 0 3px var(--accent),
        0 0 0 7px rgba(212, 154, 54, 0.3),
        0 0 30px 8px rgba(212, 154, 54, 0.15) !important;
}

/* ── Navbar tour button ────────────────────────────────────────── */
.tutorial-replay-btn {
    background: transparent;
    border: 1.5px solid var(--dark-border);
    color: var(--dark-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.tutorial-replay-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* ── Mobile adjustments ────────────────────────────────────────── */
@media (max-width: 768px) {
    .driver-popover {
        max-width: calc(100vw - 2rem);
        margin-inline: 1rem;        position: fixed !important;
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
        top: auto !important;
        width: calc(100% - 2rem) !important;
    }
    /* Hide arrow on mobile since popover is always at the bottom */
    .driver-popover-arrow {
        display: none !important;    }
}
