/* Lajmi i Radhës - Popup Styles */
.lir-popup {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    background: var(--lir-bg-color, #ffffff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* CSS Variables për Light/Dark Mode */
    --lir-bg-color: #ffffff;
    --lir-text-color: #2c3e50;
    --lir-meta-color: #7f8c8d;
    --lir-excerpt-color: #555555;
    --lir-border-color: #f0f0f0;
    --lir-hover-bg: #f8f9fa;
    --lir-scroll-track: #f1f1f1;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .lir-popup {
        --lir-bg-color: #1a1a1a;
        --lir-text-color: #ffffff;
        --lir-meta-color: #cccccc;
        --lir-excerpt-color: #bbbbbb;
        --lir-border-color: #444444;
        --lir-hover-bg: #2d2d2d;
        --lir-scroll-track: #2a2a2a;
    }
}

/* Support për theme specifike të Wordpress me Dark Mode */
body.dark-mode .lir-popup,
body.wp-dark-mode .lir-popup,
body.theme-dark .lir-popup,
body.lir-dark-mode .lir-popup {
    --lir-bg-color: #1a1a1a;
    --lir-text-color: #ffffff;
    --lir-meta-color: #cccccc;
    --lir-excerpt-color: #bbbbbb;
    --lir-border-color: #444444;
    --lir-hover-bg: #2d2d2d;
    --lir-scroll-track: #2a2a2a;
}

.lir-popup-left {
    left: 20px;
    transform: translateY(-50%) translateX(-100%);
}

.lir-popup-right {
    right: 20px;
    transform: translateY(-50%) translateX(100%);
}

.lir-popup-left.lir-popup-visible {
    transform: translateY(-50%) translateX(0);
}

.lir-popup-right.lir-popup-visible {
    transform: translateY(-50%) translateX(0);
}

.lir-popup-container {
    position: relative;
    height: 100%;
}

/* Header */
.lir-popup-header {
    background: linear-gradient(135deg, #D20022, #B0001A);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lir-popup-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: white !important; /* Mbaje të bardhë edhe në dark mode */
}

.lir-popup-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    line-height: 1;
}

.lir-popup-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* Content */
.lir-popup-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
    background: var(--lir-bg-color);
}

.lir-popup-posts {
    padding: 0;
    background: var(--lir-bg-color);
}

.lir-popup-post-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--lir-border-color);
    transition: background-color 0.3s ease;
    text-decoration: none;
    color: inherit;
    background: var(--lir-bg-color);
}

.lir-popup-post-item:hover {
    background-color: var(--lir-hover-bg);
}

.lir-popup-post-item:last-child {
    border-bottom: none;
}

.lir-popup-thumbnail {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
}

.lir-popup-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lir-popup-post-item:hover .lir-popup-thumbnail img {
    transform: scale(1.05);
}

.lir-popup-post-content {
    flex: 1;
    min-width: 0;
}

.lir-popup-post-title {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--lir-text-color);
}

.lir-popup-post-title a {
    color: inherit;
    text-decoration: none;
}

.lir-popup-post-title a:hover {
    color: #D20022; /* Mbaje ngjyrën e kuqe për hover */
}

.lir-popup-meta {
    margin-bottom: 4px;
}

.lir-popup-date {
    font-size: 11px;
    color: var(--lir-meta-color);
    font-weight: 500;
}

.lir-popup-excerpt {
    font-size: 12px;
    color: var(--lir-excerpt-color);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.lir-popup-footer {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
}

.lir-popup-left .lir-popup-footer {
    right: -30px;
}

.lir-popup-right .lir-popup-footer {
    left: -30px;
}

.lir-popup-toggle {
    background: #D20022;
    border: none;
    color: white;
    width: 30px;
    height: 60px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: bold;
}

.lir-popup-left .lir-popup-toggle {
    border-radius: 6px 0 0 6px;
}

.lir-popup-toggle:hover {
    background: #B0001A;
    width: 35px;
}

.lir-popup-left .lir-popup-toggle:hover {
    transform: translateX(-5px);
}

.lir-popup-right .lir-popup-toggle:hover {
    transform: translateX(5px);
}

.lir-popup-left .lir-toggle-icon {
    transform: rotate(180deg);
}

/* Scrollbar Styling */
.lir-popup-content::-webkit-scrollbar {
    width: 4px;
}

.lir-popup-content::-webkit-scrollbar-track {
    background: var(--lir-scroll-track);
}

.lir-popup-content::-webkit-scrollbar-thumb {
    background: #D20022;
    border-radius: 2px;
}

.lir-popup-content::-webkit-scrollbar-thumb:hover {
    background: #B0001A;
}

/* Animations */
@keyframes lirSlideInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

@keyframes lirSlideInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.lir-popup-visible {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

.lir-popup-left.lir-popup-visible {
    animation-name: lirSlideInLeft;
}

.lir-popup-right.lir-popup-visible {
    animation-name: lirSlideInRight;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lir-popup {
        width: 300px;
        left: 10px;
        right: 10px;
        margin: 0 auto;
    }
    
    .lir-popup-left,
    .lir-popup-right {
        left: 10px;
        right: 10px;
        transform: translateY(-50%) translateY(100px);
    }
    
    .lir-popup-left.lir-popup-visible,
    .lir-popup-right.lir-popup-visible {
        transform: translateY(-50%) translateY(0);
    }
    
    .lir-popup-footer {
        display: none;
    }
    
    .lir-popup-header {
        padding: 15px;
    }
    
    .lir-popup-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .lir-popup {
        width: calc(100vw - 40px);
        left: 20px;
        right: 20px;
    }
    
    .lir-popup-post-item {
        padding: 12px;
    }
    
    .lir-popup-thumbnail {
        flex: 0 0 50px;
        height: 50px;
    }
}

/* Overlay për fokus */
.lir-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999998;
    display: none;
}

/* State për të fshehur */
.lir-popup-hidden {
    opacity: 0;
    pointer-events: none;
}

.lir-popup-left.lir-popup-hidden {
    transform: translateY(-50%) translateX(-100%);
}

.lir-popup-right.lir-popup-hidden {
    transform: translateY(-50%) translateX(100%);
}

/* Rregullim për butonin e mbylljes në dark mode */
@media (prefers-color-scheme: dark) {
    .lir-popup-close {
        background: rgba(255,255,255,0.2);
        color: white;
    }
}

body.dark-mode .lir-popup-close,
body.wp-dark-mode .lir-popup-close,
body.theme-dark .lir-popup-close {
    background: rgba(255,255,255,0.2);
    color: white;
}