/**
 * Wonder Flow Banner Styles
 */

/* Container base - hidden by default, shown via JS */
#wonderflow-banner-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    box-sizing: border-box;
    z-index: 999990;
    display: none;
    visibility: hidden;
}

#wonderflow-banner-container *,
#wonderflow-banner-container *::before,
#wonderflow-banner-container *::after {
    box-sizing: border-box;
}

/* ==================== POSITION: BOTTOM ==================== */

#wonderflow-banner-container.wonderflow-position-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out, visibility 0s linear 0.3s;
}

#wonderflow-banner-container.wonderflow-position-bottom.wonderflow-visible {
    transform: translateY(0);
    transition: transform 0.3s ease-out, visibility 0s linear 0s;
}

/* ==================== POSITION: LEFT SIDE ==================== */

#wonderflow-banner-container.wonderflow-position-left {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 0.4s;
}

#wonderflow-banner-container.wonderflow-position-left.wonderflow-visible {
    transform: translateY(-50%) translateX(0);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 0s;
}

/* ==================== POSITION: RIGHT SIDE ==================== */

#wonderflow-banner-container.wonderflow-position-right {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 0.4s;
}

#wonderflow-banner-container.wonderflow-position-right.wonderflow-visible {
    transform: translateY(-50%) translateX(0);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s linear 0s;
}

/* ==================== POSITION: SPOTLIGHT ==================== */

#wonderflow-banner-container.wonderflow-position-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    transition: background 0.4s ease, opacity 0.4s ease, visibility 0s linear 0.4s;
}

#wonderflow-banner-container.wonderflow-position-spotlight.wonderflow-visible {
    background: rgba(0, 0, 0, 0.85);
    opacity: 1;
    transition: background 0.4s ease, opacity 0.4s ease, visibility 0s linear 0s;
}

/* ==================== BANNER BASE - BOTTOM ==================== */

.wonderflow-banner {
    background: #ffffff;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* ==================== CLOSE BUTTON ==================== */

.wonderflow-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    padding: 0;
}

.wonderflow-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
    transform: scale(1.1);
}

/* ==================== LABEL ==================== */

.wonderflow-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 12px 15px 0;
}

/* ==================== LINK ==================== */

.wonderflow-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.wonderflow-link:hover {
    text-decoration: none;
}

/* ==================== BOTTOM: COMPACT ==================== */

.wonderflow-compact {
    padding: 12px 50px 12px 15px;
}

.wonderflow-compact .wonderflow-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wonderflow-compact .wonderflow-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.wonderflow-compact .wonderflow-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.wonderflow-compact .wonderflow-link:hover .wonderflow-title {
    color: #0066cc;
}

/* ==================== BOTTOM: STANDARD ==================== */

.wonderflow-standard {
    padding: 12px 15px 15px;
}

.wonderflow-standard .wonderflow-link {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.wonderflow-standard .wonderflow-image {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.wonderflow-standard .wonderflow-content {
    flex: 1;
    min-width: 0;
}

.wonderflow-standard .wonderflow-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
    line-height: 1.3;
}

.wonderflow-standard .wonderflow-link:hover .wonderflow-title {
    color: #0066cc;
}

.wonderflow-standard .wonderflow-excerpt {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ==================== BOTTOM: LARGE ==================== */

.wonderflow-large {
    padding: 12px 15px 20px;
}

.wonderflow-large .wonderflow-link {
    display: block;
    margin-top: 8px;
}

.wonderflow-large .wonderflow-image-large {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.wonderflow-large .wonderflow-content {
    padding: 0;
}

.wonderflow-large .wonderflow-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.3;
}

.wonderflow-large .wonderflow-link:hover .wonderflow-title {
    color: #0066cc;
}

.wonderflow-large .wonderflow-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.5;
}

.wonderflow-large .wonderflow-cta {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #0066cc;
}

.wonderflow-large .wonderflow-link:hover .wonderflow-cta {
    text-decoration: underline;
}

/* ==================== SIDE PANEL (Left/Right) ==================== */

.wonderflow-side {
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    position: relative;
    overflow: visible;
}

#wonderflow-banner-container.wonderflow-position-left .wonderflow-side {
    border-radius: 0 12px 12px 0;
}

#wonderflow-banner-container.wonderflow-position-right .wonderflow-side {
    border-radius: 12px 0 0 12px;
}

/* Close button - sull'immagine */
.wonderflow-side .wonderflow-close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 24px;
    height: 24px;
    font-size: 16px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.wonderflow-side .wonderflow-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Label - sull'immagine in overlay */
.wonderflow-side .wonderflow-label {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 15;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 3px;
    margin: 0 !important;
}

.wonderflow-side .wonderflow-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image wrapper - posizione relativa per label/close */
.wonderflow-side .wonderflow-image-wrap {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 12px 12px 0 0;
}

.wonderflow-side .wonderflow-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.wonderflow-side .wonderflow-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: #ffffff;
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
}

.wonderflow-side .wonderflow-title {
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    word-break: break-word;
    background: #fff;
}

.wonderflow-side .wonderflow-link:hover .wonderflow-title {
    color: #0066cc;
}

/* Side: Compact - SQUARE 1:1 */
.wonderflow-side.wonderflow-side-compact {
    width: 180px;
}

.wonderflow-side.wonderflow-side-compact .wonderflow-image-wrap {
    height: 120px;
}

.wonderflow-side.wonderflow-side-compact .wonderflow-title {
    font-size: 10px;
    padding: 8px;
}

/* Side: Standard - 4:5 MEDIUM */
.wonderflow-side.wonderflow-side-standard {
    width: 220px;
}

.wonderflow-side.wonderflow-side-standard .wonderflow-image-wrap {
    height: 175px;
}

.wonderflow-side.wonderflow-side-standard .wonderflow-title {
    font-size: 11px;
    padding: 10px;
}

/* Side: Large - 4:5 LARGE */
.wonderflow-side.wonderflow-side-large {
    width: 280px;
}

.wonderflow-side.wonderflow-side-large .wonderflow-image-wrap {
    height: 224px;
}

.wonderflow-side.wonderflow-side-large .wonderflow-title {
    font-size: 12px;
    padding: 12px;
}

/* Mobile */
@media (max-width: 480px) {
    .wonderflow-side.wonderflow-side-compact {
        width: 150px;
    }
    .wonderflow-side.wonderflow-side-compact .wonderflow-image-wrap {
        height: 100px;
    }
    .wonderflow-side.wonderflow-side-compact .wonderflow-title {
        font-size: 9px;
        padding: 6px;
    }

    .wonderflow-side.wonderflow-side-standard {
        width: 180px;
    }
    .wonderflow-side.wonderflow-side-standard .wonderflow-image-wrap {
        height: 144px;
    }
    .wonderflow-side.wonderflow-side-standard .wonderflow-title {
        font-size: 10px;
        padding: 8px;
    }

    .wonderflow-side.wonderflow-side-large {
        width: 220px;
    }
    .wonderflow-side.wonderflow-side-large .wonderflow-image-wrap {
        height: 176px;
    }
    .wonderflow-side.wonderflow-side-large .wonderflow-title {
        font-size: 11px;
        padding: 10px;
    }
}

/* ==================== SPOTLIGHT ==================== */

.wonderflow-spotlight {
    background: #ffffff;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    max-width: 400px;
    width: calc(100% - 40px);
    margin: 20px;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

#wonderflow-banner-container.wonderflow-position-spotlight.wonderflow-visible .wonderflow-spotlight {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.wonderflow-spotlight .wonderflow-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.08);
}

.wonderflow-spotlight .wonderflow-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

.wonderflow-spotlight .wonderflow-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.wonderflow-spotlight .wonderflow-content {
    padding: 20px;
}

.wonderflow-spotlight .wonderflow-label {
    padding: 0 0 8px 0;
    font-size: 11px;
    color: #888;
}

.wonderflow-spotlight .wonderflow-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.3;
}

.wonderflow-spotlight .wonderflow-link:hover .wonderflow-title {
    color: #0066cc;
}

.wonderflow-spotlight .wonderflow-excerpt {
    font-size: 15px;
    color: #555;
    margin: 0 0 16px;
    line-height: 1.5;
}

.wonderflow-spotlight .wonderflow-cta-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wonderflow-spotlight .wonderflow-link:hover .wonderflow-cta-button {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.4);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    /* Bottom bar responsive */
    .wonderflow-standard .wonderflow-link {
        flex-direction: column;
    }

    .wonderflow-standard .wonderflow-image {
        width: 100%;
        height: 120px;
    }

    .wonderflow-large .wonderflow-image-large {
        height: 150px;
    }

    .wonderflow-large .wonderflow-title {
        font-size: 16px;
    }

    /* Spotlight on mobile */
    .wonderflow-spotlight {
        max-width: none;
        width: calc(100% - 30px);
        margin: 15px;
        border-radius: 16px;
    }

    .wonderflow-spotlight::before {
        border-radius: 19px;
    }

    .wonderflow-spotlight::after {
        border-radius: 24px;
    }

    .wonderflow-spotlight .wonderflow-image {
        height: 160px;
    }

    .wonderflow-spotlight .wonderflow-content {
        padding: 16px;
    }

    .wonderflow-spotlight .wonderflow-title {
        font-size: 18px;
    }

    .wonderflow-spotlight .wonderflow-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* ==================== DARK MODE - FORCED ==================== */

#wonderflow-banner-container.wonderflow-dark .wonderflow-banner,
#wonderflow-banner-container.wonderflow-dark .wonderflow-side,
#wonderflow-banner-container.wonderflow-dark .wonderflow-spotlight {
    background: #1a1a1a;
}

#wonderflow-banner-container.wonderflow-dark .wonderflow-label {
    color: #888;
}

#wonderflow-banner-container.wonderflow-dark .wonderflow-compact .wonderflow-title,
#wonderflow-banner-container.wonderflow-dark .wonderflow-standard .wonderflow-title,
#wonderflow-banner-container.wonderflow-dark .wonderflow-large .wonderflow-title,
#wonderflow-banner-container.wonderflow-dark .wonderflow-side .wonderflow-title,
#wonderflow-banner-container.wonderflow-dark .wonderflow-spotlight .wonderflow-title {
    color: #f0f0f0;
    background: #1a1a1a;
}

#wonderflow-banner-container.wonderflow-dark .wonderflow-standard .wonderflow-excerpt,
#wonderflow-banner-container.wonderflow-dark .wonderflow-large .wonderflow-excerpt,
#wonderflow-banner-container.wonderflow-dark .wonderflow-side .wonderflow-excerpt,
#wonderflow-banner-container.wonderflow-dark .wonderflow-spotlight .wonderflow-excerpt {
    color: #aaa;
}

#wonderflow-banner-container.wonderflow-dark .wonderflow-close {
    background: rgba(255, 255, 255, 0.15);
    color: #bbb;
}

#wonderflow-banner-container.wonderflow-dark .wonderflow-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ==================== LIGHT MODE - FORCED ==================== */

#wonderflow-banner-container.wonderflow-light .wonderflow-banner,
#wonderflow-banner-container.wonderflow-light .wonderflow-side,
#wonderflow-banner-container.wonderflow-light .wonderflow-spotlight {
    background: #ffffff;
}

#wonderflow-banner-container.wonderflow-light .wonderflow-label {
    color: #888;
}

#wonderflow-banner-container.wonderflow-light .wonderflow-compact .wonderflow-title,
#wonderflow-banner-container.wonderflow-light .wonderflow-standard .wonderflow-title,
#wonderflow-banner-container.wonderflow-light .wonderflow-large .wonderflow-title,
#wonderflow-banner-container.wonderflow-light .wonderflow-side .wonderflow-title,
#wonderflow-banner-container.wonderflow-light .wonderflow-spotlight .wonderflow-title {
    color: #333;
    background: #ffffff;
}

#wonderflow-banner-container.wonderflow-light .wonderflow-standard .wonderflow-excerpt,
#wonderflow-banner-container.wonderflow-light .wonderflow-large .wonderflow-excerpt,
#wonderflow-banner-container.wonderflow-light .wonderflow-side .wonderflow-excerpt,
#wonderflow-banner-container.wonderflow-light .wonderflow-spotlight .wonderflow-excerpt {
    color: #666;
}

#wonderflow-banner-container.wonderflow-light .wonderflow-close {
    background: rgba(0, 0, 0, 0.08);
    color: #666;
}

#wonderflow-banner-container.wonderflow-light .wonderflow-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #333;
}

/* ==================== DARK MODE - AUTO (Media Query) ==================== */

@media (prefers-color-scheme: dark) {
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-banner,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-side,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-spotlight {
        background: #1a1a1a;
    }

    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-label {
        color: #888;
    }

    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-compact .wonderflow-title,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-standard .wonderflow-title,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-large .wonderflow-title,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-side .wonderflow-title,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-spotlight .wonderflow-title {
        color: #f0f0f0;
        background: #1a1a1a;
    }

    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-standard .wonderflow-excerpt,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-large .wonderflow-excerpt,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-side .wonderflow-excerpt,
    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-spotlight .wonderflow-excerpt {
        color: #aaa;
    }

    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-close {
        background: rgba(255, 255, 255, 0.15);
        color: #bbb;
    }

    #wonderflow-banner-container:not(.wonderflow-light):not(.wonderflow-dark) .wonderflow-close:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
}

/* ==================== STORIES BAR (Instagram-style) ==================== */

#wonderflow-stories-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    z-index: 99999;
    width: 100%;
    background: #ffffff;
    border: none;
    padding: 12px 0;
    min-height: 120px;
    contain: layout style;
}

#wonderflow-stories-container *,
#wonderflow-stories-container *::before,
#wonderflow-stories-container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==========================================================
   FIX GENERATEPRESS: quando stories è attivo, resetta
   entry-header che alcuni temi/child theme rendono fixed
   ========================================================== */
body:has(#wonderflow-stories-container) .entry-header,
body:has(#wonderflow-stories-container) header.entry-header {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
}

/* Integrated mode - inside header as child element */
#wonderflow-stories-container.wonderflow-integrated {
    /* Blocco indipendente - non partecipa al grid/flex del parent */
    display: block !important;
    position: relative !important;
    float: none !important;
    clear: both !important;
    /* Esci dal contesto grid di GeneratePress */
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    /* Dimensioni */
    width: 100% !important;
    max-width: 100% !important;
    min-height: 115px !important;
    /* Margini e padding */
    margin: 0 !important;
    padding: 12px 0 14px !important;
    /* Visibilità */
    visibility: visible !important;
    opacity: 1 !important;
    /* Sfondo solido - nessun bordo per evitare linee visibili */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    /* Stacking context isolato */
    isolation: isolate !important;
    contain: layout style !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

#wonderflow-stories-container.wonderflow-integrated.wonderflow-dark {
    /* Background gestito da JS con setProperty important */
    color: #ffffff !important;
    opacity: 1 !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

#wonderflow-stories-container.wonderflow-integrated.wonderflow-light {
    /* Background gestito da JS con setProperty important */
    color: #1a1a1a !important;
    opacity: 1 !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

/* Label inside integrated mode */
#wonderflow-stories-container.wonderflow-integrated .wonderflow-stories-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.85;
    padding: 0 16px 10px;
    margin: 0;
    display: block;
}

#wonderflow-stories-container.wonderflow-integrated.wonderflow-dark .wonderflow-stories-label {
    color: #ffffff;
}

#wonderflow-stories-container.wonderflow-integrated.wonderflow-light .wonderflow-stories-label {
    color: #262626;
}

#wonderflow-stories-container.wonderflow-integrated .wonderflow-stories-scroll {
    padding: 0 16px !important;
    gap: 10px !important;
    justify-content: flex-start;
}

/* Content spacer - previene CLS quando header diventa fixed */
#wonderflow-content-spacer {
    display: block;
    width: 100%;
    pointer-events: none;
}

/* Stories label */
.wonderflow-stories-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8e8e8e;
    padding: 0 16px 8px;
}

/* Stories scroll container */
.wonderflow-stories-scroll {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wonderflow-stories-scroll::-webkit-scrollbar {
    display: none;
}

/* Individual story item */
.wonderflow-story-item {
    flex: 0 0 auto;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wonderflow-story-item:hover {
    transform: scale(1.03);
}

/* Story ring - Instagram gradient */
#wonderflow-stories-container .wonderflow-story-ring {
    width: 74px;
    height: 74px;
    min-width: 74px;
    min-height: 74px;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important;
    padding: 3px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wonderflow-story-item:hover .wonderflow-story-ring {
    box-shadow: 0 4px 16px rgba(225, 48, 108, 0.35);
}

#wonderflow-stories-container .wonderflow-story-item.wonderflow-seen .wonderflow-story-ring {
    background: linear-gradient(45deg, #dbdbdb 0%, #c7c7c7 100%) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#wonderflow-stories-container .wonderflow-story-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50% !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 3px;
    overflow: hidden;
    box-sizing: border-box;
}

#wonderflow-stories-container .wonderflow-story-image {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
    min-height: 0;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    background-color: #f0f0f0;
    aspect-ratio: 1 / 1;
}

/* Placeholder with letter */
#wonderflow-stories-container .wonderflow-story-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Story title - 2 lines */
#wonderflow-stories-container .wonderflow-story-title {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: inherit !important;
    width: 100% !important;
    max-width: 90px !important;
    text-align: center !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    line-height: 1.35 !important;
    height: 2.7em !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: -0.1px !important;
    word-break: break-word !important;
}

/* Title colors based on theme */
#wonderflow-stories-container.wonderflow-light .wonderflow-story-title {
    color: #1a1a1a !important;
}

#wonderflow-stories-container.wonderflow-dark .wonderflow-story-title {
    color: #ffffff !important;
}

#wonderflow-stories-container .wonderflow-story-item.wonderflow-seen .wonderflow-story-title {
    color: #8e8e8e !important;
    font-weight: 400 !important;
}

/* Skeleton loading */
.wonderflow-story-item.wonderflow-skeleton .wonderflow-story-ring {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: wonderflow-shimmer 1.5s infinite;
}

.wonderflow-story-item.wonderflow-skeleton .wonderflow-story-title {
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: wonderflow-shimmer 1.5s infinite;
    border-radius: 4px;
    color: transparent;
}

@keyframes wonderflow-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Stories Dark Mode - background gestito da JS */
#wonderflow-stories-container.wonderflow-dark {
    border: none;
}

#wonderflow-stories-container.wonderflow-dark .wonderflow-stories-label {
    color: #8e8e8e;
}

#wonderflow-stories-container.wonderflow-dark .wonderflow-story-ring-inner {
    background: #1a1a1a !important;
}

#wonderflow-stories-container.wonderflow-dark .wonderflow-story-item.wonderflow-seen .wonderflow-story-ring {
    background: linear-gradient(45deg, #363636 0%, #2a2a2a 100%) !important;
}

/* Stories Light Mode - background gestito da JS */
#wonderflow-stories-container.wonderflow-light {
    border: none;
}

#wonderflow-stories-container.wonderflow-light .wonderflow-story-ring-inner {
    background: #ffffff !important;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    #wonderflow-stories-container {
        min-height: 105px;
        padding: 8px 0 10px;
    }

    #wonderflow-stories-container .wonderflow-stories-scroll {
        gap: 6px;
        padding: 0 10px;
        justify-content: flex-start;
    }

    #wonderflow-stories-container .wonderflow-story-item {
        width: 70px;
    }

    #wonderflow-stories-container .wonderflow-story-ring {
        width: 62px;
        height: 62px;
        min-width: 62px;
        min-height: 62px;
    }

    #wonderflow-stories-container .wonderflow-story-title {
        font-size: 11px !important;
        margin-top: 6px !important;
        max-width: 72px !important;
    }

    #wonderflow-stories-container .wonderflow-story-placeholder {
        font-size: 20px;
    }
}

/* Responsive - Desktop */
@media (min-width: 769px) {
    #wonderflow-stories-container .wonderflow-stories-scroll {
        justify-content: center;
        gap: 14px;
        padding: 0 20px;
    }

    #wonderflow-stories-container .wonderflow-story-item {
        width: 88px;
    }

    #wonderflow-stories-container .wonderflow-story-ring {
        width: 76px;
        height: 76px;
        min-width: 76px;
        min-height: 76px;
    }

    #wonderflow-stories-container .wonderflow-story-title {
        font-size: 13px !important;
        max-width: 95px !important;
    }

    #wonderflow-stories-container .wonderflow-story-placeholder {
        font-size: 26px;
    }
}
