/**
 * Instagram Feed Slider Pro - Frontend Styles
 *
 * Responsive slider display with lightbox, hover effects,
 * and smooth animations for the public-facing site.
 *
 * @package Instagram_Feed_Slider_Pro
 * @since 1.0.0
 */

/* ==========================================================================
   Slider Wrapper
   ========================================================================== */
.ifsp-slider-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================================================
   Profile Header
   ========================================================================== */
.ifsp-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 4px;
    margin-bottom: 12px;
}

.ifsp-profile-pic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(135deg, #405DE6, #833AB4, #E1306C, #F77737, #FCAF45) border-box;
    flex-shrink: 0;
}

.ifsp-profile-info {
    display: flex;
    flex-direction: column;
}

.ifsp-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #262626;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s ease;
}

.ifsp-profile-link:hover {
    color: #E1306C;
}

.ifsp-profile-username {
    font-weight: 600;
}

.ifsp-verified-badge {
    flex-shrink: 0;
}

.ifsp-profile-name {
    font-size: 13px;
    color: #8e8e8e;
    margin: 2px 0 0;
}

/* ==========================================================================
   Slide Styles
   ========================================================================== */
.ifsp-slide {
    height: auto;
}

.ifsp-slide-inner {
    position: relative;
    cursor: pointer;
    border-radius: inherit;
    overflow: hidden;
}

.ifsp-media-container {
    position: relative;
    overflow: hidden;
    background: #fafafa;
    border-radius: 12px;
}

.ifsp-media-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.35s ease;
    will-change: transform;
}

/* ==========================================================================
   Play Overlay (Video/Reel)
   ========================================================================== */
.ifsp-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s ease;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.ifsp-play-icon {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.ifsp-slide-inner:hover .ifsp-play-overlay {
    background: rgba(0, 0, 0, 0.75);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Reel Badge */
.ifsp-reel-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* ==========================================================================
   Hover Overlay
   ========================================================================== */
.ifsp-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 3;
    border-radius: inherit;
}

.ifsp-slide-inner:hover .ifsp-hover-overlay {
    opacity: 1;
}

.ifsp-overlay-content {
    text-align: center;
    padding: 16px;
    max-width: 90%;
}

.ifsp-overlay-caption {
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ifsp-ig-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.ifsp-ig-link:hover {
    background: #fff;
    color: #E1306C;
    transform: scale(1.1);
}

/* ==========================================================================
   Caption Below
   ========================================================================== */
.ifsp-slide-caption {
    padding: 10px 4px;
}

.ifsp-slide-caption p {
    font-size: 13px;
    color: #262626;
    margin: 0 0 4px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ifsp-slide-date {
    font-size: 11px;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   Swiper Navigation Overrides
   ========================================================================== */
.ifsp-slider-wrapper .swiper-button-next,
.ifsp-slider-wrapper .swiper-button-prev {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    color: #262626;
}

.ifsp-slider-wrapper .swiper-button-next::after,
.ifsp-slider-wrapper .swiper-button-prev::after {
    font-size: 16px;
    font-weight: 700;
}

.ifsp-slider-wrapper .swiper-button-next:hover,
.ifsp-slider-wrapper .swiper-button-prev:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    transform: scale(1.08);
}

.ifsp-slider-wrapper .swiper-button-disabled {
    opacity: 0.3 !important;
}

/* Pagination */
.ifsp-slider-wrapper .swiper-pagination {
    position: relative;
    margin-top: 16px;
}

.ifsp-slider-wrapper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #dbdbdb;
    opacity: 1;
    transition: all 0.3s ease;
}

.ifsp-slider-wrapper .swiper-pagination-bullet-active {
    background: #E1306C;
    width: 24px;
    border-radius: 4px;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.ifsp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ifspFadeIn 0.3s ease;
}

.ifsp-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.ifsp-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ifsp-lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 80vh;
}

.ifsp-lightbox-media img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ifsp-lightbox-media video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ifsp-lightbox-caption {
    color: #fff;
    font-size: 14px;
    text-align: center;
    padding: 16px 24px;
    max-width: 600px;
    line-height: 1.6;
    opacity: 0.85;
}

.ifsp-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 4px 12px;
    transition: all 0.2s ease;
    opacity: 0.7;
    z-index: 10;
}

.ifsp-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.2);
}

.ifsp-lightbox-prev,
.ifsp-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 16px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.ifsp-lightbox-prev { left: -60px; }
.ifsp-lightbox-next { right: -60px; }

.ifsp-lightbox-prev:hover,
.ifsp-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

@keyframes ifspFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   No Feeds Message
   ========================================================================== */
.ifsp-no-feeds {
    padding: 40px 24px;
    text-align: center;
    color: #8e8e8e;
    font-size: 15px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px dashed #dbdbdb;
}

.ifsp-error {
    color: #dc3545;
    font-size: 14px;
    padding: 12px;
    background: rgba(220, 53, 69, 0.05);
    border-radius: 8px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media screen and (max-width: 768px) {
    .ifsp-profile-header {
        padding: 12px 4px;
    }

    .ifsp-profile-pic {
        width: 36px;
        height: 36px;
    }

    .ifsp-profile-link {
        font-size: 13px;
    }

    .ifsp-slider-wrapper .swiper-button-next,
    .ifsp-slider-wrapper .swiper-button-prev {
        width: 32px;
        height: 32px;
    }

    .ifsp-slider-wrapper .swiper-button-next::after,
    .ifsp-slider-wrapper .swiper-button-prev::after {
        font-size: 12px;
    }

    .ifsp-lightbox-prev { left: 8px; }
    .ifsp-lightbox-next { right: 8px; }

    .ifsp-lightbox-prev,
    .ifsp-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .ifsp-lightbox-close {
        top: -32px;
        right: 4px;
        font-size: 28px;
    }
}

@media screen and (max-width: 480px) {
    .ifsp-slide-caption p {
        font-size: 12px;
    }

    .ifsp-overlay-caption {
        font-size: 11px;
    }
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .ifsp-slide-caption p {
        color: #e0e0e0;
    }

    .ifsp-slide-date {
        color: #a0a0a0;
    }
}

/* ==========================================================================
   Print - Hide sliders
   ========================================================================== */
@media print {
    .ifsp-slider-wrapper {
        display: none !important;
    }
}

/* Custom Header */
.ifsp-custom-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 0 10px; }
.ifsp-custom-header .ifsp-ch-text { flex-grow: 1; }
.ifsp-custom-header .ifsp-ch-heading { margin: 0 0 5px; font-size: 20px; font-weight: 600; line-height: 1.2; color: inherit; }
.ifsp-custom-header .ifsp-ch-subtitle { margin: 0; font-size: 14px; opacity: 0.7; }
.ifsp-custom-header .ifsp-ch-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background-color: #0095f6; color: #fff; text-decoration: none; border-radius: 6px; font-size: 14px; font-weight: 600; transition: background-color 0.2s; }
.ifsp-custom-header .ifsp-ch-btn:hover { background-color: #0081d6; color: #fff; }
@media (max-width: 600px) { .ifsp-custom-header { flex-direction: column; align-items: flex-start; gap: 15px; } }
