/**
 * BadhteJao.com - Centralized Popup Manager Stylesheet
 * Responsive, accessible modal system for Registration, Facebook, Telegram & Instagram.
 */

:root {
    --bj-popup-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bj-popup-z-backdrop: 10600;
    --bj-popup-z-modal: 10601;
    --bj-popup-z-toast: 10650;
    --bj-popup-radius: 18px;
    --bj-primary-color: #0d6efd;
    --bj-primary-hover: #0b5ed7;
    --bj-facebook-color: #1877F2;
    --bj-facebook-hover: #166fe5;
    --bj-telegram-color: #229ED9;
    --bj-telegram-hover: #1e8ec3;
    --bj-instagram-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --bj-text-dark: #1e293b;
    --bj-text-muted: #64748b;
    --bj-bg-card: #ffffff;
    --bj-border-subtle: #e2e8f0;
}

/* Scroll lock when modal is open */
body.bj-popup-scroll-locked {
    overflow: hidden !important;
    touch-action: none;
    -ms-touch-action: none;
}

/* Root container */
.bj-popup-root {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--bj-popup-z-backdrop);
    font-family: var(--bj-popup-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bj-popup-root.bj-active {
    display: block;
}

/* Backdrop Overlay */
.bj-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: var(--bj-popup-z-backdrop);
}

.bj-popup-root.bj-visible .bj-popup-backdrop {
    opacity: 1;
}

/* Modal Wrapper */
.bj-popup-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: var(--bj-popup-z-modal);
    pointer-events: none; /* children enable pointer events */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Common Dialog Card */
.bj-popup-dialog {
    display: none;
    pointer-events: auto;
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bj-bg-card);
    border-radius: var(--bj-popup-radius);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.8);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

.bj-popup-dialog.bj-dialog-active {
    display: flex;
    flex-direction: column;
}

.bj-popup-root.bj-visible .bj-popup-dialog.bj-dialog-active {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Close Button (top-right circle) */
.bj-popup-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 25;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: #475569;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.bj-popup-close-btn:hover,
.bj-popup-close-btn:focus-visible {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
    outline: none;
}

/* Media Graphic Header */
.bj-popup-media-wrapper {
    position: relative;
    width: 100%;
    height: 190px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.bj-popup-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.bj-popup-dialog:hover .bj-popup-image {
    transform: scale(1.02);
}

.bj-popup-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-size: 48px;
}

/* Social Media Specific Header Gradients & Icons */
.bj-media-social-fb {
    background: linear-gradient(135deg, #e7f3ff 0%, #cbe4ff 100%);
}

.bj-media-social-tg {
    background: linear-gradient(135deg, #e3f5fc 0%, #c5eaf8 100%);
}

.bj-media-social-ig {
    background: linear-gradient(135deg, #fdf0f5 0%, #fcdbe9 100%);
}

.bj-social-floating-icon {
    position: absolute;
    bottom: -18px;
    left: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5;
    border: 3px solid #ffffff;
}

.fb-icon { background: var(--bj-facebook-color); }
.tg-icon { background: var(--bj-telegram-color); }
.ig-icon { background: var(--bj-instagram-gradient); }

/* Body Content */
.bj-popup-body {
    padding: 22px 24px 24px 24px;
    text-align: center;
    background: var(--bj-bg-card);
}

.bj-popup-social .bj-popup-body {
    padding-top: 26px; /* extra room for floating icon */
}

/* Brand Badge Pill */
.bj-popup-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bj-text-dark);
    margin-bottom: 12px;
}

.bj-brand-mini-logo {
    height: 16px;
    width: auto;
}

.bj-popup-brand-badge.fb-badge {
    background: #eff6ff;
    color: var(--bj-facebook-color);
}

.bj-popup-brand-badge.tg-badge {
    background: #f0fdfa;
    color: #0284c7;
}

.bj-popup-brand-badge.ig-badge {
    background: #fdf2f8;
    color: #db2777;
}

/* Title & Description */
.bj-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--bj-text-dark);
    line-height: 1.35;
    margin: 0 0 8px 0;
}

.bj-popup-message {
    font-size: 14px;
    color: var(--bj-text-muted);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

/* Highlight Pills */
.bj-popup-highlights {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.bj-highlight-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 12px;
}

/* Buttons and Action Area */
.bj-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.bj-popup-actions-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bj-popup-social-button-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bj-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    padding: 12px 18px;
    min-height: 46px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
    width: 100%;
}

.bj-popup-btn:focus-visible {
    outline: 2px solid var(--bj-primary-color);
    outline-offset: 2px;
}

/* Button Variants */
.bj-popup-btn-primary {
    background: var(--bj-primary-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.bj-popup-btn-primary:hover {
    background: var(--bj-primary-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.35);
}

.bj-popup-btn-facebook {
    background: var(--bj-facebook-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
}

.bj-popup-btn-facebook:hover {
    background: var(--bj-facebook-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35);
}

.bj-popup-btn-telegram {
    background: var(--bj-telegram-color);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(34, 158, 217, 0.25);
}

.bj-popup-btn-telegram:hover {
    background: var(--bj-telegram-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 158, 217, 0.35);
}

.bj-popup-btn-instagram {
    background: var(--bj-instagram-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.25);
}

.bj-popup-btn-instagram:hover {
    opacity: 0.95;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 39, 67, 0.35);
}

.bj-popup-btn-outline {
    flex: 1;
    background: #ffffff;
    color: var(--bj-text-dark);
    border-color: #cbd5e1;
    font-size: 13.5px;
    padding: 10px 14px;
}

.bj-popup-btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.bj-popup-btn-ghost {
    flex: 1;
    background: transparent;
    color: var(--bj-text-muted);
    border-color: transparent;
    font-size: 13.5px;
    padding: 10px 14px;
}

.bj-popup-btn-ghost:hover {
    background: #f1f5f9;
    color: var(--bj-text-dark);
}

/* Footer Link */
.bj-popup-footer-text {
    font-size: 13px;
    color: var(--bj-text-muted);
    margin-top: 6px;
}

.bj-popup-link {
    color: var(--bj-primary-color);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.bj-popup-link:hover {
    color: var(--bj-primary-hover);
}

/* Toast Feedback Notification */
.bj-popup-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: #1e293b;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    z-index: var(--bj-popup-z-toast);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.bj-popup-toast.bj-toast-show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.bj-toast-icon {
    color: #10b981;
    font-size: 16px;
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
    .bj-popup-backdrop,
    .bj-popup-dialog,
    .bj-popup-btn,
    .bj-popup-close-btn,
    .bj-popup-toast {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* Mobile Responsiveness (Screen <= 480px, Android & iOS devices) */
@media (max-width: 480px) {
    .bj-popup-dialog {
        max-width: 100%;
        border-radius: 16px;
    }

    .bj-popup-media-wrapper {
        height: 155px;
    }

    .bj-popup-body {
        padding: 18px 18px 20px 18px;
    }

    .bj-popup-title {
        font-size: 18px;
    }

    .bj-popup-message {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .bj-popup-social-button-row {
        flex-direction: column;
        gap: 8px;
    }

    .bj-popup-btn-outline,
    .bj-popup-btn-ghost {
        width: 100%;
        min-height: 42px;
    }

    .bj-social-floating-icon {
        bottom: -14px;
        left: 18px;
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
}

/* Small Heights (Landscape Mobile & Compact Screens) */
@media (max-height: 580px) {
    .bj-popup-media-wrapper {
        height: 110px;
    }

    .bj-popup-body {
        padding: 12px 18px;
    }

    .bj-popup-highlights {
        margin-bottom: 8px;
    }

    .bj-popup-title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .bj-popup-message {
        font-size: 12px;
        margin-bottom: 8px;
    }
}
