/* VARIABLES */
:root {
    --lb-blue: #0155d4;
    --lb-dark-overlay: rgba(15, 15, 20, 0.98);
    --lb-border: rgba(1, 85, 212, 0.3);
}

/* --- POPUP NOTIFICATION --- */
#lb-notify-wrap {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    z-index: 9999999 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.lb-popup {
    background: var(--lb-dark-overlay);
    border: 1px solid var(--lb-border);
    border-left: 4px solid var(--lb-blue);
    border-radius: 8px;
    padding: 15px;
    width: 380px;
    max-width: 90vw;
    display: flex;
    gap: 15px;
    align-items: flex-start; /* Changed from center to align top for better long text handling */
    color: #fff;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    opacity: 0;
    transform: translateY(20px);
    animation: lbSlideIn 0.5s forwards;
    pointer-events: auto;
}

.lb-popup.out { animation: lbSlideOut 0.5s forwards; }

.lb-pop-img {
    width: 50px;
    height: 50px;
    border-radius: var(--lb-radius);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
    margin-top: 2px; /* Slight offset */
}
.lb-pop-img img { width: 100%; height: 100%; object-fit: cover; }

.lb-pop-content { flex-grow: 1; min-width: 0; /* Ensures flex child wraps correctly */ }

.lb-pop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.lb-pop-name { font-size: 15px; font-weight: 700; color: #fff; }
.lb-pop-time { font-size: 11px; color: #777; font-weight: 500; white-space: nowrap; }

.lb-pop-location { font-size: 12px; color: #aaa; margin-bottom: 8px; display: block; }

.lb-pills-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap; /* Allows wrapping */
}

.lb-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.lb-pill.product {
    background: rgba(1, 85, 212, 0.15);
    color: #4da3ff;
    border: 1px solid rgba(1, 85, 212, 0.3);
}

.lb-pill.verified {
    background: rgba(39, 201, 63, 0.15);
    color: #27c93f;
    border: 1px solid rgba(39, 201, 63, 0.3);
}

@keyframes lbSlideIn { to { opacity: 1; transform: translateY(0); } }
@keyframes lbSlideOut { to { opacity: 0; transform: translateY(-20px); } }

/* --- GRID SYSTEM --- */
.lb-members-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
    width: 100%;
}

.lb-grid-item {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    width: 140px !important; max-width: 140px !important; flex: 0 0 140px !important; 
}

.lb-grid-avatar {
    width: 100px !important; height: 100px !important;
    margin-bottom: 15px; position: relative; background: transparent; flex-shrink: 0;
}
.lb-grid-avatar img {
    width: 100% !important; height: 100% !important;
    border-radius: var(--lb-radius); object-fit: cover !important;
}

.lb-grid-name { font-weight: 700; font-size: 16px; margin-bottom: 5px; color: #fff; }
.lb-grid-date { font-size: 12px; color: #666; }

.lb-load-more-container { text-align: center; margin-top: 20px; }
.lb-btn-action {
    background: var(--lb-blue); color: #fff; border: none; padding: 12px 30px;
    border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s;
    font-family: inherit;
}
.lb-btn-action:hover { background: #0246ad; box-shadow: 0 0 20px rgba(1,85,212,0.4); }
.lb-btn-action:disabled { opacity: 0.5; cursor: not-allowed; }

@media(max-width: 768px) {
    #lb-notify-wrap { display: none !important; }
    .lb-members-grid { gap: 15px; }
}

/* --- FLAG & FALLBACK STYLES --- */

/* Wrapper to ensure spacing between Avatar -> Flag -> Name */
.lb-flag-wrapper {
    margin-top: -10px; /* Pull it up closer to avatar */
    margin-bottom: 8px;
    height: 16px;      /* Fixed height to prevent jumping */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The Flag Image */
.lb-country-flag {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* distinct drop shadow */
    /* Dimensions are already set inline by PHP, but we can force them here if needed */
    max-width: 24px; 
}

/* The Fallback Text (When image fails) */
.lb-flag-fallback {
    font-size: 11px;
    font-weight: 800;
    color: #888;
    background: rgba(255,255,255,0.1);
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase; /* Forces 'gb' to 'GB' */
    letter-spacing: 1px;
    line-height: 1;
    display: inline-block;
}

/* Add this to your CSS file */

.lb-flag-unknown {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    background: rgba(255, 255, 255, 0.08); /* Subtle box background */
    padding: 0 8px;
    border-radius: 4px;
    line-height: 16px; /* Forces exact height match with flag images */
    display: inline-block;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ensure the wrapper handles the vertical spacing for BOTH flags and text */
.lb-flag-wrapper {
    margin-top: -10px;
    margin-bottom: 8px; /* Consistent spacing below flag/text */
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}