/* ==========================================================================
   Speaker Popup Modal — ThemeOnGo
   ========================================================================== */

/* ---------- Overlay / Backdrop ---------- */
.speaker-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    background: rgba(15, 23, 42, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 20px;
    box-sizing: border-box;
}

.speaker-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ---------- Modal Container ---------- */
.speaker-popup-modal {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.05);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.speaker-popup-overlay.active .speaker-popup-modal {
    transform: scale(1) translateY(0);
}

/* ---------- Close Button ---------- */
.speaker-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.speaker-popup-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: rotate(90deg);
}

/* ---------- Image Column ---------- */
.speaker-popup-image {
    flex: 0 0 40%;
    max-width: 40%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2240, #553c90);
}

.speaker-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.speaker-popup-image .speaker-popup-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.speaker-popup-image .speaker-popup-no-image i {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.25);
}

/* ---------- Content Column ---------- */
.speaker-popup-content {
    flex: 1;
    padding: 40px 36px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.speaker-popup-content::-webkit-scrollbar {
    width: 5px;
}

.speaker-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.speaker-popup-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Name */
.speaker-popup-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

/* Meta row (badge + location) */
.speaker-popup-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.speaker-popup-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    line-height: 1.4;
}

.speaker-popup-location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: #64748b;
}

.speaker-popup-location i {
    color: #3da1ca;
}

/* Separator */
.speaker-popup-separator {
    width: 40px;
    height: 3px;
    background: #2980b9;
    border: none;
    border-radius: 3px;
    margin: 0 0 24px 0;
}

/* Bio text */
.speaker-popup-bio {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #475569;
}

.speaker-popup-bio p {
    margin-bottom: 16px;
}

.speaker-popup-bio p:last-child {
    margin-bottom: 0;
}

/* ---------- Card Button ---------- */
.speaker-card-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    background: #2980b9;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease;
    line-height: 1.4;
}

.speaker-card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

/* ---------- Body lock ---------- */
body.speaker-popup-open {
    overflow: hidden;
}

/* ---------- Position Variants via prefix_class ---------- */

/* Right: image on right side (reverse row) */
.speaker-popup-img-pos-right .speaker-popup-modal {
    flex-direction: row-reverse;
}

/* Top: image on top (column layout) */
.speaker-popup-img-pos-top .speaker-popup-modal {
    flex-direction: column;
}

.speaker-popup-img-pos-top .speaker-popup-image {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    height: 300px;
}

/* Bottom: image on bottom (column-reverse layout) */
.speaker-popup-img-pos-bottom .speaker-popup-modal {
    flex-direction: column-reverse;
}

.speaker-popup-img-pos-bottom .speaker-popup-image {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    height: 300px;
}

/* No image: content takes full width */
.speaker-popup-modal.speaker-popup-no-img {
    max-width: 700px;
}

.speaker-popup-modal.speaker-popup-no-img .speaker-popup-content {
    flex: 1;
    max-width: 100%;
}

/* ---------- Responsive: tablet ---------- */
@media (max-width: 1024px) {
    .speaker-popup-img-pos-left .speaker-popup-image,
    .speaker-popup-img-pos-right .speaker-popup-image {
        flex: 0 0 38%;
        max-width: 38%;
    }
}

/* ---------- Responsive: mobile ---------- */
@media (max-width: 768px) {
    .speaker-popup-modal,
    .speaker-popup-img-pos-left .speaker-popup-modal,
    .speaker-popup-img-pos-right .speaker-popup-modal {
        flex-direction: column;
        max-height: 95vh;
    }

    .speaker-popup-image,
    .speaker-popup-img-pos-left .speaker-popup-image,
    .speaker-popup-img-pos-right .speaker-popup-image,
    .speaker-popup-img-pos-top .speaker-popup-image,
    .speaker-popup-img-pos-bottom .speaker-popup-image {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
        height: 220px;
    }

    .speaker-popup-content {
        padding: 24px 20px;
    }

    .speaker-popup-name {
        font-size: 1.35rem;
    }

    .speaker-popup-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .speaker-popup-overlay {
        padding: 10px;
    }

    .speaker-popup-image,
    .speaker-popup-img-pos-top .speaker-popup-image,
    .speaker-popup-img-pos-bottom .speaker-popup-image {
        height: 180px;
    }

    .speaker-popup-content {
        padding: 18px 16px;
    }

    .speaker-popup-name {
        font-size: 1.2rem;
    }
}
