/**
 * onboarding-tour.css
 * Styles for interactive onboarding tours and tooltips
 */

/* ===== Tour Overlay ===== */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    pointer-events: none;
    animation: tourFadeIn 0.3s ease;
}

@keyframes tourFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ===== Tour Tooltip ===== */
.tour-tooltip {
    position: fixed;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    max-width: 420px;
    pointer-events: auto;
    animation: tourSlideUp 0.3s ease;
}

.tour-tooltip-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
}

@keyframes tourSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-tooltip-content {
    padding: 32px;
}

.tour-emoji {
    font-size: 64px;
    text-align: center;
    margin-bottom: 16px;
    animation: tourBounce 0.6s ease;
}

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

.tour-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    text-align: center;
}

.tour-description {
    font-size: 16px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 24px 0;
    text-align: center;
    white-space: pre-wrap;
}

/* ===== Progress Dots ===== */
.tour-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.tour-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
}

.tour-progress-dot.active {
    width: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tour-progress-dot.completed {
    background: #10b981;
}

/* ===== Tour Actions ===== */
.tour-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tour-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.tour-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tour-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.tour-btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

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

.tour-btn-skip {
    background: transparent;
    color: #64748b;
    padding: 12px 16px;
}

.tour-btn-skip:hover {
    color: #475569;
    background: #f1f5f9;
}

.tour-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* ===== Element Highlighting ===== */
.tour-highlight {
    position: relative;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.5),
                0 0 0 8px rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    animation: tourPulse 2s infinite;
}

@keyframes tourPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.5),
                    0 0 0 8px rgba(102, 126, 234, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.6),
                    0 0 0 12px rgba(102, 126, 234, 0.3);
    }
}

/* ===== Quick Tip ===== */
.tour-quick-tip {
    max-width: 320px;
}

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

.tour-quick-tip .tour-title {
    font-size: 18px;
    margin-bottom: 8px;
}

.tour-quick-tip .tour-description {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ===== Help Button ===== */
.help-button {
    position: fixed;
    bottom: 24px;
    left: 24px; /* Moved to left side to avoid conflict with floating-quote */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    z-index: 10005;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.help-button:active {
    transform: scale(0.95);
}

/* ===== Help Menu ===== */
.help-menu {
    display: grid;
    gap: 12px;
}

.help-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.help-menu-item:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateX(4px);
}

.help-menu-item i {
    font-size: 32px;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.help-menu-item h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.help-menu-item p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ===== Dark Theme Support ===== */
[data-theme="dark"] .tour-tooltip {
    background: #1e293b;
}

[data-theme="dark"] .tour-title {
    color: #f1f5f9;
}

[data-theme="dark"] .tour-description {
    color: #cbd5e1;
}

[data-theme="dark"] .tour-btn-secondary {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .tour-btn-secondary:hover {
    background: #475569;
}

[data-theme="dark"] .tour-btn-skip {
    color: #94a3b8;
}

[data-theme="dark"] .tour-btn-skip:hover {
    color: #cbd5e1;
    background: #334155;
}

[data-theme="dark"] .help-menu-item {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .help-menu-item:hover {
    border-color: #667eea;
    background: #334155;
}

[data-theme="dark"] .help-menu-item h3 {
    color: #f1f5f9;
}

[data-theme="dark"] .help-menu-item p {
    color: #94a3b8;
}

/* ===== Christmas Theme ===== */
[data-theme="christmas"] .tour-tooltip {
    border: 2px solid #fbbf24;
}

[data-theme="christmas"] .tour-btn-primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

[data-theme="christmas"] .tour-btn-primary:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

[data-theme="christmas"] .tour-highlight {
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.5),
                0 0 0 8px rgba(251, 191, 36, 0.2);
}

[data-theme="christmas"] .help-button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
        width: calc(100% - 32px);
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    .tour-tooltip-center {
        max-width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
        top: 50% !important;
        transform: translate(0, -50%) !important;
    }

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

    .tour-emoji {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .tour-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .tour-description {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 16px;
    }

    .tour-progress {
        margin-bottom: 16px;
    }

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

    .tour-btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 14px;
    }

    .help-button {
        bottom: 80px; /* Above navigation */
        left: 16px; /* Keep on left side on mobile too */
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .help-menu-item {
        padding: 12px;
    }

    .help-menu-item i {
        font-size: 24px;
        min-width: 32px;
    }

    .help-menu-item h3 {
        font-size: 14px;
    }

    .help-menu-item p {
        font-size: 12px;
    }
}

/* ===== Accessibility ===== */
.tour-tooltip:focus-within {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.tour-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tour-overlay,
    .tour-tooltip,
    .tour-emoji,
    .tour-highlight,
    .help-button {
        animation: none;
    }

    .tour-tooltip,
    .tour-btn,
    .help-button,
    .help-menu-item {
        transition: none;
    }
}

/* ===== Tooltip Arrow (Optional Enhancement) ===== */
.tour-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 12px solid transparent;
}

.tour-tooltip[data-placement="top"]::before {
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: white;
}

.tour-tooltip[data-placement="bottom"]::before {
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
}

.tour-tooltip[data-placement="left"]::before {
    right: -24px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: white;
}

.tour-tooltip[data-placement="right"]::before {
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: white;
}

[data-theme="dark"] .tour-tooltip[data-placement="top"]::before {
    border-top-color: #1e293b;
}

[data-theme="dark"] .tour-tooltip[data-placement="bottom"]::before {
    border-bottom-color: #1e293b;
}

[data-theme="dark"] .tour-tooltip[data-placement="left"]::before {
    border-left-color: #1e293b;
}

[data-theme="dark"] .tour-tooltip[data-placement="right"]::before {
    border-right-color: #1e293b;
}
