﻿/* tour.css - Express tour styles */

/* ==================== TOUR AGENDA PANEL ==================== */
.tour-agenda-panel {
    position: fixed;
    top: 92px;
    right: 16px;
    width: 220px;
    background: #fff;
    border: 1px solid #e5e1da;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    z-index: 2147483000;   /* above driver.js overlay/popover so it stays interactive */
    overflow: hidden;
    font-family: 'Futura PT', 'Jost', sans-serif;
    transition: opacity 0.2s, left 0.95s cubic-bezier(0.22, 1, 0.36, 1), top 0.95s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
}
.tour-agenda-panel.dragging { transition: none; }

/* CRITICAL: driver.css does `.driver-active * { pointer-events: none }` on the
   whole page while a tour runs (re-enabling only its own popover + highlighted
   element). That made the agenda completely dead — no click, scroll, hover, or
   drag. Force pointer events back ON for the agenda and everything inside it. */
#tourAgendaPanel,
#tourAgendaPanel * {
    pointer-events: auto !important;
}

.tour-agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #1E6332;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.tour-agenda-panel.dragging { transition: none; box-shadow: 0 12px 34px rgba(0,0,0,0.28); }

.tour-agenda-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.tour-agenda-list {
    max-height: 50vh;
    overflow-y: auto;
    padding: 0 0 4px;
}

/* Grouped agenda (by tab) */
.tour-agenda-group { border-top: 1px solid #f0ede8; }
.tour-agenda-group:first-child { border-top: none; }
.tour-agenda-group-head {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    cursor: pointer; background: #F4F0E9; user-select: none; -webkit-user-select: none;
    font-size: 0.66rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.4px; color: #214A3E;
    position: sticky; top: 0; z-index: 1;
}
.tour-agenda-group-head:hover { background: #ece5d8; }
/* The tab currently being toured — make its header pop */
.tour-agenda-group.current-group > .tour-agenda-group-head {
    background: #e7f0ea; color: #1E6332;
    box-shadow: inset 3px 0 0 #1E6332;
}
.tour-agenda-group.current-group > .tour-agenda-group-head .tour-agenda-group-count { color: #1E6332; }
.tour-agenda-group-chevron { font-size: 0.6rem; color: #2F8542; transition: transform 0.15s; width: 10px; text-align: center; }
.tour-agenda-group.collapsed .tour-agenda-group-chevron { transform: rotate(-90deg); }
.tour-agenda-group-name { flex: 1; }
.tour-agenda-group-count { font-size: 0.62rem; font-weight: 700; color: #6b7280; }
.tour-agenda-group-count .fa-check { color: #2F8542; }
.tour-agenda-group.collapsed .tour-agenda-group-items { display: none; }
.tour-agenda-group-items .tour-agenda-item { padding-left: 24px; }

.tour-agenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.75rem;
    color: #475453;
}

.tour-agenda-item:hover {
    background: #F4F0E9;
}

/* SEEN (past) — muted, green check */
.tour-agenda-item.visited:not(.current) {
    color: #7c8a83;
}
.tour-agenda-item.visited .tour-agenda-num {
    background: #1E6332;
    color: #fff;
    border-color: #1E6332;
}

/* CURRENT (you are here) — bold, tinted, left accent bar, pulsing marker */
.tour-agenda-item.current {
    background: linear-gradient(90deg, rgba(30,99,50,0.16), rgba(30,99,50,0.03));
    font-weight: 800;
    color: #1E6332;
    box-shadow: inset 3px 0 0 #1E6332;
}

.tour-agenda-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    background: #F4F0E9;
    color: #475453;
    border: 1px solid #e5e1da;
}

.tour-agenda-item.current .tour-agenda-num {
    background: #1E6332;
    color: #fff;
    border-color: #1E6332;
    box-shadow: 0 0 0 3px rgba(30,99,50,0.22);
    animation: tourCurrentPulse 1.6s ease-in-out infinite;
}
@keyframes tourCurrentPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(30,99,50,0.22); }
    50%      { box-shadow: 0 0 0 6px rgba(30,99,50,0.06); }
}

.tour-agenda-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Never let the whole panel exceed the viewport; the list scrolls inside it */
.tour-agenda-panel { max-height: calc(100vh - 104px); display: flex; flex-direction: column; }
.tour-agenda-list { flex: 1 1 auto; }

/* Small laptops / narrow windows / short screens (incl. tablets & smaller Macs) */
@media (max-width: 1180px), (max-height: 760px) {
    .tour-agenda-panel { width: 200px; }
    .tour-agenda-list { max-height: 44vh; }
    .tour-agenda-item { padding: 6px 12px; font-size: 0.72rem; }
    .tour-agenda-num { width: 20px; height: 20px; }
}
@media (max-height: 640px) {
    .tour-agenda-panel { top: 70px; max-height: calc(100vh - 84px); }
    .tour-agenda-list { max-height: 40vh; }
}

/* ==================== EXPRESS TOUR STYLES ==================== */

/* Express Tour Button in Hub360 Menu */
.express-tour-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

.express-tour-item:hover {
    background: linear-gradient(135deg, #F4F0E9 0%, #E8DFD0 100%);
}

.express-tour-item i {
    font-size: 18px;
    color: #1E6332;
}

.express-tour-item .badge {
    margin-left: auto;
    background: linear-gradient(135deg, #1E6332 0%, #1E6332 100%);
    font-size: 10px;
    padding: 4px 8px;
}

.express-tour-item.tour-active {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.express-tour-item.tour-active i {
    color: #dc2626;
}

.express-tour-item.tour-active .badge {
    background: #dc2626;
}

/* Driver.js - Enhanced styling for ExpressTour */
.driver-popover {
    font-family: 'Futura PT', 'Jost', sans-serif;
    border: 2px solid #1E6332;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(30, 99, 50, 0.1) !important;
    max-width: 380px !important;
    padding: 0 !important;
    overflow: visible;
}

.driver-popover-title {
    font-family: 'Futura PT', 'Jost', sans-serif;
    font-weight: 700;
    font-size: 16px !important;
    color: #214A3E;
    padding: 16px 16px 0 16px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.driver-popover-description {
    font-family: 'Futura PT', 'Jost', sans-serif;
    color: #475453;
    line-height: 1.5;
    padding: 12px 16px !important;
    margin: 0 !important;
    font-size: 13px;
}

.driver-popover-footer {
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #f8faf9 0%, #F4F0E9 100%);
    border-top: 1px solid rgba(30, 99, 50, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.driver-popover-progress-text {
    font-size: 13px !important;
    font-weight: 600;
    color: #1E6332;
    background: linear-gradient(135deg, #F4F0E9, #E8DFD0);
    padding: 6px 14px;
    border-radius: 20px;
}

.driver-popover-navigation-btns {
    display: flex;
    gap: 8px;
}

.driver-popover-prev-btn {
    background: #F4F0E9 !important;
    color: #475453 !important;
    border: 1px solid #E8DFD0 !important;
    border-radius: 8px !important;
    padding: 8px 14px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    font-family: 'Futura PT', 'Jost', sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.driver-popover-prev-btn:hover {
    background: #E8DFD0 !important;
}

.driver-popover-next-btn,
.driver-popover-done-btn {
    background: #1E6332 !important;
    color: #fff !important;
    border: 2px solid #1E6332 !important;
    border-radius: 4px !important;
    padding: 8px 18px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    font-family: 'Futura PT', 'Jost', sans-serif !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
    text-shadow: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.driver-popover-next-btn:hover,
.driver-popover-done-btn:hover {
    background: #214A3E !important;
}

.driver-popover-arrow-side-left { border-right-color: #1E6332 !important; }
.driver-popover-arrow-side-right { border-left-color: #1E6332 !important; }
.driver-popover-arrow-side-top { border-bottom-color: #1E6332 !important; }
.driver-popover-arrow-side-bottom { border-top-color: #1E6332 !important; }

/* Highlight styling */
.driver-active-element {
    box-shadow: 0 0 0 4px rgba(30, 99, 50, 0.4), 0 0 0 8px rgba(30, 99, 50, 0.15) !important;
    border-radius: 8px;
}

.tour-icon-box { flex-shrink: 0; }

.tour-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tour-content p {
    margin: 0;
    color: #475453;
    font-size: 14px;
    line-height: 1.7;
}

.tour-content .tour-highlight {
    color: #1E6332;
    font-weight: 700;
    background: linear-gradient(135deg, #F4F0E9, #E8DFD0);
    padding: 2px 8px;
    border-radius: 4px;
}

.tour-content .tour-feature-list,
.tour-welcome-content .tour-feature-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}

.tour-content .tour-feature-item,
.tour-welcome-content .tour-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #214A3E;
    padding: 10px 14px;
    background: linear-gradient(135deg, #F4F0E9 0%, #E8DFD0 100%);
    border-radius: 10px;
    border: 1px solid rgba(30, 99, 50, 0.2);
    line-height: 1.4;
}

.tour-content .tour-tip,
.tour-welcome-content .tour-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #F4F0E9 0%, #E8DFD0 100%);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    margin-top: 5px;
}

.tour-content .tour-tip span,
.tour-welcome-content .tour-tip span {
    font-size: 12px;
    color: #6B4A28;
    font-weight: 500;
    line-height: 1.5;
}

.tour-content .tour-tip strong,
.tour-welcome-content .tour-tip strong {
    color: #6B4A28;
}

/* Using default Driver.js button and arrow styles */

/* Exit Tour button */
.tour-exit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.tour-exit-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
    transform: scale(1.1);
}

/* Exit Confirmation Modal */
.exit-tour-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.exit-tour-confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.exit-tour-confirm-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px 35px;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    position: relative;
    z-index: 1000002;
}

.exit-tour-confirm-icon { font-size: 48px; margin-bottom: 15px; }
.exit-tour-confirm-title { font-size: 22px; font-weight: 700; color: #231F20; margin-bottom: 10px; }
.exit-tour-confirm-text { font-size: 14px; color: #475453; margin-bottom: 25px; }
.exit-tour-confirm-buttons { display: flex; gap: 12px; justify-content: center; pointer-events: auto; }

.exit-tour-btn-cancel {
    padding: 12px 24px;
    background: linear-gradient(135deg, #1E6332 0%, #214A3E 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1000002;
    transition: all 0.2s ease;
}

.exit-tour-btn-cancel:hover {
    background: linear-gradient(135deg, #214A3E 0%, #214A3E 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 99, 50, 0.3);
}

.exit-tour-btn-confirm {
    padding: 12px 24px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1000002;
    transition: all 0.2s ease;
}

.exit-tour-btn-confirm:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* Tour blocked popup */
.tour-blocked-popup {
    position: fixed;
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.tour-blocked-popup.show { opacity: 1; }

/* Tour Active State */
/* Fix for Driver.js positioning with fixed elements */
body.express-tour-active {
    overflow: visible !important;
}

body.express-tour-active .main-content {
    overflow: visible !important;
}

body.express-tour-active .main-content-wrapper {
    overflow: visible !important;
}

/* Temporarily make sidebar absolute during tour for proper popover positioning */
body.express-tour-active .app-sidebar {
    position: absolute !important;
}

/* Ensure Driver.js overlay and popover have correct z-index */
.driver-overlay {
    z-index: 99999 !important;
}

.driver-active-element {
    z-index: 100000 !important;
}

.driver-popover {
    z-index: 100001 !important;
}

body.express-tour-active .driver-popover,
body.express-tour-active .driver-popover * {
    pointer-events: auto;
    cursor: pointer;
}

/* Ensure popover buttons are always accessible above agenda */

.driver-popover .driver-popover-footer {
    z-index: 100003 !important;
    position: relative;
}

.driver-popover .driver-popover-close-btn {
    z-index: 100003 !important;
}

/* Welcome styling */
.tour-welcome-content {
    text-align: center;
    padding: 8px 0;
}

.tour-welcome-content .tour-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(30, 99, 50, 0.2);
}

.tour-welcome-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #214A3E;
    margin-bottom: 6px;
}

.tour-welcome-content p {
    color: #475453;
    font-size: 13px;
    margin-bottom: 12px;
}

.tour-welcome-content .tour-duration {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #F4F0E9 0%, #E8DFD0 100%);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    color: #1E6332;
    font-weight: 600;
}

/* Mobile responsive - using default Driver.js styles */
