/* ==============================================
   Pro Sports Link — Intro.js Walkthrough Theme
   Glassmorphism / Aero-glass styling to match
   the application's existing design language.
   ============================================== */

/* Overlay — dark, slightly blurred */
.introjs-overlay {
    background: rgba(0, 10, 25, 0.75) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Helper layer (spotlight highlight) */
.introjs-helperLayer {
    border: 2px solid rgba(7, 151, 242, 0.6) !important;
    border-radius: 12px !important;
    box-shadow:
        0 0 0 4000px rgba(0, 10, 25, 0.75),
        0 0 25px rgba(7, 151, 242, 0.4),
        0 0 60px rgba(7, 151, 242, 0.15) !important;
    transition: all 0.35s ease !important;
}

/* Tooltip container — Aero glass */
.introjs-tooltip {
    background: linear-gradient(
        to bottom,
        rgba(45, 75, 105, 0.92) 0%,
        rgba(35, 60, 90, 0.90) 3%,
        rgba(30, 50, 75, 0.88) 50%,
        rgba(26, 42, 58, 0.92) 100%
    ) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(100, 140, 180, 0.5) !important;
    border-top: 2px solid rgba(150, 190, 230, 0.7) !important;
    border-radius: 14px !important;
    box-shadow:
        inset 0 1px 1px 0 rgba(150, 190, 230, 0.5),
        inset 0 -1px 1px 0 rgba(0, 20, 40, 0.3),
        0 0 40px rgba(26, 42, 58, 0.6),
        0 0 80px rgba(30, 60, 100, 0.3),
        0 15px 50px rgba(0, 0, 0, 0.5) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    max-width: 380px !important;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
}

/* Glass reflection overlay */
.introjs-tooltip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.08) 30%,
        rgba(255, 255, 255, 0.02) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    border-radius: 12px 12px 0 0;
    pointer-events: none;
    z-index: 0;
}

/* Tooltip header */
.introjs-tooltip-header {
    padding: 16px 20px 8px 20px !important;
    position: relative;
    z-index: 1;
}

.introjs-tooltip-title {
    color: rgba(255, 255, 255, 0.98) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Skip (X) button */
.introjs-skipbutton {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 1.2rem !important;
    font-weight: 400 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: color 0.2s ease;
    position: relative;
    z-index: 2;
}

.introjs-skipbutton:hover,
.introjs-skipbutton:focus {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Tooltip body text */
.introjs-tooltiptext {
    padding: 8px 20px 16px 20px !important;
    color: rgba(255, 255, 255, 0.90) !important;
    font-size: 0.92rem !important;
    line-height: 1.6 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}

/* Step icon indicator */
.introjs-tooltiptext .wt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    margin-right: 8px;
    font-size: 0.85rem;
    vertical-align: middle;
}

.wt-icon-power {
    background: rgba(50, 215, 75, 0.2);
    color: #32d74b;
}

.wt-icon-schedule {
    background: rgba(7, 151, 242, 0.2);
    color: #64d2ff;
}

.wt-icon-history {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

.wt-icon-users {
    background: rgba(100, 210, 255, 0.2);
    color: #64d2ff;
}

.wt-icon-settings {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.wt-icon-star {
    background: rgba(255, 214, 10, 0.2);
    color: #ffd60a;
}

.wt-icon-lock {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

/* Button row */
.introjs-tooltipbuttons {
    border-top: 1px solid rgba(100, 140, 180, 0.35) !important;
    background: rgba(0, 0, 0, 0.12) !important;
    padding: 10px 16px !important;
    position: relative;
    z-index: 1;
}

/* Bullet indicators */
.introjs-bullets {
    padding: 10px 0 0 0 !important;
    position: relative;
    z-index: 1;
}

.introjs-bullets ul li a {
    background: rgba(255, 255, 255, 0.25) !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    transition: all 0.25s ease !important;
}

.introjs-bullets ul li a.active,
.introjs-bullets ul li a:hover {
    background: #0797F2 !important;
    width: 20px !important;
    border-radius: 4px !important;
    box-shadow: 0 0 8px rgba(7, 151, 242, 0.5) !important;
}

/* Progress bar */
.introjs-progress {
    background: rgba(255, 255, 255, 0.08) !important;
    height: 3px !important;
    border-radius: 2px !important;
    margin: 0 !important;
    position: relative;
    z-index: 1;
}

.introjs-progressbar {
    background: linear-gradient(90deg, #0797F2, #40b3ff) !important;
    border-radius: 2px !important;
    box-shadow: 0 0 8px rgba(7, 151, 242, 0.4) !important;
    transition: width 0.35s ease !important;
}

/* Next button — primary blue Aero style */
.introjs-button.introjs-nextbutton,
.introjs-button.introjs-donebutton {
    background: linear-gradient(
        to bottom,
        rgba(100, 185, 250, 0.95) 0%,
        rgba(7, 151, 242, 0.95) 50%,
        rgba(0, 130, 220, 0.95) 100%
    ) !important;
    border: 1px solid rgba(150, 200, 255, 0.5) !important;
    border-top: 1px solid rgba(200, 230, 255, 0.7) !important;
    border-radius: 8px !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 6px 18px !important;
    text-shadow: 0 -1px 0 rgba(0, 50, 100, 0.35) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        0 2px 10px rgba(7, 151, 242, 0.4) !important;
    transition: all 0.2s ease !important;
}

.introjs-button.introjs-nextbutton:hover,
.introjs-button.introjs-nextbutton:focus,
.introjs-button.introjs-donebutton:hover,
.introjs-button.introjs-donebutton:focus {
    background: linear-gradient(
        to bottom,
        rgba(130, 200, 255, 1) 0%,
        rgba(40, 170, 255, 1) 50%,
        rgba(7, 151, 242, 1) 100%
    ) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 4px 18px rgba(7, 151, 242, 0.55) !important;
    transform: translateY(-1px);
}

/* Back button — subtle glass */
.introjs-button.introjs-prevbutton {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    padding: 6px 18px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.introjs-button.introjs-prevbutton:hover,
.introjs-button.introjs-prevbutton:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Disabled button */
.introjs-button.introjs-disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
}

/* Arrow — Aero-glass colored */
.introjs-arrow {
    border-color: transparent !important;
}

.introjs-arrow.top {
    border-bottom-color: rgba(150, 190, 230, 0.7) !important;
}

.introjs-arrow.bottom {
    border-top-color: rgba(26, 42, 58, 0.92) !important;
}

.introjs-arrow.left {
    border-right-color: rgba(100, 140, 180, 0.5) !important;
}

.introjs-arrow.right {
    border-left-color: rgba(100, 140, 180, 0.5) !important;
}

/* Show/hide transitions */
.introjs-showElement {
    z-index: 9999999 !important;
}

/* Replay Tutorial button in the nav (desktop only) */
#replay-tutorial-btn {
    cursor: pointer;
    transition: color 0.2s ease;
}

#replay-tutorial-btn:hover {
    color: #0797F2 !important;
}

/* Hide Tutorial button on mobile/tablet — walkthrough is desktop-only */
@media (max-width: 1024px) {
    #replay-tutorial-btn {
        display: none !important;
    }
}

/* Welcome step — larger, centered tooltip */
.introjs-tooltip.introjs-floating {
    max-width: 440px !important;
}

/* Entrance animation for the tooltip */
@keyframes wtFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.introjs-tooltip {
    animation: wtFadeSlideIn 0.3s ease forwards;
}

/* ================================================
   MOBILE RESPONSIVE OVERRIDES
   ================================================ */

@media (max-width: 768px) {
    /* Constrain tooltip to viewport */
    .introjs-tooltip {
        max-width: 88vw !important;
        min-width: 0 !important;
        border-radius: 12px !important;
    }

    .introjs-tooltip.introjs-floating {
        max-width: 90vw !important;
        margin: 0 auto !important;
    }

    /* Reduce header padding */
    .introjs-tooltip-header {
        padding: 12px 16px 6px 16px !important;
    }

    .introjs-tooltip-title {
        font-size: 1rem !important;
    }

    /* Reduce body padding and text */
    .introjs-tooltiptext {
        padding: 6px 16px 12px 16px !important;
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    .introjs-tooltiptext ul {
        padding-left: 16px !important;
        margin-bottom: 4px !important;
    }

    .introjs-tooltiptext li {
        margin-bottom: 2px !important;
    }

    /* Compact buttons */
    .introjs-tooltipbuttons {
        padding: 8px 12px !important;
    }

    .introjs-button.introjs-nextbutton,
    .introjs-button.introjs-donebutton,
    .introjs-button.introjs-prevbutton {
        padding: 6px 14px !important;
        font-size: 0.82rem !important;
    }

    /* Spotlight — tighter radius */
    .introjs-helperLayer {
        border-radius: 8px !important;
    }

    /* Step icons — slightly smaller */
    .introjs-tooltiptext .wt-icon {
        width: 24px;
        height: 24px;
        font-size: 0.78rem;
        margin-right: 6px;
    }

    /* Bullets — slightly smaller */
    .introjs-bullets ul li a {
        width: 6px !important;
        height: 6px !important;
    }

    .introjs-bullets ul li a.active,
    .introjs-bullets ul li a:hover {
        width: 16px !important;
    }
}

@media (max-width: 480px) {
    /* Even tighter on small phones */
    .introjs-tooltip {
        max-width: 94vw !important;
        border-radius: 10px !important;
    }

    .introjs-tooltip.introjs-floating {
        max-width: 94vw !important;
    }

    .introjs-tooltip-header {
        padding: 10px 12px 4px 12px !important;
    }

    .introjs-tooltip-title {
        font-size: 0.92rem !important;
    }

    .introjs-tooltiptext {
        padding: 4px 12px 10px 12px !important;
        font-size: 0.82rem !important;
    }

    .introjs-tooltipbuttons {
        padding: 6px 10px !important;
        flex-wrap: wrap;
        gap: 4px;
    }

    .introjs-button.introjs-nextbutton,
    .introjs-button.introjs-donebutton,
    .introjs-button.introjs-prevbutton {
        padding: 5px 12px !important;
        font-size: 0.8rem !important;
    }

    /* Hide bullets on very small screens to save space */
    .introjs-bullets {
        display: none !important;
    }
}

/* Touch-friendly: increase tap target size on mobile */
@media (hover: none) and (pointer: coarse) {
    .introjs-button.introjs-nextbutton,
    .introjs-button.introjs-donebutton,
    .introjs-button.introjs-prevbutton {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .introjs-skipbutton {
        min-width: 44px !important;
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}
