/**
 * Elkeron Notifiche - Stili per l'area Pubblica (Frontend)
 * Version: 1.9.0
 */

#elkeron-notifiche-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* --- Selettore di Layout --- */
.en-layout-switcher {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 8px;
}

.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: background-color 0.2s ease, color 0.2s ease;
}

.en-layout-switcher button:hover {
    background-color: #e4e6e9;
}

.en-layout-switcher button.active {
    background-color: #007cba;
    color: #ffffff;
    border-color: #007cba;
}

/* --- Contenitore Lista Notifiche --- */
.en-notifiche-lista {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr; /* Default: layout a lista */
}

/* --- Layout a Griglia --- */
.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;
    }
}


/* --- Stili Card Notifica --- */
.en-notification-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.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; /* Spazio per l'icona del link */
}

.en-notification-text {
    font-size: 16px;
    color: #65676b;
    margin: 0;
    line-height: 1.6;
    flex-grow: 1;
    transition: max-height 500ms cubic-bezier(0.4, 0, 0.2, 1);
    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;
}

/* === Footer della Card === */
.en-notification-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* Contenitore per le azioni a destra (permalink e data) */
.en-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.en-expand-button {
    background-color: #f0f2f5;
    border: 1px solid #ddd;
    color: #333;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 200ms ease, transform 300ms ease;
}
.en-expand-button:hover {
    background-color: #e4e6e9;
}
.en-expand-button svg {
    width: 20px;
    height: 20px;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}
.en-expand-button.is-expanded svg {
    transform: rotate(180deg);
}


.en-notification-date {
    font-size: 13px;
    color: #8a8d91;
    text-align: right;
}

/* === NUOVO: Stile Icona Permalink === */
.en-permalink-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #8a8d91;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background-color 200ms ease, color 200ms ease;
    position: relative;
}
.en-permalink-button:hover {
    background-color: #f0f2f5;
    color: #007cba;
}
.en-permalink-button svg {
    width: 18px;
    height: 18px;
}
.en-copy-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    z-index: 10;
}
.en-permalink-button.en-copied .en-copy-tooltip {
    opacity: 1;
    visibility: visible;
}


.en-notification-link-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    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 200ms ease, box-shadow 200ms ease;
}
.en-notification-link-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.en-notification-link-icon svg {
    width: 18px;
    height: 18px;
}

.en-no-results {
    text-align: center; color: #65676b;
    padding: 40px 20px; background-color: #f0f2f5;
    border-radius: 16px; grid-column: 1 / -1;
}

/* --- Loader & Pulsante Carica Altro --- */
.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; line-height: 50px;
    cursor: pointer; transition: all 200ms ease;
    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;
}

