/*
 * Socialissimo - Stili v11.0 (Final Optimized)
 * Design moderno e ottimizzato
 */

:root {
    --socialissimo-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Card base - rettangolare orizzontale */
.socialissimo-card {
    font-family: var(--socialissimo-font);
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin: 1em 0;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

/* Header con avatar - più compatto */
.socialissimo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* Avatar circolare - più piccolo */
.socialissimo-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--avatar-bg, #2AABEE);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.socialissimo-avatar svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.socialissimo-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Info canale */
.socialissimo-info {
    flex: 1;
    min-width: 0;
}

.socialissimo-name {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
}

/* Messaggio - font più piccolo */
.socialissimo-content {
    margin-bottom: 12px;
}

.socialissimo-message {
    margin: 0;
    font-size: 0.85em;
    line-height: 1.4;
    color: #5a5a5a;
}

/* Bottone CTA - stile social moderno */
.socialissimo-cta {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--button-bg, #2AABEE);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    box-sizing: border-box;
}

/* Rimuovi effetto hover che sposta il contenuto */
.socialissimo-cta:hover {
    opacity: 0.85;
}

.socialissimo-cta:active {
    opacity: 0.75;
}

/* Colori per piattaforma */
.socialissimo-card--telegram {
    --avatar-bg: #2AABEE;
    --button-bg: #2AABEE;
}

.socialissimo-card--whatsapp {
    --avatar-bg: #25D366;
    --button-bg: #25D366;
}

.socialissimo-card--instagram {
    --avatar-bg: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF);
    --button-bg: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF);
}

.socialissimo-card--facebook {
    --avatar-bg: #1877F2;
    --button-bg: #1877F2;
}

.socialissimo-card--x,
.socialissimo-card--twitter {
    --avatar-bg: #000000;
    --button-bg: #000000;
}

.socialissimo-card--youtube {
    --avatar-bg: #FF0000;
    --button-bg: #FF0000;
}

.socialissimo-card--linkedin {
    --avatar-bg: #0A66C2;
    --button-bg: #0A66C2;
}

.socialissimo-card--tiktok {
    --avatar-bg: #000000;
    --button-bg: #000000;
}

.socialissimo-card--discord {
    --avatar-bg: #5865F2;
    --button-bg: #5865F2;
}

.socialissimo-card--pinterest {
    --avatar-bg: #E60023;
    --button-bg: #E60023;
}

.socialissimo-card--reddit {
    --avatar-bg: #FF4500;
    --button-bg: #FF4500;
}

.socialissimo-card--snapchat {
    --avatar-bg: #FFFC00;
    --button-bg: #FFFC00;
}

.socialissimo-card--snapchat .socialissimo-cta {
    color: #000000;
}

.socialissimo-card--twitch {
    --avatar-bg: #9146FF;
    --button-bg: #9146FF;
}

.socialissimo-card--threads {
    --avatar-bg: #000000;
    --button-bg: #000000;
}

.socialissimo-card--google-news {
    --avatar-bg: #4285F4;
    --button-bg: #4285F4;
}

.socialissimo-card--link {
    --avatar-bg: var(--brand-color-main, #6366F1);
    --button-bg: var(--brand-color-main, #6366F1);
}

/* Override colori custom */
.socialissimo-card[style*="--brand-color-main"] {
    --avatar-bg: var(--brand-color-main);
    --button-bg: var(--brand-color-main);
}

/* Desktop: layout orizzontale compatto */
@media (min-width: 600px) {
    .socialissimo-card {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 12px 16px;
    }
    
    .socialissimo-header {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .socialissimo-content {
        flex: 1;
        margin-bottom: 0;
    }
    
    .socialissimo-cta {
        width: auto;
        padding: 8px 20px;
        flex-shrink: 0;
    }
}

/* Dark mode solo su esplicita richiesta */
body.dark-mode .socialissimo-card,
body.dark-theme .socialissimo-card,
body.nightmode .socialissimo-card {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .socialissimo-name,
body.dark-theme .socialissimo-name,
body.nightmode .socialissimo-name {
    color: #f0f0f0;
}

body.dark-mode .socialissimo-message,
body.dark-theme .socialissimo-message,
body.nightmode .socialissimo-message {
    color: #b0b0b0;
}

/* Reset per compatibilità */
.socialissimo-card * {
    box-sizing: border-box;
}

.socialissimo-card p,
.socialissimo-card h4 {
    padding: 0;
    border: 0;
    background: none;
}

/* ===============================================
   EFFETTI ATTENTION GRABBER (Opzionali)
   =============================================== */

/* 1. Rainbow Border - Fix con soluzione cross-browser */
.socialissimo-card.effect-rainbow {
    position: relative;
    border: 2px solid transparent;
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-image: 
        linear-gradient(#f8f9fa, #f8f9fa),
        linear-gradient(90deg, 
            #ff0000, #ff7f00, #ffff00, #00ff00, 
            #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 100% 100%, 200% 100%;
    animation: rainbow-move 3s linear infinite;
}

@keyframes rainbow-move {
    0% { background-position: 0 0, 0% 50%; }
    100% { background-position: 0 0, 200% 50%; }
}

/* 2. Glow Pulse - Più visibile */
.socialissimo-card.effect-glow {
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--brand-rgb, 42, 171, 238), 0),
                    0 1px 3px rgba(0, 0, 0, 0.06);
    }
    50% {
        box-shadow: 0 0 30px 5px rgba(var(--brand-rgb, 42, 171, 238), 0.5),
                    0 1px 3px rgba(0, 0, 0, 0.06);
    }
}

/* 3. Shimmer - NON TOCCARE */
.socialissimo-card.effect-shimmer {
    position: relative;
    overflow: hidden;
}

.socialissimo-card.effect-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.7) 50%,
        transparent 60%
    );
    animation: shimmer-slide 3s infinite;
    pointer-events: none;
}

@keyframes shimmer-slide {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* 4. Gradient Shift - OK */
.socialissimo-card.effect-gradient {
    background: linear-gradient(90deg, 
        #f8f9fa, #e8f4fd, #f0f8ff, #f8f9fa);
    background-size: 300% 100%;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 5. Neon Border - OK */
.socialissimo-card.effect-neon {
    border: 1px solid var(--avatar-bg, #2AABEE);
    animation: neon-flicker 2s ease-in-out infinite;
}

@keyframes neon-flicker {
    0%, 100% {
        box-shadow: 
            0 0 2px rgba(var(--brand-rgb, 42, 171, 238), 0.5),
            inset 0 0 2px rgba(var(--brand-rgb, 42, 171, 238), 0.2);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(var(--brand-rgb, 42, 171, 238), 0.8),
            inset 0 0 5px rgba(var(--brand-rgb, 42, 171, 238), 0.3);
    }
}

/* 6. Spark Fuse - Scintilla che corre sul bordo */
.socialissimo-card.effect-spark {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(var(--brand-rgb, 255, 100, 0), 0.2);
}

.socialissimo-card.effect-spark::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -100%;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent, 
        #ff6600, 
        #ffaa00, 
        #ffffff, 
        #ffaa00,
        #ff6600,
        transparent);
    border-radius: 2px;
    animation: spark-run 2.5s linear infinite;
    box-shadow: 0 0 10px #ff6600, 0 0 20px #ff6600;
}

.socialissimo-card.effect-spark::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -100%;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent, 
        #ff6600, 
        #ffaa00, 
        #ffffff, 
        #ffaa00,
        #ff6600,
        transparent);
    border-radius: 2px;
    animation: spark-run-reverse 2.5s linear infinite;
    animation-delay: 1.25s;
    box-shadow: 0 0 10px #ff6600, 0 0 20px #ff6600;
}

@keyframes spark-run {
    0% { left: -100px; }
    100% { left: calc(100% + 100px); }
}

@keyframes spark-run-reverse {
    0% { right: -100px; }
    100% { right: calc(100% + 100px); }
}