/* =============================================================================
   BrikPanel — Feature Showcase Popup
   ============================================================================= */

/* ── Overlay ────────────────────────────────────────────────────────────────── */
.brikpanel-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease, backdrop-filter 0.4s ease;
    pointer-events: none;
}

.brikpanel-welcome-overlay.is-visible {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    pointer-events: auto;
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.brikpanel-welcome-modal {
    width: 640px;
    max-width: 92vw;
    max-height: 88vh;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(24px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease;
}

.brikpanel-welcome-overlay.is-visible .brikpanel-welcome-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Close Button ───────────────────────────────────────────────────────────── */
.brikpanel-welcome-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8a8a;
    transition: background 0.15s, color 0.15s;
}

.brikpanel-welcome-close:hover {
    background: #f1f1f1;
    color: #303030;
}

.brikpanel-welcome-close svg {
    width: 18px;
    height: 18px;
}

/* ── Slides Container ───────────────────────────────────────────────────────── */
.brikpanel-welcome-slides {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.brikpanel-welcome-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 48px 24px;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow-y: auto;
}

.brikpanel-welcome-slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
}

.brikpanel-welcome-slide.is-exiting-left {
    opacity: 0;
    transform: translateX(-60px);
}

/* ── Intro Slide (first) ────────────────────────────────────────────────────── */
.brikpanel-welcome-intro {
    text-align: center;
}

.brikpanel-welcome-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: #303030;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bwLogoEntrance 0.6s 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bwLogoEntrance {
    from {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.brikpanel-welcome-logo svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.brikpanel-welcome-intro h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #303030;
    margin: 0 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: bwFadeUp 0.5s 0.4s ease both;
}

.brikpanel-welcome-intro p {
    font-size: 0.9375rem;
    color: #616161;
    margin: 0;
    line-height: 1.6;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    animation: bwFadeUp 0.5s 0.5s ease both;
}

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

/* ── Feature Grid (intro slide) ─────────────────────────────────────────────── */
.brikpanel-welcome-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
    width: 100%;
    max-width: 480px;
}

.brikpanel-welcome-feature-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f9f9f9;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    animation: bwFeatureIn 0.4s ease both;
}

.brikpanel-welcome-feature-mini:nth-child(1) { animation-delay: 0.55s; }
.brikpanel-welcome-feature-mini:nth-child(2) { animation-delay: 0.6s; }
.brikpanel-welcome-feature-mini:nth-child(3) { animation-delay: 0.65s; }
.brikpanel-welcome-feature-mini:nth-child(4) { animation-delay: 0.7s; }
.brikpanel-welcome-feature-mini:nth-child(5) { animation-delay: 0.75s; }
.brikpanel-welcome-feature-mini:nth-child(6) { animation-delay: 0.8s; }

@keyframes bwFeatureIn {
    from {
        transform: translateY(16px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.brikpanel-welcome-feature-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #ccc;
}

.brikpanel-welcome-feature-mini .bw-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: #303030;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brikpanel-welcome-feature-mini .bw-icon svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.brikpanel-welcome-feature-mini .bw-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #303030;
    line-height: 1.3;
}

.brikpanel-welcome-feature-mini .bw-sublabel {
    font-size: 0.6875rem;
    color: #8a8a8a;
    font-weight: 400;
}

/* ── Feature Detail Slide ───────────────────────────────────────────────────── */
.brikpanel-welcome-feature-detail {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brikpanel-welcome-feature-icon {
    width: 56px;
    height: 56px;
    background: #f1f1f1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.brikpanel-welcome-slide.is-active .brikpanel-welcome-feature-icon {
    animation: bwIconPop 0.5s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bwIconPop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.brikpanel-welcome-feature-icon svg {
    width: 26px;
    height: 26px;
    color: #303030;
}

.brikpanel-welcome-feature-detail h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #303030;
    margin: 0 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.brikpanel-welcome-slide.is-active .brikpanel-welcome-feature-detail h3 {
    animation: bwFadeUp 0.4s 0.15s ease both;
}

.brikpanel-welcome-feature-detail > p {
    font-size: 0.875rem;
    color: #616161;
    margin: 0 0 24px;
    line-height: 1.6;
    max-width: 420px;
}

.brikpanel-welcome-slide.is-active .brikpanel-welcome-feature-detail > p {
    animation: bwFadeUp 0.4s 0.2s ease both;
}

/* ── Feature Highlights List ────────────────────────────────────────────────── */
.brikpanel-welcome-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brikpanel-welcome-highlights li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #303030;
    font-weight: 500;
    text-align: left;
}

.brikpanel-welcome-slide.is-active .brikpanel-welcome-highlights li {
    animation: bwListItem 0.35s ease both;
}
.brikpanel-welcome-slide.is-active .brikpanel-welcome-highlights li:nth-child(1) { animation-delay: 0.25s; }
.brikpanel-welcome-slide.is-active .brikpanel-welcome-highlights li:nth-child(2) { animation-delay: 0.3s; }
.brikpanel-welcome-slide.is-active .brikpanel-welcome-highlights li:nth-child(3) { animation-delay: 0.35s; }
.brikpanel-welcome-slide.is-active .brikpanel-welcome-highlights li:nth-child(4) { animation-delay: 0.4s; }

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

.brikpanel-welcome-highlights li .bw-check {
    width: 20px;
    height: 20px;
    min-width: 20px;
    background: #e8f5e7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brikpanel-welcome-highlights li .bw-check svg {
    width: 12px;
    height: 12px;
    color: #1a8917;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.brikpanel-welcome-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-top: 1px solid #e3e3e3;
    background: #fafafa;
}

/* ── Dots ───────────────────────────────────────────────────────────────────── */
.brikpanel-welcome-dots {
    display: flex;
    gap: 6px;
}

.brikpanel-welcome-dot {
    width: 8px;
    height: 8px;
    border-radius: 8px;
    background: #ddd;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s, width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brikpanel-welcome-dot.is-active {
    background: #303030;
    width: 20px;
}

/* ── Navigation Buttons ─────────────────────────────────────────────────────── */
.brikpanel-welcome-nav {
    display: flex;
    gap: 8px;
}

.brikpanel-welcome-btn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8125rem;
    font-weight: 550;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.brikpanel-welcome-btn:active {
    transform: scale(0.97);
}

.brikpanel-welcome-btn--secondary {
    background: #fff;
    color: #303030;
    box-shadow: inset 0 0 0 1px #e3e3e3, 0 1px 0 rgba(0, 0, 0, 0.05);
}

.brikpanel-welcome-btn--secondary:hover {
    background: #f7f7f7;
}

.brikpanel-welcome-btn--primary {
    background: #303030;
    color: #fff;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brikpanel-welcome-btn--primary:hover {
    background: #1a1a1a;
}

.brikpanel-welcome-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Keyboard Shortcut Badge ────────────────────────────────────────────────── */
.brikpanel-welcome-kbd {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
}

.brikpanel-welcome-kbd kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.6875rem;
    color: #616161;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .brikpanel-welcome-slide {
        padding: 32px 24px 16px;
    }

    .brikpanel-welcome-features-grid {
        grid-template-columns: 1fr;
    }

    .brikpanel-welcome-footer {
        padding: 12px 20px;
    }

    .brikpanel-welcome-modal {
        border-radius: 0.75rem;
    }
}

/* ── Confetti (final slide) ─────────────────────────────────────────────────── */
.brikpanel-welcome-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.brikpanel-welcome-confetti span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    opacity: 0;
}

.brikpanel-welcome-slide.is-active .brikpanel-welcome-confetti span {
    animation: bwConfetti 1.5s ease-out both;
}

@keyframes bwConfetti {
    0% {
        transform: translateY(0) rotate(0deg) scale(0);
        opacity: 0;
    }
    15% {
        opacity: 1;
        transform: translateY(-20px) rotate(45deg) scale(1);
    }
    100% {
        transform: translateY(120px) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* ── Pulse Ring Animation ───────────────────────────────────────────────────── */
.brikpanel-welcome-pulse-ring {
    position: absolute;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 2px solid #303030;
    opacity: 0;
}

.brikpanel-welcome-slide.is-active .brikpanel-welcome-pulse-ring {
    animation: bwPulseRing 1.2s 0.3s ease-out both;
}

@keyframes bwPulseRing {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* ── Skip link ──────────────────────────────────────────────────────────────── */
.brikpanel-welcome-skip {
    background: none;
    border: none;
    color: #8a8a8a;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
}

.brikpanel-welcome-skip:hover {
    color: #303030;
}
