/* ==========================================================================
   Berleen Store - Post-Purchase & Welcome Dialogs
   Hardware-accelerated, Zero-Jank, 60fps Glassmorphic Design
   ========================================================================== */

.berlin-welcome-dialog {
    box-sizing: border-box;
    width: min(440px, calc(100% - 28px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin: auto;
    padding: 26px 22px 20px;
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 18px;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, rgba(20, 16, 30, 0.98) 65%), #14101e;
    color: #f8fafc;
    font-family: Cairo, Tajawal, sans-serif;
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(99, 102, 241, 0.1);
    transform: translateZ(0);
    contain: layout style;
    animation: berlinWelcomeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes berlinWelcomeIn {
    from {
        opacity: 0;
        transform: translate3d(0, 12px, 0) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.berlin-welcome-dialog::backdrop {
    background: rgba(8, 6, 18, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: berlinBackdropIn 0.22s ease-out both;
}

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

.berlin-welcome-dialog h2 {
    margin: 12px 0 8px;
    padding: 0;
    border: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0;
    background: linear-gradient(135deg, #ffffff 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.berlin-welcome-dialog p {
    margin: 0 0 18px;
    color: #cbd5e1;
    font-size: 13.5px;
    line-height: 1.85;
}

.berlin-welcome-icon {
    font-size: 28px;
    color: #8ce6e5;
    filter: drop-shadow(0 0 12px rgba(140, 230, 229, 0.35));
    display: inline-block;
}

.berlin-welcome-dialog button,
.berlin-welcome-referral-next {
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.berlin-welcome-dialog button:hover,
.berlin-welcome-referral-next:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.berlin-welcome-dialog button:active,
.berlin-welcome-referral-next:active {
    transform: translateY(0);
}

.berlin-welcome-dialog .berlin-welcome-close {
    position: absolute;
    inset-block-start: 14px;
    inset-inline-end: 14px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.berlin-welcome-dialog .berlin-welcome-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
    transform: rotate(90deg);
}

.berlin-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.berlin-welcome-actions button {
    flex: 1;
}

.berlin-welcome-dialog .berlin-welcome-primary,
.berlin-welcome-referral-next {
    background: linear-gradient(135deg, #34d399, #059669);
    color: #ffffff;
    border-color: transparent;
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.28);
}

.berlin-welcome-dialog .berlin-welcome-primary:hover,
.berlin-welcome-referral-next:hover {
    background: linear-gradient(135deg, #4ade80, #10b981);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    filter: brightness(1.05);
}

.berlin-welcome-referral-next {
    display: block;
    margin: 18px auto 0;
    min-width: 130px;
}

.berlin-welcome-socials {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.berlin-welcome-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 14px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: #f1f5f9;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transform: translateZ(0);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.berlin-welcome-link i {
    font-size: 19px;
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.berlin-welcome-link:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.4);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.berlin-welcome-link:active {
    transform: translateY(0);
}

/* Discord (Top primary CTA) */
.berlin-welcome-link:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #5865f2, #4752c4);
    border-color: rgba(165, 180, 252, 0.4);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.3);
    font-weight: 800;
}

.berlin-welcome-link:first-child:hover {
    background: linear-gradient(135deg, #6875f5, #515ecf);
    border-color: rgba(199, 210, 254, 0.6);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.45);
}

/* Brand-specific hover accents (GPU-friendly, no heavy layout thrashing) */
.berlin-welcome-link.is-facebook:hover {
    border-color: rgba(24, 119, 242, 0.45);
    background: rgba(24, 119, 242, 0.08);
}
.berlin-welcome-link.is-facebook:hover i { color: #1877f2; }

.berlin-welcome-link.is-instagram:hover {
    border-color: rgba(225, 48, 108, 0.45);
    background: rgba(225, 48, 108, 0.08);
}
.berlin-welcome-link.is-instagram:hover i { color: #e1306c; }

.berlin-welcome-link.is-tiktok:hover {
    border-color: rgba(0, 242, 254, 0.45);
    background: rgba(0, 242, 254, 0.08);
}
.berlin-welcome-link.is-tiktok:hover i { color: #00f2fe; }

.berlin-welcome-link.is-whatsapp:hover {
    border-color: rgba(37, 211, 102, 0.45);
    background: rgba(37, 211, 102, 0.08);
}
.berlin-welcome-link.is-whatsapp:hover i { color: #25d366; }

/* Linktree (Bottom full-width row) */
.berlin-welcome-link.is-linktree,
.berlin-welcome-link:last-child {
    grid-column: 1 / -1;
}

.berlin-welcome-link.is-linktree:hover {
    border-color: rgba(67, 230, 96, 0.45);
    background: rgba(67, 230, 96, 0.08);
}
.berlin-welcome-link.is-linktree:hover i { color: #43e660; }

.berlin-welcome-dialog :focus-visible,
.berlin-welcome-referral-next:focus-visible {
    outline: 2px solid #8ce6e5;
    outline-offset: 3px;
}

.berlin-welcome-dialog.is-tour {
    margin: auto 20px 20px auto;
    width: min(380px, calc(100% - 28px));
}

.berlin-welcome-dialog.is-tour::backdrop {
    background: rgba(8, 6, 18, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.berlin-welcome-highlight {
    outline: 3px solid #8ce6e5 !important;
    outline-offset: 6px;
    border-radius: 6px;
    scroll-margin-bottom: 260px;
}

/* Mobile responsive layout */
@media (max-width: 600px) {
    .berlin-welcome-dialog {
        padding: 22px 16px 16px;
        border-radius: 16px;
    }
    .berlin-welcome-dialog.is-tour {
        margin: auto auto 14px;
    }
    .berlin-welcome-dialog h2 {
        font-size: 19px;
    }
    .berlin-welcome-link {
        padding: 9px 12px;
        font-size: 12.5px;
        min-height: 44px;
    }
}

/* Low-end mobile / Lite FPS mode optimization: 0 blur, 0 shadow, 0 jank */
body.mobile-fps-lite .berlin-welcome-dialog,
html.berlin-mobile-fps-lite .berlin-welcome-dialog {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    contain: layout paint style !important;
}

body.mobile-fps-lite .berlin-welcome-dialog::backdrop,
html.berlin-mobile-fps-lite .berlin-welcome-dialog::backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
    background: rgba(8, 6, 18, 0.85) !important;
}

body.mobile-fps-lite .berlin-welcome-link,
html.berlin-mobile-fps-lite .berlin-welcome-link {
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Discord Linking Step Card */
.berlin-welcome-discord-card {
    margin: 10px 0 16px;
    padding: 13px 15px;
    border: 1px solid rgba(88, 101, 242, 0.32);
    border-radius: 14px;
    background: radial-gradient(circle at 100% 0%, rgba(88, 101, 242, 0.16) 0%, rgba(20, 16, 32, 0.7) 80%);
    box-shadow: 0 4px 18px rgba(88, 101, 242, 0.1);
}

.berlin-welcome-discord-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.berlin-welcome-discord-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.5;
}

.berlin-welcome-discord-features li i {
    font-size: 15px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .berlin-welcome-dialog,
    .berlin-welcome-dialog::backdrop,
    .berlin-welcome-dialog button,
    .berlin-welcome-link,
    .berlin-welcome-referral-next {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
