/* SocialSauce - Instagram Feed Carousel */

/* Wrapper */
.socialsauce-wrapper {
    position: relative;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Carousel Container */
.socialsauce-carousel {
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Track - contains all items */
.socialsauce-track {
    display: flex;
    gap: var(--ss-gap, 16px);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Individual Item - Uses CSS variables for customization */
.socialsauce-item {
    flex: 0 0 calc((100% - (var(--ss-columns, 4) - 1) * var(--ss-gap, 16px)) / var(--ss-columns, 4));
    aspect-ratio: var(--ss-aspect-ratio, 9/16);
    position: relative;
    border-radius: var(--ss-border-radius, 12px);
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
}

/* Media Container */
.socialsauce-media {
    width: 100%;
    height: 100%;
    position: relative;
}

.socialsauce-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.socialsauce-item:hover .socialsauce-media img {
    transform: scale(1.05);
}

/* Video Icon */
.socialsauce-video-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) brightness(0) invert(1);
    opacity: 0.8;
    pointer-events: none;
}

.socialsauce-video-icon img {
    width: 100%;
    height: 100%;
}

/* Hover Overlay */
.socialsauce-overlay {
    position: absolute;
    inset: 0;
    background: var(--ss-overlay-color, rgba(0, 0, 0, 0.5));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.socialsauce-item:hover .socialsauce-overlay {
    opacity: 1;
}

.socialsauce-overlay-content {
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.socialsauce-item:hover .socialsauce-overlay-content {
    transform: translateY(0);
}

.socialsauce-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.socialsauce-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ss-text-color, #ffffff);
    font-size: var(--ss-font-size, 14px);
    font-weight: 500;
}

.socialsauce-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.socialsauce-caption {
    color: var(--ss-text-color, #ffffff);
    font-size: calc(var(--ss-font-size, 14px) - 1px);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Navigation Arrows - Half Circle overlaying images */
.socialsauce-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 88px;
    background: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.socialsauce-arrow img {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

.socialsauce-arrow:hover {
    background: #222;
}

.socialsauce-arrow:hover img {
    opacity: 1;
}

.socialsauce-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.socialsauce-arrow-prev {
    left: 0;
    border-radius: 0 44px 44px 0;
}

.socialsauce-arrow-next {
    right: 0;
    border-radius: 44px 0 0 44px;
}

/* Modal Styles */
.socialsauce-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.socialsauce-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.socialsauce-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

.socialsauce-modal-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 90vh;
    overflow-y: auto;
    z-index: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.socialsauce-modal-container::-webkit-scrollbar {
    display: none;
}

.socialsauce-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.socialsauce-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.socialsauce-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Modal Feed - Vertical Scroll */
.socialsauce-modal-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Modal Post Item */
.socialsauce-modal-post {
    background: #000;
    border-radius: 0;
}

.socialsauce-modal-media {
    width: 100%;
    aspect-ratio: 9 / 16;
    position: relative;
    background: #111;
}

.socialsauce-modal-media img,
.socialsauce-modal-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.socialsauce-modal-info {
    padding: 16px;
    background: #000;
}

.socialsauce-modal-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.socialsauce-modal-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 15px;
    font-weight: 500;
}

.socialsauce-modal-stat svg,
.socialsauce-modal-icon {
    width: 22px;
    height: 22px;
    opacity: 0.9;
}

.socialsauce-modal-caption {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

/* Copy Button */
.socialsauce-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.socialsauce-copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.socialsauce-copy-btn svg,
.socialsauce-copy-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.socialsauce-check-icon {
    stroke: #4ade80 !important;
}

.socialsauce-copy-btn.copied {
    color: #4ade80;
}

/* View More on Instagram Button */
.socialsauce-view-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 30px auto;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    max-width: 300px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.socialsauce-view-more:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
}

.socialsauce-view-more svg {
    flex-shrink: 0;
}

/* Error Message */
.socialsauce-error {
    padding: 16px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    margin: 20px 0;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .socialsauce-track {
        --ss-columns: min(var(--ss-columns, 4), 4) !important;
    }
}

@media (max-width: 992px) {
    .socialsauce-track {
        --ss-columns: min(var(--ss-columns, 4), 3) !important;
    }
}

@media (max-width: 768px) {
    .socialsauce-track {
        --ss-columns: 2 !important;
        gap: calc(var(--ss-gap, 16px) * 0.75);
    }

    .socialsauce-arrow {
        width: 35px;
        height: 70px;
    }

    .socialsauce-arrow img {
        width: 20px;
        height: 20px;
    }

    .socialsauce-modal-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .socialsauce-track {
        gap: calc(var(--ss-gap, 16px) * 0.5);
    }

    .socialsauce-wrapper {
        margin: 20px 0;
    }

    .socialsauce-arrow {
        width: 28px;
        height: 56px;
    }

    .socialsauce-arrow img {
        width: 18px;
        height: 18px;
    }

    .socialsauce-caption {
        font-size: 12px;
    }

    .socialsauce-stat {
        font-size: 12px;
    }
}
