/**
 * Mandala Studio - Demo Tour Styles
 * Copyright (c) 2024-2026 Jolly Grid, LLC. All rights reserved.
 * PROPRIETARY AND CONFIDENTIAL
 * 
 * Modern onboarding tour with spotlight effects, glassmorphism tooltips,
 * and smooth animations.
 */

/* ============================================
   Demo Tour Overlay & Spotlight
   ============================================ */

.demo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

.demo-overlay.fade-out {
    opacity: 0;
}

.demo-spotlight-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.demo-overlay-bg {
    fill: rgba(0, 0, 0, 0.75);
    transition: fill 0.3s ease;
}

[data-theme="light"] .demo-overlay-bg {
    fill: rgba(0, 0, 0, 0.6);
}

.demo-spotlight-hole {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes demo-spotlight-pulse {
    0%, 100% {
        filter: none;
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.6));
    }
}

/* ============================================
   Demo Tooltip
   ============================================ */

.demo-tooltip {
    position: fixed;
    z-index: 10001;
    width: 320px;
    max-width: calc(100vw - 40px);
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(108, 92, 231, 0.2);
    padding: 20px;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.demo-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

[data-theme="light"] .demo-tooltip {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(108, 92, 231, 0.2);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(108, 92, 231, 0.1);
}

/* Modal variant - larger, centered */
.demo-tooltip.demo-modal {
    width: 420px;
    max-width: calc(100vw - 40px);
    text-align: center;
}

/* Arrow for targeted tooltips */
.demo-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: inherit;
    border: inherit;
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

.demo-tooltip[data-arrow="right"] .demo-tooltip-arrow {
    left: -8px;
    top: 30px;
    transform: rotate(-45deg);
}

.demo-tooltip[data-arrow="left"] .demo-tooltip-arrow {
    right: -8px;
    top: 30px;
    transform: rotate(135deg);
}

.demo-tooltip[data-arrow="bottom"] .demo-tooltip-arrow {
    top: -8px;
    left: 50%;
    margin-left: -8px;
    transform: rotate(45deg);
}

.demo-tooltip[data-arrow="top"] .demo-tooltip-arrow {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    transform: rotate(-135deg);
}

/* ============================================
   Tooltip Header
   ============================================ */

.demo-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.demo-progress {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color, #6c5ce7);
    background: rgba(108, 92, 231, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
}

.demo-skip-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.demo-skip-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .demo-skip-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.1);
}

/* ============================================
   Tooltip Content
   ============================================ */

.demo-tooltip-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}

[data-theme="light"] .demo-tooltip-title {
    color: #1a1a1a;
}

.demo-tooltip-content {
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 16px;
}

[data-theme="light"] .demo-tooltip-content {
    color: #555;
}

.demo-tooltip-content p {
    margin: 0 0 10px;
}

.demo-tooltip-content p:last-child {
    margin-bottom: 0;
}

/* Feature grid in welcome modal */
.demo-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.demo-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.demo-feature i {
    font-size: 28px;
    color: var(--primary-color, #6c5ce7);
}

.demo-feature span {
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
}

[data-theme="light"] .demo-feature span {
    color: #666;
}

/* List styling */
.demo-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    text-align: left;
}

.demo-list li {
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-list li i {
    width: 20px;
    color: var(--primary-color, #6c5ce7);
    text-align: center;
}

/* Mode badges */
.demo-modes {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.demo-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.demo-mode i {
    font-size: 20px;
    color: var(--primary-color, #6c5ce7);
}

.demo-mode span {
    font-size: 11px;
    font-weight: 500;
}

/* Action callout */
.demo-action {
    background: rgba(108, 92, 231, 0.15);
    border: 1px dashed rgba(108, 92, 231, 0.4);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
    color: var(--primary-color, #6c5ce7);
}

.demo-action i {
    margin-right: 8px;
}

/* Keyboard shortcut styling */
.demo-shortcut {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
}

.demo-shortcut kbd,
.demo-tips-final kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    color: #fff;
}

[data-theme="light"] .demo-shortcut kbd,
[data-theme="light"] .demo-tips-final kbd {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Tip highlight */
.demo-tip {
    font-size: 13px;
    color: var(--primary-color, #6c5ce7);
    font-style: italic;
    margin-top: 10px;
}

/* Final step styling */
.demo-tips-final {
    text-align: left;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.demo-tips-final h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--primary-color, #6c5ce7);
}

.demo-tips-final ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.demo-tips-final li {
    padding: 5px 0;
    font-size: 13px;
}

.demo-cta {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color, #6c5ce7);
    margin-top: 15px;
}

/* ============================================
   Tooltip Footer
   ============================================ */

.demo-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .demo-tooltip-footer {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-btn.primary {
    background: var(--primary-color, #6c5ce7);
    color: white;
}

.demo-btn.primary:hover {
    background: #5b4cdb;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.demo-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.demo-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

[data-theme="light"] .demo-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

[data-theme="light"] .demo-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Progress dots */
.demo-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.demo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.demo-dot.active {
    background: var(--primary-color, #6c5ce7);
    transform: scale(1.2);
}

[data-theme="light"] .demo-dot {
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================
   Welcome Prompt (New User)
   ============================================ */

.demo-welcome-prompt {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-welcome-prompt.visible {
    opacity: 1;
    transform: translateY(0);
}

.demo-prompt-content {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(108, 92, 231, 0.15);
}

[data-theme="light"] .demo-prompt-content {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(108, 92, 231, 0.2);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(108, 92, 231, 0.1);
}

.demo-prompt-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 12px;
    flex-shrink: 0;
}

.demo-prompt-icon i {
    font-size: 24px;
    color: white;
    animation: demo-magic-float 2s ease-in-out infinite;
}

@keyframes demo-magic-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(10deg); }
}

.demo-prompt-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-prompt-text strong {
    font-size: 15px;
    color: #fff;
}

.demo-prompt-text span {
    font-size: 13px;
    color: #aaa;
}

[data-theme="light"] .demo-prompt-text strong {
    color: #1a1a1a;
}

[data-theme="light"] .demo-prompt-text span {
    color: #666;
}

.demo-prompt-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.demo-prompt-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-prompt-btn.primary {
    background: var(--primary-color, #6c5ce7);
    color: white;
}

.demo-prompt-btn.primary:hover {
    background: #5b4cdb;
    transform: translateY(-1px);
}

.demo-prompt-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.demo-prompt-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

[data-theme="light"] .demo-prompt-btn.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: #888;
}

[data-theme="light"] .demo-prompt-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* ============================================
   Demo Button in UI
   ============================================ */

.demo-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(108, 92, 231, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 8px;
    color: var(--primary-color, #6c5ce7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-start-btn:hover {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.3), rgba(108, 92, 231, 0.2));
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.2);
}

.demo-start-btn i {
    font-size: 12px;
}

/* ============================================
   Help Dropdown Menu
   ============================================ */

.help-dropdown-wrapper {
    position: relative;
}

.help-btn {
    color: #888 !important;
    transition: color 0.2s ease;
}

.help-btn:hover {
    color: var(--primary-color, #6c5ce7) !important;
}

.help-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--panel-bg, #252525);
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.help-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

[data-theme="light"] .help-dropdown {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.help-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--text-color, #e0e0e0);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.help-dropdown .dropdown-item:hover {
    background: rgba(108, 92, 231, 0.15);
}

.help-dropdown .dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--primary-color, #6c5ce7);
}

.help-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-color, #3a3a3a);
    margin: 6px 0;
}

[data-theme="light"] .help-dropdown .dropdown-divider {
    background: #e0e0e0;
}

.help-dropdown .dropdown-section-header {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-color, #ccc);
}

.shortcut-item kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 11px;
    color: #aaa;
}

[data-theme="light"] .shortcut-item kbd {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* ============================================
   Mobile Responsiveness
   ============================================ */

@media (max-width: 768px) {
    .demo-tooltip {
        width: calc(100vw - 30px);
        max-width: 360px;
        padding: 16px;
    }
    
    .demo-tooltip.demo-modal {
        width: calc(100vw - 30px);
        max-width: 380px;
    }
    
    .demo-features {
        gap: 12px;
    }
    
    .demo-feature i {
        font-size: 22px;
    }
    
    .demo-welcome-prompt {
        bottom: 20px;
        right: 15px;
        left: 15px;
    }
    
    .demo-prompt-content {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        padding: 15px;
    }
    
    .demo-prompt-text {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .demo-prompt-actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .demo-tooltip-title {
        font-size: 16px;
    }
    
    .demo-tooltip-content {
        font-size: 13px;
    }
    
    .demo-modes {
        gap: 8px;
    }
    
    .demo-mode {
        padding: 8px 10px;
    }
    
    .demo-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
