/* =============================================================================
   CD ASSET MANAGEMENT — IN-APP GUIDED TOUR STYLES (Shepherd.js v11)

   Themed to match the Century Display brand palette:
     - Primary  #244095   Secondary #4d5fa3   Light #63E5E8
     - Soft shadows, rounded 12px corners
     - Iconify-friendly typography
   ============================================================================= */

/* Shepherd modal overlay (dimmed background). */
.shepherd-modal-overlay-container {
    background: rgba(15, 23, 42, 0.55) !important;
    transition: opacity 0.3s ease !important;
}

/* The popover element itself. */
.shepherd-element {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(36, 64, 149, 0.12) !important;
    max-width: 420px !important;
    width: 100% !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    overflow: hidden;
    z-index: 10050 !important;
}

/* Highlighted target element. */
.shepherd-target.shepherd-enabled {
    box-shadow: 0 0 0 4px rgba(36, 64, 149, 0.45), 0 0 0 9999px rgba(15, 23, 42, 0.55) !important;
    border-radius: 6px !important;
    transition: box-shadow 0.3s ease !important;
    position: relative;
    z-index: 10049 !important;
}

/* Header — gradient brand strip. */
.shepherd-header {
    background: linear-gradient(135deg, #244095 0%, #4d5fa3 100%) !important;
    padding: 16px 20px !important;
    border: none !important;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Shepherd default uses display:flex on .shepherd-title, which splits the title
   text and our injected <span class="shepherd-progress"> into separate flex items.
   Whitespace between them then collapses — looks like "…ManagementStep 1 of 7". */
.shepherd-title {
    display: block !important;
    color: #ffffff !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    margin: 0 !important;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

/* Step counter is appended inside the h3 (tour-manager.js); keep it visually separated. */
.shepherd-title .shepherd-progress {
    display: inline-block;
    margin-left: 0.45rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    opacity: 0.92;
    white-space: nowrap;
    vertical-align: middle;
}

.shepherd-cancel-icon {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin-left: 12px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    transition: color 0.2s ease;
}
.shepherd-cancel-icon:hover {
    color: #ffffff !important;
}

/* Body text. */
.shepherd-text {
    padding: 20px 22px 8px !important;
    color: #2c3e50 !important;
    font-size: 0.92rem !important;
    line-height: 1.65 !important;
}
.shepherd-text p {
    margin: 0 0 10px !important;
}
.shepherd-text p:last-child {
    margin-bottom: 0 !important;
}
.shepherd-text strong {
    color: #1a3070;
    font-weight: 600;
}
.shepherd-text code {
    background: #e8ecf6;
    color: #1a3070;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Courier New', Courier, monospace;
}
.shepherd-text ul, .shepherd-text ol {
    padding-left: 20px;
    margin: 6px 0 10px;
}
.shepherd-text li {
    margin-bottom: 4px;
}

/* Footer with step nav buttons. */
.shepherd-footer {
    padding: 12px 18px 18px !important;
    border-top: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    background: #fbfbfd;
    border-radius: 0 0 12px 12px;
}

/* Step counter (left side of footer). */
.shepherd-footer .shepherd-progress {
    margin-right: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Buttons. */
.shepherd-button {
    border: none !important;
    border-radius: 8px !important;
    padding: 0.55rem 1.15rem !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
}

/* Primary (Next / Done). */
.shepherd-button:not(.shepherd-button-secondary) {
    background: linear-gradient(135deg, #244095 0%, #1a3070 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(36, 64, 149, 0.32) !important;
}
.shepherd-button:not(.shepherd-button-secondary):hover {
    background: linear-gradient(135deg, #1a3070 0%, #122454 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(36, 64, 149, 0.45) !important;
}

/* Secondary (Back / Skip). */
.shepherd-button-secondary {
    background: #f1f5f9 !important;
    color: #475569 !important;
}
.shepherd-button-secondary:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Tour-mode toggle button states (lives in navbar). */
.tour-mode-toggle {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.tour-mode-toggle:hover {
    transform: scale(1.06);
}
.tour-mode-toggle .tour-mode-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.30);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}
.tour-mode-toggle.is-on .tour-mode-icon-wrap {
    background: linear-gradient(135deg, #244095 0%, #4d5fa3 100%);
    box-shadow: 0 2px 12px rgba(36, 64, 149, 0.45);
}
.tour-mode-toggle .tour-mode-status-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 2px solid #ffffff;
    transition: background 0.25s ease;
}
.tour-mode-toggle.is-on .tour-mode-status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* Floating "?" launcher in bottom-right when no tour is active.
   Kept opt-in via .show class set by tour-manager.js. */
/* Tour launcher is positioned ABOVE the AI Fab (#aiFab) so the two buttons
   never overlap. The AI Fab sits at bottom:28px with height:56px, so we
   need ≥ 96px of bottom clearance. We apply this unconditionally — on pages
   without an AI Fab the launcher just sits a little higher in the corner,
   which is visually fine. */
.cd-tour-launcher {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #244095 0%, #4d5fa3 100%);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 6px 20px rgba(36, 64, 149, 0.4);
    cursor: pointer;
    z-index: 9991; /* one above the AI Fab (9990) so its tooltip is clickable */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cd-tour-launcher.show {
    display: inline-flex;
}
.cd-tour-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(36, 64, 149, 0.55);
}
.cd-tour-launcher .iconify {
    font-size: 1.6rem !important;
}

/* Tooltip-style label that appears next to the launcher on hover. */
.cd-tour-launcher::before {
    content: 'Take a tour of this page';
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.cd-tour-launcher:hover::before {
    opacity: 1;
}

/* Mobile: smaller popovers. */
@media (max-width: 575.98px) {
    .shepherd-element {
        max-width: calc(100vw - 24px) !important;
    }
    .shepherd-text {
        padding: 16px 18px 6px !important;
        font-size: 0.88rem !important;
    }
    .shepherd-footer {
        padding: 10px 14px 14px !important;
        flex-wrap: wrap;
    }
    .cd-tour-launcher {
        bottom: 84px;
        right: 16px;
        width: 46px;
        height: 46px;
    }
}
