.lb-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.lb-button {
    background: #f8f9fa;
    color: #333; /* Ensure text is dark and readable */
    border: 1px solid #ddd;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    font-size: 1.1em;
    font-family: 'Cairo', sans-serif;
}

.lb-button:hover {
    background: #fff;
    color: #333 !important; /* Ensure text remains visible on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.lb-button.liked {
    background: var(--lb-primary-color, #ff4081);
    color: white;
    border-color: var(--lb-primary-color, #ff4081);
}

.lb-button:not(.liked) .lb-icon {
    animation: lb-pulse 2s infinite;
}

@keyframes lb-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.lb-button.liked .lb-icon {
    animation: lb-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lb-icon::before {
    content: '❤'; /* Default heart */
    font-size: 1.2em;
}

.lb-icon-thumbs-up .lb-icon::before {
    content: '👍';
}

.lb-icon-smile .lb-icon::before {
    content: '😊';
}

.lb-count {
    font-weight: bold;
    color: #555;
}

.lb-feedback {
    font-size: 0.9em;
    color: green;
    animation: lb-fade-in 0.5s;
}

@keyframes lb-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@keyframes lb-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Popup Styles */
.lb-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: flex-start; /* Sidebar on Right for RTL */
    z-index: 9999;
    direction: rtl;
}

.lb-popup-content {
    background: white;
    width: 300px;
    height: 100%;
    padding: 20px;
    padding-top: 50px; /* Space for close button */
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    position: relative;
    overflow-y: auto;
    animation: lb-slide-in 0.3s ease-out;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

.lb-close {
    position: absolute;
    top: 15px;
    left: 15px; /* Moved to left for RTL */
    right: auto;
    background: #f1f1f1;
    border: none;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.lb-close:hover {
    background: #e1e1e1;
}

@keyframes lb-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Popup Inner Styles */
.lb-popup-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    color: #333;
}

.lb-period-selector {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.lb-period-selector button {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
}

.lb-period-selector button:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.lb-period-selector button.active {
    background: var(--lb-primary-color, #ff4081);
    color: white;
    border-color: var(--lb-primary-color, #ff4081);
}

.lb-popup-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lb-popup-body li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.95em;
}

.lb-popup-body li a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.lb-popup-body li a:hover {
    color: var(--lb-primary-color, #ff4081);
}

.lb-leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

/* Suggestions Header & Selector */
.lb-suggestions-header h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

#lb-country-select {
    font-family: 'Cairo', sans-serif;
    font-size: 0.9em;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 5px;
    background: white;
    cursor: pointer;
}

.lb-widget-card {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    background: linear-gradient(180deg, #ffffff 0%, #fff6f8 100%);
    border: 1px solid rgba(255, 64, 129, 0.12);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.lb-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lb-widget-item {
    margin: 0;
}

.lb-widget-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    padding: 12px 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lb-widget-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 64, 129, 0.28);
    box-shadow: 0 10px 18px rgba(255, 64, 129, 0.12);
    color: var(--lb-primary-color, #ff4081);
}

.lb-widget-bullet {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 10px;
    background: linear-gradient(135deg, var(--lb-primary-color, #ff4081), #ff8fb3);
    box-shadow: 0 0 0 5px rgba(255, 64, 129, 0.12);
}

.lb-widget-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.7;
}

.lb-widget-empty {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    color: #475569;
    text-align: center;
}

@media (max-width: 782px) {
    .lb-widget-card {
        border-radius: 16px;
        padding: 12px;
    }

    .lb-widget-link {
        align-items: flex-start;
        padding: 12px;
    }

    .lb-widget-title {
        font-size: 0.95rem;
        line-height: 1.8;
    }
}
