/* Reset & Base Styles */
.eshlo-insta-slider-container,
.fbf-instagram-container {
    direction: rtl;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* Grid View Styles */
.fbf-instagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.fbf-instagram-item {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.fbf-instagram-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.fbf-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.fbf-instagram-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: inherit;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), object-fit 0.9s ease-in-out;
}

.fbf-instagram-item:hover .fbf-instagram-image {
    transform: scale(1.01);
    /* object-fit: cover; */
}

.fbf-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fbf-instagram-item:hover .fbf-image-overlay {
    opacity: 1;
}

.fbf-image-overlay .dashicons {
    color: white;
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.fbf-meta {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    gap: 20px;
    flex-wrap: wrap;
}

.fbf-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-left: 6px;
    fill: currentColor;
}

.fbf-likes,
.fbf-comments {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.fbf-likes {
    color: #e91e63;
}

.fbf-comments {
    color: #2196f3;
}

.fbf-carousel-badge,
.fbf-video-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-right: auto;
    left: 10px;
    top: 10px;
    cursor: pointer;
}

.fbf-caption {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.fbf-caption-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 12px;
    flex-grow: 1;
}

/* background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); */
.fbf-show-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: fit-content;
}

.fbf-show-more:hover {
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.fbf-caption-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.fbf-caption-overlay-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fbf-caption-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.fbf-caption-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.fbf-caption-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fbf-caption-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.fbf-caption-body {
    padding: 32px;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: #495057;
    max-height: 50vh;
}

.fbf-caption-footer {
    padding: 20px 32px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.fbf-view-original {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.fbf-view-original:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 87, 108, 0.3);
}

/* Pagination Styles */
.fbf-pagination {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.fbf-pagination-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.fbf-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    justify-content: center;
}

.fbf-pagination-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.fbf-prev-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.fbf-next-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Error Message */
.fbf-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin: 20px;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
    font-size: 15px;
    font-weight: 500;
}

/* Loading Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.fbf-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.fbf-loading>div {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Slider Styles */
.eshlo-insta-slider-container {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.eshlo-insta-slider-main {
    position: relative;
    margin: 0 -10px;
}

.eshlo-insta-slide {
    padding: 10px;
    height: auto;
}

.eshlo-insta-slide-inner {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.slick-current .eshlo-insta-slide-inner {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.eshlo-insta-media {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.eshlo-insta-media-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.eshlo-insta-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: inherit;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.eshlo-insta-slide-inner:hover .eshlo-insta-image {
    transform: scale(1.1);
}

.eshlo-insta-media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.eshlo-insta-slide-inner:hover .eshlo-insta-media-overlay {
    opacity: 1;
}

.eshlo-insta-view-icon svg {
    width: 32px;
    height: 32px;
    fill: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.eshlo-insta-video-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.eshlo-insta-video-badge svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.eshlo-insta-slide-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.eshlo-insta-likes,
.eshlo-insta-date,
.eshlo-insta-comments {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.eshlo-insta-likes svg {
    width: 20px;
    height: 20px;
    fill: #e91e63;
}

.eshlo-insta-comments svg {
    width: 20px;
    height: 20px;
    fill: #2196f3;
}

.eshlo-insta-date svg {
    width: 20px;
    height: 20px;
    fill: #eee;
}

.eshlo-insta-count {
    font-weight: 600;
}

.eshlo-insta-slide-caption {
    padding: 24px;
    flex-grow: 1;
    border-bottom: 1px solid #e9ecef;
}

.eshlo-insta-caption-text {
    font-size: 14px;
    line-height: 1.7;
    color: #495057;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 72px;
}

.eshlo-insta-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eshlo-insta-read-more:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.eshlo-insta-read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.eshlo-insta-read-more:hover svg {
    transform: translateY(2px);
}

.eshlo-insta-slide-actions {
    padding: 20px;
}

.eshlo-insta-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
}

.eshlo-insta-view-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.eshlo-insta-view-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Slick Customizations */
.slick-prev,
.slick-next {
    width: 50px;
    height: 50px;
    z-index: 10;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.slick-prev:hover,
.slick-next:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.slick-prev {
    right: -60px;
    left: auto;
}

.slick-next {
    left: -60px;
    right: auto;
}

.slick-prev:before,
.slick-next:before {
    display: none;
}

.slick-prev svg,
.slick-next svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.slick-dots {
    bottom: -40px;
}

.slick-dots li {
    margin: 0 4px;
}

.slick-dots li button:before {
    font-size: 10px;
    color: #adb5bd;
    opacity: 0.5;
}

.slick-dots li.slick-active button:before {
    color: #667eea;
    opacity: 1;
}

/* Caption Overlay for Slider */
.eshlo-insta-caption-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.eshlo-insta-caption-overlay-content {
    background: white;
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.eshlo-insta-caption-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.eshlo-insta-caption-overlay-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.eshlo-insta-caption-overlay-header svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.eshlo-insta-caption-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.eshlo-insta-caption-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.eshlo-insta-caption-close svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.eshlo-insta-caption-overlay-body {
    padding: 36px;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.9;
    color: #495057;
    max-height: 60vh;
    text-align: justify;
}

.eshlo-insta-caption-overlay-footer {
    padding: 24px 36px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    text-align: center;
}

.eshlo-insta-original-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.eshlo-insta-original-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 87, 108, 0.3);
}

.eshlo-insta-original-link svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .fbf-instagram-grid {
        max-width: 1200px;
    }

    .slick-prev {
        right: -40px;
    }

    .slick-next {
        left: -40px;
    }
}

@media (max-width: 1200px) {
    .fbf-instagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        padding: 15px;
    }

    .slick-prev,
    .slick-next {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .fbf-instagram-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }

    .eshlo-insta-slider-container {
        padding: 30px 15px;
    }

    .fbf-pagination-btn {
        min-width: 160px;
        padding: 12px 24px;
    }
}

@media (max-width: 768px) {
    .fbf-instagram-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 10px;
    }

    .fbf-instagram-item {
        border-radius: 12px;
    }

    .eshlo-insta-slider-container {
        padding: 20px 10px;
    }

    .eshlo-insta-slide {
        padding: 8px;
    }

    .fbf-pagination-buttons {
        flex-direction: column;
        align-items: center;
    }

    .fbf-pagination-btn {
        width: 100%;
        max-width: 280px;
    }

    .slick-dots {
        bottom: -30px;
    }
}

@media (max-width: 480px) {
    .fbf-instagram-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .eshlo-insta-caption-overlay-content {
        margin: 10px;
        max-height: 90vh;
    }

    .eshlo-insta-caption-overlay-header {
        padding: 20px;
    }

    .eshlo-insta-caption-overlay-body {
        padding: 24px;
        font-size: 15px;
    }

    .fbf-caption-overlay-content {
        margin: 10px;
        max-height: 85vh;
    }

    .fbf-caption-header {
        padding: 20px;
    }

    .fbf-caption-body {
        padding: 24px;
        font-size: 14px;
    }
}

/* Grid Caption Overlay Styles */
#fbf-grid-caption-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.fbf-caption-overlay-content {
    background: white;
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
}

.fbf-caption-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.fbf-caption-overlay-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.fbf-caption-overlay-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.fbf-caption-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.fbf-caption-overlay-close svg {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    color: white;
}

.fbf-caption-overlay-body {
    padding: 36px;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.9;
    color: #495057;
    max-height: 60vh;
    text-align: justify;
}

.fbf-caption-overlay-footer {
    padding: 24px 36px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    text-align: center;
}

.fbf-caption-overlay-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.fbf-caption-overlay-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(245, 87, 108, 0.3);
}

/* Grid Item Caption Wrapper */
.fbf-caption-wrapper {
    padding: 20px;
    border-top: 1px solid #e9ecef;
}

.fbf-caption {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid #e9ecef;
}

.fbf-caption-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fbf-external-icon {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Responsive adjustments for grid overlay */
@media (max-width: 768px) {
    .fbf-caption-overlay-content {
        margin: 10px;
        max-height: 90vh;
    }

    .fbf-caption-overlay-header {
        padding: 20px;
    }

    .fbf-caption-overlay-body {
        padding: 24px;
        font-size: 15px;
    }

    .fbf-caption-overlay-footer {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .fbf-caption-overlay-content {
        max-height: 95vh;
    }

    .fbf-caption-overlay-body {
        padding: 20px;
        font-size: 14px;
    }
}