/* Sus4Kids - Sezione Liste CSS */

/* Colori Premium */
:root {
    --premium-purple: #8B5CF6;
    --premium-purple-light: #A78BFA;
    --premium-purple-dark: #7C3AED;
}

/* Titoli sezione */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2C3E50;
}

/* Lista Redazione Card */
.lista-redazione-card {
    border: 2px solid var(--premium-purple);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.bg-premium {
    background: linear-gradient(135deg, var(--premium-purple) 0%, var(--premium-purple-dark) 100%);
    color: white;
}

.badge-premium {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.lista-emoji {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.lista-nome {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Griglia anteprima albi */
.albi-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.albo-preview-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.albo-preview-item:not(.locked):hover {
    transform: scale(1.05);
}

.albo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.albo-preview-item.locked {
    cursor: default;
}

.albo-preview-item img.blur {
    filter: blur(8px);
    opacity: 0.5;
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Premium Teaser */
.premium-teaser {
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    border-radius: 8px;
    padding: 1rem;
}

.btn-premium {
    background: linear-gradient(135deg, var(--premium-purple) 0%, var(--premium-purple-dark) 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    color: white;
}

/* Banner stato liste */
.liste-status-banner {
    background: #F3F4F6;
    border-left: 4px solid var(--premium-purple);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    font-size: 1rem;
    color: #4B5563;
}

/* Card liste */
.lista-card {
    border-radius: 12px;
    border: 2px solid #E5E7EB;
    cursor: pointer;
    transition: all 0.3s;
    height: 100%;
}

.lista-card:hover {
    border-color: var(--premium-purple);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
    transform: translateY(-4px);
}

.lista-card.create-new {
    border: 2px dashed #D1D5DB;
    background: #F9FAFB;
}

.lista-card.create-new:hover {
    border-color: var(--premium-purple);
    background: #F3F4F6;
}

.lista-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lista-card.disabled:hover {
    transform: none;
    border-color: #E5E7EB;
    box-shadow: none;
}

.create-icon {
    font-size: 3rem;
    color: var(--premium-purple);
}

.lista-count {
    color: #6B7280;
    font-size: 0.9rem;
}

/* Filtri categorie */
.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-filters .btn {
    border-radius: 20px;
    transition: all 0.2s;
}

.category-filters .btn.active {
    background-color: var(--premium-purple);
    border-color: var(--premium-purple);
    color: white;
}

/* Griglia albi catalogo */
.albi-grid {
    margin-top: 1rem;
}

.albo-item {
    transition: opacity 0.3s;
}

.albo-item.hidden {
    display: none;
}

.albo-card {
    position: relative;
}

.albo-image-wrapper {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.albo-image-wrapper img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    background: #f3f4f6;
    display: block;
}

.albo-card img:hover {
    transform: scale(1.05);
}

/* Fallback per immagini mancanti */
.albo-card img[src=""], 
.albo-card img:not([src]) {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

.albo-card img[src=""]:after,
.albo-card img:not([src]):after {
    content: '📚';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
}

.albo-title {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Bottone cuore */
.heart-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.heart-btn:hover {
    background: white;
    transform: scale(1.1);
}

.heart-btn i {
    font-size: 1.2rem;
    color: #EF4444;
}

.heart-btn.saved i {
    font-weight: 900;
}

.heart-btn.saved {
    background: #FEE2E2;
}

.albo-title {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    animation: fadeIn 0.3s;
}

.bottom-sheet.active {
    display: block;
}

.bottom-sheet-content {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}

.bottom-sheet-header h5 {
    margin: 0;
    font-weight: 600;
}

.bottom-sheet-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lista-option {
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lista-option:hover {
    border-color: var(--premium-purple);
    background: #F9FAFB;
}

.lista-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lista-option.disabled:hover {
    border-color: #E5E7EB;
    background: white;
}

.lista-option-emoji {
    font-size: 1.5rem;
}

.lista-option-text {
    flex: 1;
}

.lista-option-name {
    font-weight: 600;
    color: #1F2937;
}

.lista-option-count {
    font-size: 0.85rem;
    color: #6B7280;
}

.create-new-option {
    border-style: dashed;
    color: var(--premium-purple);
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Toast */
.toast {
    background: #1F2937;
    color: white;
    border-radius: 8px;
}

.toast-body {
    padding: 1rem 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .liste-status-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .albi-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .category-filters .btn {
        white-space: nowrap;
    }

    .bottom-sheet-content {
        max-height: 80vh;
    }
}

@media (max-width: 576px) {
    .albi-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .section-title {
        font-size: 1.25rem;
    }

    .lista-nome {
        font-size: 1.1rem;
    }
}
