/* Guidance tooltip + tour styling — overrides Shepherd.js defaults to match
   the ClubRight admin UI. Loads after shepherd.css so these rules win.
   Uses var(--club-colour) for the primary action so each club's brand shows. */

.shepherd-element {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 380px;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    border: none;
    background: #ffffff;
    z-index: 9999;
}

.shepherd-content {
    border-radius: 14px;
    overflow: hidden;
}

.shepherd-header {
    background: transparent;
    padding: 20px 22px 4px 22px;
    border-bottom: none;
    align-items: flex-start;
}

.shepherd-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin: 0;
}

.shepherd-cancel-icon {
    color: #94a3b8;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.15s ease, transform 0.15s ease;
    padding: 4px;
    margin-left: 8px;
}

.shepherd-cancel-icon:hover {
    color: #1f2937;
    transform: scale(1.1);
}

.shepherd-text {
    padding: 4px 22px 18px 22px;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.55;
}

.shepherd-text p {
    margin: 0 0 8px 0;
}

.shepherd-text p:last-child {
    margin-bottom: 0;
}

.shepherd-footer {
    padding: 12px 18px 16px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 0;
}

.shepherd-button {
    background: var(--club-colour, #6c5ce7);
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.05s ease;
    font-family: inherit;
}

.shepherd-button:hover {
    filter: brightness(1.08);
}

.shepherd-button:active {
    transform: translateY(1px);
}

.shepherd-button.shepherd-button-secondary {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.shepherd-button.shepherd-button-secondary:hover {
    background: #f8fafc;
    filter: none;
}

/* The little arrow pointing at the target element. Shepherd renders it as a
   rotated square (::before) — recolour to match the card background so it
   looks like part of the card, not a separate shape. */
.shepherd-arrow:before {
    background: #ffffff !important;
}

/* Modal overlay — Shepherd dims the rest of the page when useModalOverlay is on.
   Softer than the default so it doesn't look like a blocking modal. */
.shepherd-modal-overlay-container {
    background: rgba(15, 23, 42, 0.35);
}

/* Highlighted target element — Shepherd cuts a "hole" in the overlay around
   the target. Add a soft ring so it reads as "this is the thing". */
.shepherd-modal-overlay-container svg path {
    fill-rule: evenodd;
}

.shepherd-target-highlighted {
    box-shadow: 0 0 0 4px rgba(var(--club-colour-rgb, 108, 92, 231), 0.35),
                0 0 0 6px var(--club-colour, #6c5ce7);
    border-radius: 6px;
    transition: box-shadow 0.2s ease;
}

/* ============================================================
   BANNERS — sticky strip at top or bottom of the viewport
   ============================================================ */

.cr-guidance-banners {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9990;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
}

.cr-guidance-banners--top {
    top: 0;
}

.cr-guidance-banners--bottom {
    bottom: 0;
    flex-direction: column-reverse;
}

.cr-banner {
    pointer-events: auto;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.08);
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
    transform: translateY(-20px);
    opacity: 0;
    animation: cr-banner-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    backdrop-filter: blur(6px);
}

.cr-guidance-banners--bottom .cr-banner {
    transform: translateY(20px);
}

.cr-banner--leaving {
    animation: cr-banner-out 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes cr-banner-in {
    to { transform: translateY(0); opacity: 1; }
}

@keyframes cr-banner-out {
    to { transform: translateY(-20px); opacity: 0; }
}

.cr-guidance-banners--bottom .cr-banner--leaving {
    animation-name: cr-banner-out-bottom;
}

@keyframes cr-banner-out-bottom {
    to { transform: translateY(20px); opacity: 0; }
}

/* Variants: info (club brand), promo (gradient), success (green), warning (amber).
   Each has a background and a slightly transparent text for hierarchy. */

.cr-banner--info {
    background: linear-gradient(135deg, var(--club-colour, #6c5ce7) 0%, color-mix(in srgb, var(--club-colour, #6c5ce7) 75%, #000) 100%);
}

.cr-banner--promo {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    background-size: 200% 100%;
    animation: cr-banner-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
               cr-promo-shimmer 8s ease-in-out infinite;
}

@keyframes cr-promo-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.cr-banner--success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.cr-banner--warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.cr-banner__content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cr-banner__title {
    font-weight: 700;
    margin-right: 4px;
}

.cr-banner__body {
    opacity: 0.92;
}

.cr-banner__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.05s ease;
    white-space: nowrap;
}

.cr-banner__cta:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
    text-decoration: none;
}

.cr-banner__cta:active {
    transform: translateY(1px);
}

.cr-banner__cta i {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.cr-banner__cta:hover i {
    transform: translateX(2px);
}

.cr-banner__dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.cr-banner__dismiss:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* ============================================================
   HOTSPOT — pulsing dot pinned to an element
   ============================================================ */

.cr-hotspot {
    position: absolute;
    width: 16px;
    height: 16px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 9985;
}

.cr-hotspot__dot {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--club-colour, #6c5ce7);
    box-shadow: 0 0 0 2px #ffffff, 0 2px 6px rgba(15, 23, 42, 0.3);
    z-index: 2;
    transition: transform 0.15s ease;
}

.cr-hotspot:hover .cr-hotspot__dot {
    transform: scale(1.15);
}

.cr-hotspot__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--club-colour, #6c5ce7);
    opacity: 0.4;
    animation: cr-hotspot-pulse 1.8s ease-out infinite;
    z-index: 1;
}

@keyframes cr-hotspot-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ============================================================
   TOAST — slide-in corner notification
   ============================================================ */

.cr-guidance-toasts {
    position: fixed;
    z-index: 9988;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    max-width: 380px;
}

.cr-guidance-toasts--top-right { top: 0; right: 0; }
.cr-guidance-toasts--top-left { top: 0; left: 0; }
.cr-guidance-toasts--bottom-right { bottom: 0; right: 0; flex-direction: column-reverse; }
.cr-guidance-toasts--bottom-left { bottom: 0; left: 0; flex-direction: column-reverse; }

.cr-toast {
    pointer-events: auto;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: flex-start;
    padding: 14px 14px 14px 18px;
    gap: 10px;
    overflow: hidden;
    position: relative;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
    border-left: 4px solid var(--club-colour, #6c5ce7);
}

.cr-guidance-toasts--top-left .cr-toast,
.cr-guidance-toasts--bottom-left .cr-toast {
    transform: translateX(-120%);
}

.cr-toast--shown {
    transform: translateX(0);
    opacity: 1;
}

.cr-toast--leaving {
    transform: translateX(120%);
    opacity: 0;
}

.cr-guidance-toasts--top-left .cr-toast--leaving,
.cr-guidance-toasts--bottom-left .cr-toast--leaving {
    transform: translateX(-120%);
}

.cr-toast--info { border-left-color: var(--club-colour, #6c5ce7); }
.cr-toast--promo { border-left-color: #ec4899; }
.cr-toast--success { border-left-color: #10b981; }
.cr-toast--warning { border-left-color: #f59e0b; }

.cr-toast__content {
    flex: 1;
    min-width: 0;
}

.cr-toast__title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.3;
    margin-bottom: 3px;
}

.cr-toast__body {
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.5;
}

.cr-toast__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    color: var(--club-colour, #6c5ce7);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: gap 0.15s ease;
}

.cr-toast__cta:hover {
    color: var(--club-colour, #6c5ce7);
    text-decoration: none;
    gap: 8px;
}

.cr-toast__cta i {
    font-size: 0.75rem;
}

.cr-toast__dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.cr-toast__dismiss:hover {
    color: #1f2937;
    transform: scale(1.1);
}

/* ============================================================
   ADMIN EDITOR — Settings/Guidance modal
   ============================================================ */

.guidance-editor__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 16px;
}

.guidance-editor__meta-label {
    font-weight: 600;
    color: #0f172a;
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.guidance-editor__section {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    background: #ffffff;
}

.guidance-editor__section-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guidance-editor__section-body {
    padding: 14px;
}

.guidance-editor__chiplist {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.guidance-editor__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 10px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    font-size: 0.8rem;
    color: #1e1b4b;
}

.guidance-editor__chip-remove {
    background: transparent;
    border: none;
    color: #6366f1;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.guidance-editor__condition {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.4fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fbfcfd;
}

.guidance-editor__step {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #ffffff;
}

.guidance-editor__step-header {
    padding: 8px 12px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guidance-editor__step-body {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.guidance-editor__step-body--full {
    grid-column: 1 / -1;
}

.guidance-editor__hint {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

.guidance-editor__warn {
    font-size: 0.78rem;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
}

.guidance-editor__inline-add {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

/* ---------------- Modal ----------------
   Centred dialog with a dimmed backdrop. Blocks the page until dismissed or
   a CTA is clicked. Used for first-beta welcomes / big launches — heavier
   than a banner, deliberately.
*/

.cr-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cr-modal-backdrop--shown {
    opacity: 1;
}

.cr-modal-backdrop--leaving {
    opacity: 0;
}

.cr-modal {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32), 0 8px 24px rgba(15, 23, 42, 0.14);
    max-width: 520px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cr-modal-backdrop--shown .cr-modal {
    transform: translateY(0) scale(1);
}

.cr-modal__dismiss {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    color: #475569;
    font-size: 1.5rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.cr-modal__dismiss:hover {
    background: #ffffff;
    color: #0f172a;
    transform: scale(1.05);
}

.cr-modal__image {
    width: 100%;
    background: linear-gradient(135deg, var(--club-colour, #0d6efd) 0%, rgba(15, 23, 42, 0.08) 100%);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 240px;
    overflow: hidden;
}

.cr-modal__image img {
    max-width: 100%;
    max-height: 200px;
    display: block;
    object-fit: contain;
}

.cr-modal__content {
    padding: 28px 32px 24px;
    overflow-y: auto;
}

.cr-modal__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
    line-height: 1.3;
}

.cr-modal__body {
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 24px;
}

.cr-modal__body:last-child {
    margin-bottom: 0;
}

.cr-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.cr-modal__btn {
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.cr-modal__btn--primary {
    background: var(--club-colour, #0d6efd);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.25);
}

.cr-modal__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.32);
    filter: brightness(1.05);
}

.cr-modal__btn--secondary {
    background: #f1f5f9;
    color: #334155;
}

.cr-modal__btn--secondary:hover {
    background: #e2e8f0;
}

/* Variant colour washes — applied to the image background + primary button
   accent so a 'success' modal feels green, etc. */

.cr-modal--success .cr-modal__image {
    background: linear-gradient(135deg, #16a34a 0%, rgba(15, 23, 42, 0.08) 100%);
}

.cr-modal--success .cr-modal__btn--primary {
    background: #16a34a;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.28);
}

.cr-modal--warning .cr-modal__image {
    background: linear-gradient(135deg, #f59e0b 0%, rgba(15, 23, 42, 0.08) 100%);
}

.cr-modal--warning .cr-modal__btn--primary {
    background: #f59e0b;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.28);
}

.cr-modal--promo .cr-modal__image {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 35%, #3b82f6 70%, #06b6d4 100%);
    background-size: 200% 200%;
    animation: cr-modal-promo-shimmer 8s ease infinite;
}

.cr-modal--promo .cr-modal__btn--primary {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.32);
}

@keyframes cr-modal-promo-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 480px) {
    .cr-modal {
        border-radius: 14px;
    }

    .cr-modal__content {
        padding: 22px 22px 20px;
    }

    .cr-modal__title {
        font-size: 1.2rem;
    }

    .cr-modal__actions {
        flex-direction: column-reverse;
    }

    .cr-modal__btn {
        width: 100%;
    }
}
