/* css/guided-tour.css - Styles for Interactive Guided Tour */

/* Overlay container */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tour-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Dark backdrop */
.tour-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

/* Spotlight effect - highlights the current element */
.tour-spotlight {
    position: fixed;
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(134, 188, 37, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    pointer-events: none;
}

/* Animated pulse ring around spotlight */
.tour-spotlight::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #86BC25;
    border-radius: 12px;
    animation: tour-pulse 2s ease-in-out infinite;
}

@keyframes tour-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.7;
    }
}

/* Tooltip container */
.tour-tooltip {
    position: fixed;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 420px;
    min-width: 320px;
    z-index: 10002;
    overflow: hidden;
    animation: tour-tooltip-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tour-tooltip-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Tooltip header */
.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #86BC25 0%, #6a9a1d 100%);
    color: white;
}

.tour-step-indicator {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
}

.tour-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
}

.tour-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Tooltip content */
.tour-tooltip-content {
    padding: 24px;
    text-align: center;
}

.tour-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-radius: 50%;
    animation: tour-icon-bounce 0.6s ease-out;
}

.tour-icon svg {
    width: 28px;
    height: 28px;
    stroke: #16a34a;
    fill: none;
    stroke-width: 2;
}

@keyframes tour-icon-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.tour-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.tour-description {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Tooltip footer */
.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.tour-nav {
    display: flex;
    gap: 8px;
}

/* Buttons */
.tour-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
}

.tour-btn-skip {
    color: #94a3b8;
    padding: 10px 12px;
}

.tour-btn-skip:hover {
    color: #64748b;
    background: #e2e8f0;
}

.tour-btn-prev {
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
}

.tour-btn-prev:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.tour-btn-next.tour-btn-primary {
    background: linear-gradient(135deg, #86BC25 0%, #6a9a1d 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(134, 188, 37, 0.4);
}

.tour-btn-next.tour-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(134, 188, 37, 0.5);
}

.tour-btn-next.tour-btn-primary:active {
    transform: translateY(0);
}

/* Progress bar */
.tour-progress {
    height: 4px;
    background: #e2e8f0;
}

.tour-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #86BC25 0%, #a8d957 100%);
    transition: width 0.4s ease;
}

/* Position arrows/indicators */
.tour-tooltip::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
}

.tour-tooltip[data-position="top"]::before {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
}

.tour-tooltip[data-position="bottom"]::before {
    top: -8px;
    left: 50%;
    margin-left: -8px;
    background: #86BC25;
}

.tour-tooltip[data-position="left"]::before {
    right: -8px;
    top: 50%;
    margin-top: -8px;
    box-shadow: 4px -4px 8px rgba(0, 0, 0, 0.1);
}

.tour-tooltip[data-position="right"]::before {
    left: -8px;
    top: 50%;
    margin-top: -8px;
    background: #86BC25;
}

/* Body class when tour is active */
body.tour-active {
    overflow: hidden;
}

/* Demo button styles */
.demo-tour-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #86BC25 0%, #6a9a1d 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(134, 188, 37, 0.4);
    transition: all 0.3s ease;
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
}

.demo-tour-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(134, 188, 37, 0.5);
}

.demo-tour-btn:active {
    transform: translateY(-1px);
}

.demo-tour-btn svg {
    animation: demo-btn-pulse 2s ease-in-out infinite;
}

@keyframes demo-btn-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Landing page demo button (alternative position) */
.landing-demo-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(134, 188, 37, 0.1);
    color: #86BC25;
    border: 2px solid #86BC25;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.landing-demo-btn:hover {
    background: #86BC25;
    color: white;
    transform: scale(1.05);
}

/* Inline Demo Button (in settings area) */
.demo-tour-btn-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #86BC25 0%, #6a9a1d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(134, 188, 37, 0.3);
    transition: all 0.3s ease;
}

.demo-tour-btn-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(134, 188, 37, 0.4);
}

.demo-tour-btn-inline:active {
    transform: translateY(0);
}

.demo-tour-btn-inline svg {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: 90vw;
        min-width: auto;
        margin: 10px;
    }

    .tour-tooltip-content {
        padding: 20px;
    }

    .tour-icon {
        font-size: 40px;
    }

    .tour-title {
        font-size: 18px;
    }

    .tour-description {
        font-size: 14px;
    }

    .tour-tooltip-footer {
        flex-direction: column;
        gap: 12px;
    }

    .tour-btn-skip {
        order: 1;
    }

    .tour-nav {
        order: 0;
        width: 100%;
        justify-content: space-between;
    }

    .demo-tour-btn {
        bottom: 16px;
        left: 16px;
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* ========================================
   ENHANCED MOBILE STYLES (480px and below)
   ======================================== */
@media (max-width: 480px) {
    /* Tooltip */
    .tour-tooltip {
        max-width: calc(100vw - 20px) !important;
        min-width: auto !important;
        margin: 5px !important;
        left: 10px !important;
        right: 10px !important;
    }

    .tour-tooltip-header {
        padding: 10px 14px !important;
    }

    .tour-step-indicator {
        font-size: 12px !important;
    }

    .tour-close {
        width: 36px !important;
        height: 36px !important;
        min-height: 44px !important;
        min-width: 44px !important;
    }

    .tour-tooltip-content {
        padding: 16px !important;
    }

    .tour-icon {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 12px !important;
    }

    .tour-icon svg {
        width: 24px !important;
        height: 24px !important;
    }

    .tour-title {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }

    .tour-description {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    .tour-tooltip-footer {
        padding: 12px 16px !important;
        gap: 10px !important;
    }

    /* Buttons */
    .tour-btn {
        padding: 12px 16px !important;
        font-size: 13px !important;
        min-height: 44px !important;
    }

    .tour-btn-skip {
        padding: 12px !important;
    }

    .tour-nav {
        gap: 8px !important;
    }

    .tour-btn-prev,
    .tour-btn-next {
        flex: 1 !important;
        justify-content: center !important;
    }

    /* Demo Buttons */
    .demo-tour-btn {
        bottom: 12px !important;
        left: 12px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
        border-radius: 40px !important;
        min-height: 44px !important;
    }

    .landing-demo-btn {
        top: 12px !important;
        right: 12px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
        min-height: 44px !important;
    }

    .demo-tour-btn-inline {
        padding: 14px 20px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }

    /* Spotlight adjustments */
    .tour-spotlight {
        border-radius: 6px !important;
    }

    .tour-spotlight::before {
        top: -3px !important;
        left: -3px !important;
        right: -3px !important;
        bottom: -3px !important;
        border-radius: 10px !important;
    }

    /* Hide position arrows on mobile */
    .tour-tooltip::before {
        display: none !important;
    }
}

/* Extra Small Phones (360px and below) */
@media (max-width: 360px) {
    .tour-tooltip {
        margin: 5px !important;
    }

    .tour-tooltip-content {
        padding: 14px !important;
    }

    .tour-title {
        font-size: 15px !important;
    }

    .tour-description {
        font-size: 12px !important;
    }

    .tour-btn {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    .demo-tour-btn {
        bottom: 8px !important;
        left: 8px !important;
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}

/* Touch Device Enhancements */
@media (hover: none) and (pointer: coarse) {
    .tour-btn,
    .tour-close,
    .demo-tour-btn,
    .landing-demo-btn,
    .demo-tour-btn-inline {
        min-height: 44px !important;
    }

    .tour-btn:hover,
    .demo-tour-btn:hover,
    .landing-demo-btn:hover {
        transform: none !important;
    }

    .tour-btn:active,
    .demo-tour-btn:active,
    .landing-demo-btn:active {
        transform: scale(0.98) !important;
        opacity: 0.9 !important;
    }

    /* Larger close button touch target */
    .tour-close {
        width: 44px !important;
        height: 44px !important;
    }
}
