/**
 * Elkeron Notifiche - Stili Frontend v3.6.0
 * Aggiornamento: Supporto Video Responsive (Embed & Locale), Deep Linking.
 */

#elkeron-notifiche-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Layout Switcher --- */
.en-layout-switcher { display: flex; justify-content: flex-end; margin-bottom: 20px; gap: 8px; }

@media (max-width: 576px) {
    .en-layout-switcher { display: none; }
}

.en-layout-switcher button {
    background-color: #f0f2f5; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    cursor: pointer; 
    padding: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #65676b; 
    transition: all 0.2s ease;
}

.en-layout-switcher button:hover { background-color: #e4e6e9; }
.en-layout-switcher button svg { width: 20px; height: 20px; }

.en-layout-switcher button.active {
    background-color: #fff8e1; 
    color: #d97706; 
    border-color: #f59e0b; 
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.15);
}

/* --- Lista & Griglia --- */
.en-notifiche-lista { display: grid; gap: 30px; grid-template-columns: 1fr; }
.en-notifiche-lista.layout-grid { grid-template-columns: repeat(3, 1fr); align-items: start; }
@media (max-width: 992px) { .en-notifiche-lista.layout-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .en-notifiche-lista.layout-grid { grid-template-columns: 1fr; } }

/* --- Card --- */
.en-notification-card {
    background-color: #ffffff; 
    border-radius: 16px; 
    box-shadow: none; 
    border: 1px solid #e0e0e0;
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box; 
}

.en-notification-card.is-expanded {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: transparent;
    transform: translateY(-2px);
    z-index: 2;
}

/* Evidenziazione Deep Link */
.en-notification-card.is-highlighted {
    animation: en-highlight-pulse 2s ease-in-out;
    border: 2px solid #007cba;
}

@keyframes en-highlight-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 124, 186, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 124, 186, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 124, 186, 0); }
}

.en-notification-card.en-has-restrictions {
    border: 2px solid #f59e0b !important;
    background-color: #fffdf8;
}

.en-notification-card.en-has-restrictions.is-expanded {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 0 10px rgba(245, 158, 11, 0.2);
}

.en-notifiche-lista.layout-grid .en-notification-card.is-expanded { grid-column: 1 / -1; }

.en-notification-image-container img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; display: block; background-color: #f0f2f5; }
.en-notification-content { padding: 20px 25px; display: flex; flex-direction: column; flex-grow: 1; }

.en-notification-title { font-size: 20px; font-weight: 600; margin: 0 0 10px 0; color: #1c1e21; padding-right: 40px; }

/* --- TESTO NOTIFICA --- */
.en-notification-text { font-size: 16px; color: #65676b; margin: 0; line-height: 1.6; flex-grow: 1; transition: max-height 500ms ease; overflow: hidden; }
.en-notification-text.is-collapsed { max-height: 48px; position: relative; }
.en-notification-text.is-collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 25px; background: linear-gradient(to top, white, rgba(255,255,255,0)); pointer-events: none; }
.en-notification-text.is-expanded { max-height: 1500px; }

.en-notification-text strong { font-weight: 700; color: #1c1e21; }
.en-notification-text em { font-style: italic; }
.en-notification-text a { color: #007cba; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.en-notification-text a:hover { color: #005a87; text-decoration: underline; }
.en-notification-text ul { padding-left: 20px !important; list-style-type: disc !important; margin: 10px 0; }
.en-notification-text li { margin-bottom: 4px; }
.en-notification-text h1, .en-notification-text h2, .en-notification-text h3 { margin-top: 15px; margin-bottom: 8px; line-height: 1.3; color: #1c1e21; }

/* --- VIDEO PLAYER (NEW) --- */
.en-video-wrapper {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    position: relative;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 16:9 Aspect Ratio (YouTube/Vimeo) */
.en-aspect-16-9 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}
.en-aspect-16-9 iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Auto Aspect Ratio (Local Video) */
.en-aspect-auto video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 80vh; /* Limita l'altezza su schermi grandi per video verticali */
}

/* --- Footer & Azioni --- */
.en-notification-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.en-footer-left { display: flex; align-items: center; gap: 10px; } 
.en-footer-actions { display: flex; align-items: center; gap: 12px; }

.en-expand-button {
    background-color: #f0f2f5; border: 1px solid #ddd; color: #333; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; transition: all 0.2s ease;
}
.en-expand-button:hover { background-color: #e4e6e9; }
.en-expand-button svg { width: 20px; height: 20px; transition: transform 0.3s; }
.en-expand-button.is-expanded svg { transform: rotate(180deg); }

/* Copy Link Testuale */
.en-copy-link-btn {
    background-color: transparent;
    border: 1px solid #ddd;
    color: #65676b;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: none; 
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.en-notification-card.is-expanded .en-copy-link-btn {
    display: inline-flex;
    animation: en-fade-in 0.3s forwards;
}

.en-copy-link-btn:hover {
    background-color: #e4e6e9;
    color: #007cba;
    border-color: #007cba;
}

.en-copy-link-btn.is-copied {
    background-color: #d7f7de;
    border-color: #2e7d32;
    color: #2e7d32;
}

@keyframes en-fade-in { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: translateX(0); } }

.en-notification-date { font-size: 13px; color: #8a8d91; }

/* --- BADGE GRUPPO --- */
.en-top-badges {
    position: absolute; top: 15px; right: 15px; z-index: 10; display: flex; align-items: center; gap: 8px;
}
.en-notification-link-icon {
    position: relative; background-color: #007cba; border: 2px solid #ffffff; color: #ffffff; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.15); transition: transform 0.2s; flex-shrink: 0;
}
.en-notification-link-icon:hover { transform: scale(1.1); }
.en-notification-link-icon svg { width: 18px; height: 18px; }

.en-live-countdown.badge-style {
    font-family: 'Courier New', Courier, monospace; font-weight: 700; font-size: 12px; background-color: rgba(255, 255, 255, 0.95); color: #d97706; border: 1px solid #ffffff; padding: 6px 12px; border-radius: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.15); backdrop-filter: blur(4px); white-space: nowrap;
}
.en-live-countdown.is-expired { background-color: rgba(220, 38, 38, 0.9); color: white; }

.en-restriction-indicator {
    display: flex; align-items: center; justify-content: center; color: #f59e0b; background-color: #fff8e1; width: 28px; height: 28px; border-radius: 50%;
}
.en-restriction-indicator svg { width: 16px; height: 16px; }

/* --- Loader & Utils --- */
.en-no-results { text-align: center; color: #65676b; padding: 40px 20px; background-color: #f0f2f5; border-radius: 16px; grid-column: 1 / -1; }
.en-loader { border: 5px solid #f3f3f3; border-top: 5px solid #007cba; border-radius: 50%; width: 50px; height: 50px; animation: en-spin 1s linear infinite; margin: 50px auto; }
@keyframes en-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.en-load-more-btn { display: flex; justify-content: center; align-items: center; width: 50px; height: 50px; margin: 30px auto 0; background-color: #007cba; color: white; border: none; border-radius: 50%; font-size: 32px; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 10px rgba(0, 124, 186, 0.3); grid-column: 1 / -1; }
.en-load-more-btn:hover { background-color: #005a87; transform: scale(1.05); }
.en-load-more-btn.is-loading { cursor: wait; background-color: #e9ecef; box-shadow: none; pointer-events: none; }
.en-load-more-btn.is-loading span { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(0,0,0,0.2); border-top-color: #65676b; border-radius: 50%; animation: en-spin 0.8s linear infinite; }

/* --- PALLINO NOTIFICHE --- */
.en-unread-dot {
    position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; background-color: #f59e0b; border: 2px solid #ffffff; border-radius: 50%; z-index: 10; box-shadow: 0 2px 4px rgba(0,0,0,0.2); animation: en-pulse-animation 2s infinite;
}
@keyframes en-pulse-animation {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}