/**
 * =================================================================
 * File: demo-tour.css
 * Purpose: Styles for interactive demo tour system
 * Spec Reference: tickets/active/TK-20251021-QUEST-045-TOUR-MODE.md
 *
 * Features:
 * - Tour overlay with dimmed background
 * - Highlight effects with pulsing animation
 * - Tooltip styling with smart positioning
 * - Progress indicator
 * - Responsive design
 * - Smooth transitions
 *
 * Quality Verification:
 *   Test:   Not Started (reset: code modified 2025-10-30)
 *   Review: 2025-10-30 14:15:00 (Approved with minor improvements)
 *   Spec:   Not Started (reset: code modified 2025-10-30)
 * =================================================================
 */

/* ========================================
   Tour Overlay
   ======================================== */

.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    pointer-events: none;
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   Spotlight Element
   ======================================== */

.tour-spotlight {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease-out;
}

/* ========================================
   Highlighted Elements
   ======================================== */

.tour-highlight {
    position: relative;
    z-index: 9999 !important;
    box-shadow: 0 0 0 4px #10B981, 0 0 30px rgba(16, 185, 129, 0.6);
    pointer-events: auto;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

/* Pulse Animation */
@keyframes tourPulse {
    0% {
        box-shadow: 0 0 0 4px #10B981, 0 0 30px rgba(16, 185, 129, 0.6);
    }
    50% {
        box-shadow: 0 0 0 8px #10B981, 0 0 50px rgba(16, 185, 129, 0.9);
    }
    100% {
        box-shadow: 0 0 0 4px #10B981, 0 0 30px rgba(16, 185, 129, 0.6);
    }
}

.tour-pulse {
    animation: tourPulse 2s infinite;
}

/* ========================================
   Arrow Indicators
   ======================================== */

.tour-arrow {
    position: fixed;
    width: 40px;
    height: 40px;
    pointer-events: none;
    z-index: 10000;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.tour-arrow svg {
    width: 100%;
    height: 100%;
    fill: #10B981;
    animation: arrowBounce 1.5s infinite;
}

/* Arrow bounce animation */
@keyframes arrowBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Arrow pointing down */
.tour-arrow.arrow-down {
    transform: rotate(0deg);
}

/* Arrow pointing up */
.tour-arrow.arrow-up {
    transform: rotate(180deg);
}

/* Arrow pointing left */
.tour-arrow.arrow-left {
    transform: rotate(90deg);
}

/* Arrow pointing right */
.tour-arrow.arrow-right {
    transform: rotate(-90deg);
}

/* ========================================
   Tour Tooltip
   ======================================== */

.tour-tooltip {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 450px;
    min-width: 320px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: tooltipSlideIn 0.3s ease-out;
}

@keyframes tooltipSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.tour-tooltip-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.tour-close-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6B7280;
    border-radius: 4px;
    transition: all 0.2s;
}

.tour-close-btn:hover {
    background: #F3F4F6;
    color: #111827;
}

.tour-tooltip-content {
    padding: 20px 24px;
}

.tour-tooltip-content p {
    margin: 0;
    color: #4B5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

.tour-actions {
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tour-action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Auto-advance toggle */
.tour-auto-advance-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6B7280;
    cursor: pointer;
    user-select: none;
}

.tour-auto-advance-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.tour-auto-advance-toggle:hover {
    color: #111827;
}

/* ========================================
   Tour Buttons
   ======================================== */

.tour-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.tour-btn-primary {
    background: #4F46E5;
    color: white;
}

.tour-btn-primary:hover {
    background: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.tour-btn-secondary {
    background: #F3F4F6;
    color: #374151;
}

.tour-btn-secondary:hover {
    background: #E5E7EB;
}

.tour-btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F3F4F6;
}

.tour-btn-secondary:disabled:hover {
    background: #F3F4F6;
    transform: none;
}

.tour-btn-link {
    background: none;
    color: #6B7280;
    padding: 10px 16px;
}

.tour-btn-link:hover {
    color: #111827;
    background: #F9FAFB;
}

/* ========================================
   Progress Indicator
   ======================================== */

.tour-progress {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    min-width: 200px;
    animation: fadeIn 0.3s ease-out;
}

.tour-progress-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tour-progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.tour-progress-bar-container {
    width: 100%;
    height: 6px;
    background: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
}

.tour-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #10B981);
    border-radius: 3px;
    transition: width 0.3s ease-out;
}

/* ========================================
   Start Tour Button
   ======================================== */

.tour-start-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4F46E5, #10B981);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 9997;
}

.tour-start-button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}

.tour-start-button:active {
    transform: translateY(-2px) scale(1.02);
}

.tour-start-button svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Pulse animation for start button */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(79, 70, 229, 0.6), 0 0 0 8px rgba(79, 70, 229, 0.2);
    }
}

.tour-start-button {
    animation: buttonPulse 3s infinite;
}

/* ========================================
   Completion Modal
   ======================================== */

.tour-completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease-out;
}

.tour-completion-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tour-completion-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: celebrationPulse 1s ease-out;
}

@keyframes celebrationPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tour-completion-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.tour-completion-content p {
    font-size: 1rem;
    color: #6B7280;
    margin: 0 0 32px 0;
    line-height: 1.6;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .tour-tooltip {
        max-width: calc(100vw - 32px);
        min-width: 280px;
    }

    .tour-start-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .tour-progress {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        min-width: 160px;
        padding: 10px 16px;
    }

    .tour-progress-text {
        font-size: 0.75rem;
    }

    .tour-tooltip-header h3 {
        font-size: 1.125rem;
    }

    .tour-tooltip-content p {
        font-size: 0.875rem;
    }

    .tour-actions {
        flex-direction: column;
        gap: 8px;
    }

    .tour-btn {
        width: 100%;
    }

    .tour-completion-content {
        padding: 32px 24px;
        max-width: calc(100vw - 32px);
    }

    .tour-completion-content h2 {
        font-size: 1.5rem;
    }

    .tour-completion-content p {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .tour-tooltip {
        min-width: 260px;
    }

    .tour-tooltip-header,
    .tour-tooltip-content,
    .tour-actions {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus styles for keyboard navigation */
.tour-btn:focus,
.tour-close-btn:focus,
.tour-start-button:focus {
    outline: 2px solid #4F46E5;
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .tour-highlight,
    .tour-pulse {
        animation: none !important;
    }

    .tour-start-button {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tour-overlay {
        background: rgba(0, 0, 0, 0.9);
    }

    .tour-highlight {
        box-shadow: 0 0 0 6px #10B981, 0 0 40px rgba(16, 185, 129, 0.8);
    }

    .tour-tooltip {
        border: 2px solid #111827;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .tour-overlay,
    .tour-tooltip,
    .tour-progress,
    .tour-start-button,
    .tour-completion-modal,
    .tour-highlight {
        display: none !important;
    }
}
