/**
 * Jestart Instagram Pro - Frontend Styles
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --jig-columns: 4;
    --jig-columns-tablet: 3;
    --jig-columns-mobile: 2;
    --jig-gap: 15px;
    --jig-rows: 3;
    --jig-aspect: 1/1;
    --jig-overlay-color: rgba(0, 0, 0, 0.6);
    --jig-overlay-text: #ffffff;
    --jig-icon-color: #ffffff;
    --jig-animation-speed: 25s;
    --jig-item-height: 250px;
    --jig-primary: #E1306C;
    --jig-secondary: #405DE6;
    --jig-gradient: linear-gradient(135deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
}

/* ============================================
   BASE STYLES
   ============================================ */
.jig-feed {
    width: 100%;
    position: relative;
}

.jig-feed * {
    box-sizing: border-box;
}

.jig-error, .jig-empty {
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 12px;
    color: #666;
}

.jig-editor-notice, .jig-editor-placeholder {
    padding: 60px 20px;
    text-align: center;
    background: var(--jig-gradient);
    border-radius: 12px;
    color: #fff;
}

.jig-editor-notice .dashicons,
.jig-editor-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    display: block;
}

/* ============================================
   HEADER
   ============================================ */
.jig-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    margin-bottom: 20px;
    gap: 20px;
}

.jig-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.jig-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.jig-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jig-header-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.jig-username {
    font-size: 18px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.jig-username:hover {
    color: var(--jig-primary);
}

.jig-bio {
    font-size: 14px;
    color: #666;
    margin: 0;
    max-width: 400px;
}

.jig-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.jig-stats {
    display: flex;
    gap: 15px;
}

.jig-stat {
    font-size: 14px;
    color: #666;
}

.jig-stat strong {
    display: block;
    font-size: 18px;
    color: #1e1e1e;
}

.jig-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--jig-gradient);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.jig-follow-btn svg {
    width: 18px;
    height: 18px;
}

.jig-follow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(225, 48, 108, 0.4);
    color: #fff;
}

/* Header Styles */
.jig-header-centered {
    flex-direction: column;
    text-align: center;
}

.jig-header-centered .jig-header-left {
    flex-direction: column;
}

.jig-header-centered .jig-bio {
    text-align: center;
}

.jig-header-boxed {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

/* ============================================
   GRID LAYOUT
   ============================================ */
.jig-grid {
    display: grid;
    grid-template-columns: repeat(var(--jig-columns), 1fr);
    gap: var(--jig-gap);
}

@media (max-width: 1024px) {
    .jig-grid {
        grid-template-columns: repeat(var(--jig-columns-tablet), 1fr);
    }
}

@media (max-width: 767px) {
    .jig-grid {
        grid-template-columns: repeat(var(--jig-columns-mobile), 1fr);
    }
}

/* ============================================
   MASONRY LAYOUT
   ============================================ */
.jig-masonry {
    column-count: var(--jig-columns);
    column-gap: var(--jig-gap);
}

.jig-masonry .jig-item {
    break-inside: avoid;
    margin-bottom: var(--jig-gap);
}

@media (max-width: 1024px) {
    .jig-masonry {
        column-count: var(--jig-columns-tablet);
    }
}

@media (max-width: 767px) {
    .jig-masonry {
        column-count: var(--jig-columns-mobile);
    }
}

/* ============================================
   CAROUSEL LAYOUT
   ============================================ */
.jig-carousel-wrap {
    position: relative;
    padding: 0 50px;
}

.jig-carousel {
    overflow: hidden;
}

.jig-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.jig-carousel-slide {
    flex: 0 0 calc(100% / var(--jig-columns));
    padding: 0 calc(var(--jig-gap) / 2);
}

.jig-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jig-carousel-nav svg {
    width: 20px;
    height: 20px;
}

.jig-carousel-nav:hover {
    background: var(--jig-primary);
    color: #fff;
}

.jig-carousel-prev { left: 0; }
.jig-carousel-next { right: 0; }

.jig-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.jig-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.jig-carousel-dot.active {
    background: var(--jig-primary);
    transform: scale(1.2);
}

@media (max-width: 767px) {
    .jig-carousel-wrap { padding: 0 35px; }
    .jig-carousel-nav { width: 35px; height: 35px; }
    .jig-carousel-slide { flex: 0 0 calc(100% / var(--jig-columns-mobile)); }
}

/* ============================================
   HORIZONTAL SCROLL
   ============================================ */
.jig-horizontal {
    display: flex;
    flex-direction: column;
    gap: var(--jig-gap);
}

.jig-horizontal-row {
    display: flex;
    gap: var(--jig-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    scrollbar-width: thin;
}

.jig-horizontal-row::-webkit-scrollbar {
    height: 6px;
}

.jig-horizontal-row::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.jig-horizontal-row::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.jig-horizontal-row .jig-item {
    flex: 0 0 calc((100% - var(--jig-gap) * (var(--jig-columns) - 1)) / var(--jig-columns));
    scroll-snap-align: start;
}

/* ============================================
   MARQUEE LAYOUT
   ============================================ */
.jig-marquee {
    overflow: hidden;
}

.jig-marquee-track {
    display: flex;
    gap: var(--jig-gap);
    width: max-content;
    animation: jig-scroll-left var(--jig-animation-speed) linear infinite;
}

.jig-marquee[data-direction="right"] .jig-marquee-track {
    animation-name: jig-scroll-right;
}

.jig-marquee[data-pause="1"]:hover .jig-marquee-track {
    animation-play-state: paused;
}

.jig-marquee .jig-item {
    flex: 0 0 280px;
}

@keyframes jig-scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes jig-scroll-right {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Multi-Row Marquee */
.jig-marquee-multi {
    display: flex;
    flex-direction: column;
    gap: var(--jig-gap);
    overflow: hidden;
}

.jig-marquee-row {
    overflow: hidden;
}

.jig-marquee-row .jig-marquee-track {
    display: flex;
    gap: var(--jig-gap);
    width: max-content;
    animation: jig-scroll-left var(--jig-animation-speed) linear infinite;
}

.jig-marquee-row[data-direction="right"] .jig-marquee-track {
    animation-name: jig-scroll-right;
}

.jig-marquee-multi[data-pause="1"]:hover .jig-marquee-track {
    animation-play-state: paused;
}

.jig-marquee-row .jig-item {
    flex: 0 0 280px;
}

@media (max-width: 767px) {
    .jig-marquee .jig-item,
    .jig-marquee-row .jig-item {
        flex: 0 0 200px;
    }
}

/* ============================================
   HIGHLIGHT LAYOUT
   ============================================ */
.jig-highlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--jig-gap);
}

.jig-highlight-featured {
    grid-row: span 2;
}

.jig-highlight-featured .jig-item {
    height: 100%;
}

.jig-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--jig-gap);
}

@media (max-width: 767px) {
    .jig-highlight {
        grid-template-columns: 1fr;
    }
    .jig-highlight-featured {
        grid-row: auto;
    }
}

/* ============================================
   CLASSIC FEED LAYOUT
   ============================================ */
.jig-classic-feed {
    max-width: 600px;
    margin: 0 auto;
}

.jig-feed-post {
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.jig-post-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
}

.jig-post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.jig-post-meta {
    flex: 1;
}

.jig-post-username {
    font-weight: 600;
    font-size: 14px;
    color: #262626;
    text-decoration: none;
    display: block;
}

.jig-post-date {
    font-size: 12px;
    color: #8e8e8e;
}

.jig-post-more {
    color: #262626;
}

.jig-post-more svg {
    width: 24px;
    height: 24px;
}

.jig-post-media {
    position: relative;
    background: #fafafa;
}

.jig-post-media img,
.jig-post-media video {
    width: 100%;
    display: block;
}

.jig-post-footer {
    padding: 12px 16px;
}

.jig-post-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.jig-post-likes,
.jig-post-comments {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #262626;
}

.jig-post-likes svg,
.jig-post-comments svg {
    width: 20px;
    height: 20px;
}

.jig-post-caption {
    font-size: 14px;
    line-height: 1.5;
    color: #262626;
}

.jig-post-caption strong {
    margin-right: 5px;
}

/* ============================================
   CARDS LAYOUT
   ============================================ */
.jig-cards {
    display: grid;
    grid-template-columns: repeat(var(--jig-columns), 1fr);
    gap: var(--jig-gap);
}

.jig-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.jig-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.jig-card-media {
    position: relative;
    aspect-ratio: var(--jig-aspect);
}

.jig-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jig-card-content {
    padding: 15px;
}

.jig-card-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.jig-card-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.jig-card-stats svg {
    width: 16px;
    height: 16px;
}

.jig-card-caption {
    font-size: 14px;
    color: #262626;
    line-height: 1.4;
    margin: 0 0 8px;
}

.jig-card-date {
    font-size: 12px;
    color: #8e8e8e;
}

@media (max-width: 1024px) {
    .jig-cards { grid-template-columns: repeat(var(--jig-columns-tablet), 1fr); }
}

@media (max-width: 767px) {
    .jig-cards { grid-template-columns: repeat(var(--jig-columns-mobile), 1fr); }
}

/* ============================================
   WAVE LAYOUT
   ============================================ */
.jig-wave {
    display: grid;
    grid-template-columns: repeat(var(--jig-columns), 1fr);
    gap: var(--jig-gap);
}

.jig-wave-item {
    transform: translateY(var(--wave-offset, 0));
}

@media (max-width: 1024px) {
    .jig-wave { grid-template-columns: repeat(var(--jig-columns-tablet), 1fr); }
}

@media (max-width: 767px) {
    .jig-wave { grid-template-columns: repeat(var(--jig-columns-mobile), 1fr); }
}

/* ============================================
   ITEM STYLES
   ============================================ */
.jig-item {
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
}

.jig-fixed-aspect {
    aspect-ratio: var(--jig-aspect);
}

.jig-item-media {
    width: 100%;
    height: 100%;
}

.jig-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
}

/* Type Icons */
.jig-type-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    color: var(--jig-icon-color);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
    z-index: 5;
    pointer-events: none;
}

.jig-type-icon svg {
    width: 100%;
    height: 100%;
}

/* Overlay */
.jig-item-overlay {
    position: absolute;
    inset: 0;
    background: var(--jig-overlay-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--jig-overlay-text);
    padding: 15px;
    text-align: center;
}

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

.jig-item-stats {
    display: flex;
    gap: 20px;
}

.jig-stat-likes,
.jig-stat-comments {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
}

.jig-stat-likes svg,
.jig-stat-comments svg {
    width: 20px;
    height: 20px;
}

.jig-item-caption {
    font-size: 13px;
    line-height: 1.4;
    max-height: 60px;
    overflow: hidden;
    margin: 0;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.jig-hover-zoom:hover .jig-item-media img { transform: scale(1.1); }
.jig-hover-zoom-out .jig-item-media img { transform: scale(1.1); }
.jig-hover-zoom-out:hover .jig-item-media img { transform: scale(1); }
.jig-hover-brighten:hover .jig-item-media img { filter: brightness(1.2); }
.jig-hover-darken:hover .jig-item-media img { filter: brightness(0.7); }
.jig-hover-grayscale .jig-item-media img { filter: grayscale(100%); }
.jig-hover-grayscale:hover .jig-item-media img { filter: grayscale(0); }
.jig-hover-color-grayscale:hover .jig-item-media img { filter: grayscale(100%); }
.jig-hover-blur:hover .jig-item-media img { filter: blur(4px); }
.jig-hover-rotate:hover .jig-item-media img { transform: scale(1.1) rotate(3deg); }

/* Shine Effect */
.jig-hover-shine .jig-item-media::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}
.jig-hover-shine:hover .jig-item-media::after {
    left: 100%;
}

/* Overlay Slide */
.jig-hover-overlay-slide .jig-item-overlay {
    transform: translateY(100%);
    opacity: 1;
    transition: transform 0.4s ease;
}
.jig-hover-overlay-slide:hover .jig-item-overlay {
    transform: translateY(0);
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */
.jig-entrance-fade-up .jig-item {
    opacity: 0;
    transform: translateY(30px);
    animation: jig-fade-up 0.6s ease forwards;
}

.jig-entrance-fade-in .jig-item {
    opacity: 0;
    animation: jig-fade-in 0.6s ease forwards;
}

.jig-entrance-zoom-in .jig-item {
    opacity: 0;
    transform: scale(0.8);
    animation: jig-zoom-in 0.6s ease forwards;
}

.jig-entrance-slide-up .jig-item {
    transform: translateY(50px);
    animation: jig-slide-up 0.5s ease forwards;
}

/* Stagger animations */
.jig-item:nth-child(1) { animation-delay: 0.05s; }
.jig-item:nth-child(2) { animation-delay: 0.1s; }
.jig-item:nth-child(3) { animation-delay: 0.15s; }
.jig-item:nth-child(4) { animation-delay: 0.2s; }
.jig-item:nth-child(5) { animation-delay: 0.25s; }
.jig-item:nth-child(6) { animation-delay: 0.3s; }
.jig-item:nth-child(7) { animation-delay: 0.35s; }
.jig-item:nth-child(8) { animation-delay: 0.4s; }
.jig-item:nth-child(9) { animation-delay: 0.45s; }
.jig-item:nth-child(10) { animation-delay: 0.5s; }
.jig-item:nth-child(11) { animation-delay: 0.55s; }
.jig-item:nth-child(12) { animation-delay: 0.6s; }

@keyframes jig-fade-up {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes jig-fade-in {
    to { opacity: 1; }
}

@keyframes jig-zoom-in {
    to { opacity: 1; transform: scale(1); }
}

@keyframes jig-slide-up {
    to { transform: translateY(0); }
}

/* Disable entrance for marquee */
.jig-layout-marquee .jig-item,
.jig-layout-marquee-multi .jig-item {
    opacity: 1;
    transform: none;
    animation: none;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.jig-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.jig-lightbox.active {
    display: flex;
}

.jig-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s;
    line-height: 1;
}

.jig-lightbox-close:hover {
    transform: rotate(90deg);
}

.jig-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jig-lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.jig-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.jig-lightbox-prev { left: 20px; }
.jig-lightbox-next { right: 20px; }

.jig-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.jig-lightbox-media {
    max-width: 100%;
    max-height: 70vh;
}

.jig-lightbox-media img,
.jig-lightbox-media video {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.jig-lightbox-info {
    color: #fff;
    text-align: center;
    padding: 20px;
    max-width: 600px;
}

.jig-lightbox-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.jig-lightbox-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.jig-lightbox-stats svg {
    width: 18px;
    height: 18px;
}

.jig-lightbox-caption {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 15px;
    color: rgba(255, 255, 255, 0.9);
}

.jig-lightbox-link {
    color: var(--jig-primary);
    font-size: 13px;
}

.jig-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* ============================================
   LOAD MORE BUTTON
   ============================================ */
.jig-load-more-wrap {
    text-align: center;
    margin-top: 30px;
}

.jig-load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    background: var(--jig-button-bg, var(--jig-gradient));
    color: var(--jig-button-color, #fff);
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.jig-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(225, 48, 108, 0.4);
}

.jig-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.jig-load-more-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: jig-spin 0.8s linear infinite;
}

.jig-load-more.loading .jig-load-more-text { display: none; }
.jig-load-more.loading .jig-load-more-spinner { display: block; }

@keyframes jig-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RTL SUPPORT
   ============================================ */
[dir="rtl"] .jig-carousel-prev { left: auto; right: 0; }
[dir="rtl"] .jig-carousel-next { right: auto; left: 0; }
[dir="rtl"] .jig-lightbox-prev { left: auto; right: 20px; }
[dir="rtl"] .jig-lightbox-next { right: auto; left: 20px; }
[dir="rtl"] .jig-type-icon { right: auto; left: 12px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .jig-header {
        flex-direction: column;
        text-align: center;
    }
    
    .jig-header-left {
        flex-direction: column;
    }
    
    .jig-header-right {
        flex-direction: column;
    }
    
    .jig-lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .jig-lightbox-prev { left: 10px; }
    .jig-lightbox-next { right: 10px; }
}

/* ============================================
   ENHANCED MOBILE STYLES
   ============================================ */

/* Mobile: Always show overlay option */
.jig-feed[data-mobile-overlay="1"] .jig-item-overlay {
    opacity: 1;
}

@media (hover: none) and (pointer: coarse) {
    .jig-feed[data-mobile-overlay="1"] .jig-item-overlay {
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    }
}

/* Mobile: Disable animations option */
.jig-feed[data-mobile-reduce-motion="1"] .jig-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .jig-item, .jig-marquee-track {
        animation: none !important;
    }
}

/* Mobile touch - pause marquee on touch */
@media (hover: none) and (pointer: coarse) {
    .jig-marquee[data-pause-touch="1"]:active .jig-marquee-track,
    .jig-marquee-multi[data-pause-touch="1"]:active .jig-marquee-track {
        animation-play-state: paused;
    }
}

/* Mobile: Better touch scrolling for horizontal */
.jig-horizontal {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.jig-horizontal .jig-item {
    scroll-snap-align: start;
}

/* Mobile: Smaller gaps on small screens */
@media (max-width: 480px) {
    .jig-feed {
        --jig-gap: 8px;
    }
    
    .jig-item-overlay {
        padding: 10px;
    }
    
    .jig-type-icon {
        width: 20px;
        height: 20px;
        top: 8px;
        right: 8px;
    }
    
    .jig-load-more {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* ============================================
   ENHANCED MARQUEE - ALTERNATE DIRECTIONS
   ============================================ */
.jig-marquee-multi[data-alternate="1"] .jig-marquee-row:nth-child(even) .jig-marquee-track {
    animation-name: jig-scroll-right;
}

.jig-marquee-multi[data-alternate="1"] .jig-marquee-row:nth-child(odd) .jig-marquee-track {
    animation-name: jig-scroll-left;
}

/* Different speed variations for rows */
.jig-marquee-multi .jig-marquee-row:nth-child(2) .jig-marquee-track {
    animation-duration: calc(var(--jig-animation-speed) * 1.2);
}

.jig-marquee-multi .jig-marquee-row:nth-child(3) .jig-marquee-track {
    animation-duration: calc(var(--jig-animation-speed) * 0.85);
}

.jig-marquee-multi .jig-marquee-row:nth-child(4) .jig-marquee-track {
    animation-duration: calc(var(--jig-animation-speed) * 1.1);
}

/* ============================================
   ENHANCED CAROUSEL
   ============================================ */
.jig-carousel[data-autoplay="1"] .jig-carousel-track {
    animation: jig-carousel-scroll var(--jig-carousel-speed, 3000ms) ease-in-out infinite;
}

.jig-carousel[data-center-mode="1"] .jig-carousel-item {
    transform: scale(0.85);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.jig-carousel[data-center-mode="1"] .jig-carousel-item.active {
    transform: scale(1);
    opacity: 1;
}

/* Hide arrows on mobile by default */
@media (max-width: 767px) {
    .jig-carousel-nav {
        display: none;
    }
    
    .jig-carousel[data-arrows-mobile="1"] .jig-carousel-nav {
        display: flex;
        width: 36px;
        height: 36px;
    }
}

/* Swipe indicator for carousel on mobile */
@media (hover: none) and (pointer: coarse) {
    .jig-carousel::after {
        content: '';
        position: absolute;
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.3);
        border-radius: 2px;
        animation: jig-swipe-hint 2s ease-in-out infinite;
    }
    
    @keyframes jig-swipe-hint {
        0%, 100% { transform: translateX(-50%); opacity: 0.3; }
        50% { transform: translateX(-30px); opacity: 0.8; }
    }
}

/* ============================================
   ENHANCED HOVER EFFECTS
   ============================================ */
.jig-item[data-hover="tilt"]:hover img {
    transform: perspective(1000px) rotateY(5deg) rotateX(2deg);
}

.jig-item[data-hover="shine"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    z-index: 2;
    pointer-events: none;
    transition: left 0.5s ease;
}

.jig-item[data-hover="shine"]:hover::before {
    left: 100%;
}

/* ============================================
   OVERLAY ANIMATIONS
   ============================================ */
.jig-item[data-overlay-anim="slide-up"] .jig-item-overlay {
    transform: translateY(100%);
    opacity: 1;
}

.jig-item[data-overlay-anim="slide-up"]:hover .jig-item-overlay {
    transform: translateY(0);
}

.jig-item[data-overlay-anim="slide-down"] .jig-item-overlay {
    transform: translateY(-100%);
    opacity: 1;
}

.jig-item[data-overlay-anim="slide-down"]:hover .jig-item-overlay {
    transform: translateY(0);
}

.jig-item[data-overlay-anim="scale"] .jig-item-overlay {
    transform: scale(0);
    opacity: 1;
}

.jig-item[data-overlay-anim="scale"]:hover .jig-item-overlay {
    transform: scale(1);
}

.jig-item[data-overlay-anim="flip"] {
    perspective: 1000px;
}

.jig-item[data-overlay-anim="flip"] .jig-item-overlay {
    transform: rotateY(90deg);
    opacity: 1;
}

.jig-item[data-overlay-anim="flip"]:hover .jig-item-overlay {
    transform: rotateY(0);
}

/* ============================================
   TABLET RESPONSIVE
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .jig-feed {
        --jig-columns: var(--jig-columns-tablet, 3);
    }
    
    .jig-marquee .jig-item,
    .jig-marquee-row .jig-item {
        flex: 0 0 240px;
    }
    
    .jig-header {
        padding: 15px;
    }
    
    .jig-avatar {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .jig-lightbox,
    .jig-load-more-wrap,
    .jig-carousel-nav,
    .jig-carousel-dots {
        display: none !important;
    }
    
    .jig-marquee-track {
        animation: none !important;
    }
    
    .jig-item-overlay {
        display: none !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.jig-item:focus-visible {
    outline: 3px solid var(--jig-primary);
    outline-offset: 2px;
}

.jig-load-more:focus-visible,
.jig-carousel-nav:focus-visible,
.jig-lightbox-nav:focus-visible {
    outline: 3px solid var(--jig-primary);
    outline-offset: 2px;
}

/* Screen reader only */
.jig-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   MARQUEE DRAG SCROLLING
   ============================================ */
.jig-marquee,
.jig-marquee-row {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.jig-marquee.jig-dragging,
.jig-marquee-row.jig-dragging {
    cursor: grabbing;
}

.jig-marquee.jig-dragging .jig-marquee-track,
.jig-marquee-row.jig-dragging .jig-marquee-track {
    animation-play-state: paused !important;
}

/* Smooth transition when resuming */
.jig-marquee-track {
    will-change: transform;
}

/* Disable pointer events on items while dragging for smoother experience */
.jig-dragging .jig-item {
    pointer-events: none;
}

/* Visual feedback on drag */
.jig-marquee.jig-dragging .jig-item,
.jig-marquee-row.jig-dragging .jig-item {
    transform: scale(0.98);
    transition: transform 0.15s ease;
}
