/* ===== Tour Page — Self-contained styles ===== */

/* Shared base variables (same as main site) */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #e2e8f0;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s ease, color 0.3s ease;
    overflow: hidden;
    height: 100vh;
}

/* ===== Tour App Layout ===== */
.tour-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tour-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tour-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.tour-logo-icon {
    width: 32px;
    height: 32px;
}

.tour-logo-text {
    font-weight: 700;
    font-size: 1.1rem;
}

.tour-badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tour-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== Category Filters ===== */
.tour-filters {
    display: flex;
    gap: 6px;
}

.filter-pill {
    padding: 4px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Theme toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
}

/* ===== Progress Bar ===== */
.tour-progress {
    height: 3px;
    background: var(--border);
    flex-shrink: 0;
}

.tour-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s ease;
    width: 0%;
}

/* ===== Main Content ===== */
.tour-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
    min-height: 0;
    overflow: hidden;
}

.tour-step-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}

/* Screenshot with highlight */
.tour-screenshot-wrap {
    position: relative;
    max-width: 100%;
    max-height: 55vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    flex-shrink: 1;
    min-height: 0;
}

.tour-screenshot {
    display: block;
    max-width: 100%;
    max-height: 55vh;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.tour-highlight {
    position: absolute;
    border: 2px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 0 20px rgba(59, 130, 246, 0.1);
    animation: pulseHighlight 2s ease-in-out infinite;
    pointer-events: none;
    display: none;
}

.tour-highlight.visible {
    display: block;
}

@keyframes pulseHighlight {
    0%, 100% { box-shadow: 0 0 0 4px rgba(59,130,246,0.2), 0 0 20px rgba(59,130,246,0.1); }
    50% { box-shadow: 0 0 0 8px rgba(59,130,246,0.3), 0 0 30px rgba(59,130,246,0.15); }
}

/* Step info */
.tour-step-info {
    text-align: center;
    max-width: 600px;
    flex-shrink: 0;
}

.tour-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.tour-step-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== Navigation ===== */
.tour-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.tour-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.tour-nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tour-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-arrow {
    font-size: 1.1rem;
}

/* Dots */
.tour-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 60%;
}

.tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.tour-dot:hover {
    background: var(--text-secondary);
}

.tour-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}

.tour-dot.filtered-out {
    opacity: 0.3;
}

/* ===== Auto-play ===== */
.tour-autoplay {
    text-align: center;
    padding: 4px 0;
    flex-shrink: 0;
}

.autoplay-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.autoplay-label input {
    margin-right: 6px;
    accent-color: var(--accent);
}

/* ===== CTA ===== */
.tour-cta {
    text-align: center;
    padding: 8px 0 16px;
    flex-shrink: 0;
}

.tour-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.tour-cta-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .tour-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }

    .tour-filters {
        flex-wrap: wrap;
        justify-content: center;
    }

    .filter-pill {
        padding: 3px 10px;
        font-size: 0.75rem;
    }

    .tour-step-title {
        font-size: 1.25rem;
    }

    .tour-step-subtitle {
        font-size: 0.9rem;
    }

    .tour-screenshot-wrap {
        max-height: 40vh;
    }

    .tour-screenshot {
        max-height: 40vh;
    }

    .tour-dots {
        max-width: 50%;
    }

    .tour-dot {
        width: 6px;
        height: 6px;
    }

    .tour-dot.active {
        width: 18px;
    }
}

@media (max-width: 480px) {
    .tour-logo-text {
        display: none;
    }

    .tour-nav-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
}

/* ===== Iframe embed support ===== */
@media (max-height: 500px) {
    .tour-cta { display: none; }
    .tour-autoplay { display: none; }
    .tour-main { gap: 8px; padding: 8px 0; }
    .tour-screenshot-wrap { max-height: 35vh; }
    .tour-screenshot { max-height: 35vh; }
}
