/**
 * ZMDM Demo Player Styles
 * Interactive clickable demo overlay system
 */

/* Prevent scrolling when demo is active */
body.demo-active {
    overflow: hidden;
}

/* Main overlay container */
.demo-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
}

.demo-overlay.active {
    display: block;
}

/* Semi-transparent backdrop */
.demo-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

/* Spotlight cutout - highlights the target element */
.demo-spotlight {
    position: absolute;
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(26, 115, 232, 0.5);
    border: 2px solid var(--gw-primary, #1a73e8);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 10001;
}

/* Tooltip container */
.demo-tooltip {
    position: absolute;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    pointer-events: auto;
    z-index: 10002;
    animation: tooltipFadeIn 0.3s ease;
}

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

/* Tooltip header */
.demo-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gw-primary, #1a73e8);
    border-radius: 12px 12px 0 0;
    color: white;
}

.demo-step-indicator {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
}

.demo-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.demo-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.demo-close-btn i {
    font-size: 18px;
    color: white;
}

/* Tooltip content */
.demo-tooltip-content {
    padding: 20px;
}

.demo-tooltip-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gw-gray-900, #202124);
}

.demo-tooltip-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gw-gray-700, #5f6368);
}

/* Tooltip footer with navigation */
.demo-tooltip-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gw-gray-50, #f8f9fa);
    border-top: 1px solid var(--gw-gray-200, #e8eaed);
    border-radius: 0 0 12px 12px;
}

/* Demo buttons */
.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.demo-btn i {
    font-size: 18px;
}

.demo-btn-primary {
    background: var(--gw-primary, #1a73e8);
    color: white;
}

.demo-btn-primary:hover {
    background: var(--gw-primary-dark, #1557b0);
}

.demo-btn-secondary {
    background: white;
    color: var(--gw-gray-700, #5f6368);
    border: 1px solid var(--gw-gray-300, #dadce0);
}

.demo-btn-secondary:hover {
    background: var(--gw-gray-100, #f1f3f4);
}

/* Tooltip arrow */
.demo-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    z-index: -1;
}

.demo-tooltip-arrow.arrow-top {
    top: -8px;
    left: 50%;
    margin-left: -8px;
    background: var(--gw-primary, #1a73e8);
}

.demo-tooltip-arrow.arrow-bottom {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    border-radius: 0 0 4px 0;
}

.demo-tooltip-arrow.arrow-left {
    left: -8px;
    top: 50%;
    margin-top: -8px;
    background: var(--gw-primary, #1a73e8);
}

.demo-tooltip-arrow.arrow-right {
    right: -8px;
    top: 50%;
    margin-top: -8px;
    background: var(--gw-primary, #1a73e8);
}

/* Clickable target highlight */
.demo-clickable {
    cursor: pointer !important;
    position: relative;
    z-index: 10001;
    pointer-events: auto !important;
    animation: clickPulse 1.5s infinite;
}

@keyframes clickPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(26, 115, 232, 0);
    }
}

/* Demo start button (optional - can be added to any page) */
.demo-start-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--gw-primary, #1a73e8), #4285f4);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.4);
    transition: all 0.2s ease;
    z-index: 1000;
}

.demo-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.5);
}

.demo-start-btn i {
    font-size: 20px;
}

/* Progress dots (alternative to step indicator) */
.demo-progress-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}

.demo-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gw-gray-300, #dadce0);
    transition: all 0.2s ease;
}

.demo-progress-dot.active {
    background: var(--gw-primary, #1a73e8);
    transform: scale(1.2);
}

.demo-progress-dot.completed {
    background: var(--gw-green-500, #34a853);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .demo-tooltip {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px;
    }

    .demo-tooltip-content {
        padding: 16px;
    }

    .demo-tooltip-title {
        font-size: 16px;
    }

    .demo-tooltip-description {
        font-size: 13px;
    }

    .demo-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}
