/* Album fotografico privato */

/* === SCHERMATE DI AUTORIZZAZIONE === */
.screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.95), rgba(220, 20, 60, 0.95));
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-container, .error-container {
    text-align: center;
    color: white;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 235, 205, 0.95));
    padding: 3rem;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    margin: 0 1rem;
}

.heart-loader, .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.loading-container h2, .error-container h2 {
    color: #8b0000;
    margin-bottom: 1rem;
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
}

.loading-container p, .error-container p {
    color: #666;
    margin-bottom: 1rem;
}

.back-btn {
    display: inline-block;
    background: linear-gradient(135deg, #8b0000, #dc143c);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.4);
    text-decoration: none;
    color: white;
}

/* === SEZIONE FILTRI === */
.filter-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 235, 205, 0.9));
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(139, 0, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.filter-section h3 {
    font-family: 'Dancing Script', cursive;
    color: #8b0000;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.filter-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.8), rgba(255, 193, 7, 0.8));
    color: #8b0000;
    border: 2px solid rgba(255, 215, 0, 0.5);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* === GRIGLIA FOTO === */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.photo-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 220, 0.95));
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(139, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.photo-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    transition: transform 0.6s ease;
    transform: scale(0);
    z-index: 1;
}

.photo-card:hover::before {
    transform: scale(1);
}

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(139, 0, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.7);
}

.photo-thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 2;
}

.photo-card:hover .photo-thumbnail {
    transform: scale(1.05);
}

.photo-details {
    padding: 1.2rem;
    position: relative;
    z-index: 2;
}

.photo-title {
    font-family: 'Dancing Script', cursive;
    font-size: 1.3rem;
    font-weight: 600;
    color: #8b0000;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(255, 215, 0, 0.3);
}

.photo-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.photo-category {
    background: rgba(255, 215, 0, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 500;
    color: #8b0000;
}

.photo-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* === MODAL FOTO === */
.photo-modal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 15px;
    overflow: hidden;
}

.photo-viewer {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 70vh;
}

.photo-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.photo-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.photo-info {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 235, 205, 0.95));
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.photo-info h3 {
    font-family: 'Dancing Script', cursive;
    color: #8b0000;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.photo-info p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 215, 0, 0.8);
    color: #8b0000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover {
    background: #ffd700;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.photo-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 2rem;
    z-index: 11;
}

/* === ADMIN PANEL === */
.admin-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 235, 205, 0.9));
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(139, 0, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h2 {
    font-family: 'Dancing Script', cursive;
    color: #8b0000;
    font-size: 2rem;
}

.admin-photos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.admin-photo-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 1rem;
    border: 2px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
}

.admin-photo-item:hover {
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.2);
}

.admin-photo-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.admin-photo-info h4 {
    color: #8b0000;
    margin-bottom: 0.5rem;
    font-family: 'Dancing Script', cursive;
}

.admin-photo-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 15px;
}

/* === RESPONSIVE === */
@media screen and (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .filter-buttons {
        justify-content: center;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }

    .photo-viewer {
        flex-direction: column;
        min-height: auto;
    }

    .nav-btn {
        position: relative;
        margin: 0 1rem;
    }

    .prev-btn, .next-btn {
        left: auto;
        right: auto;
        top: auto;
        transform: none;
    }

    .admin-header {
        flex-direction: column;
        text-align: center;
    }

    .admin-photos-list {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .photos-grid {
        grid-template-columns: 1fr;
    }

    .photo-container {
        padding: 1rem;
    }

    .photo-info {
        padding: 1rem;
    }
}

/* === ANIMAZIONI === */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.photo-card {
    animation: fadeIn 0.5s ease forwards;
}

/* === LOADING === */
.loading {
    text-align: center;
    padding: 3rem;
    color: #8b0000;
}

.spinner {
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-left: 4px solid #ffd700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* === PROMPT PASSWORD === */
.password-container {
    text-align: center;
    color: white;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 235, 205, 0.95));
    padding: 3rem;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    margin: 0 1rem;
}

.password-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.password-container h2 {
    color: #8b0000;
    margin-bottom: 1rem;
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
}

.password-container p {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.password-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#albumPassword {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    min-width: 200px;
}

#albumPassword:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.password-btn {
    background: linear-gradient(135deg, #8b0000, #dc143c);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
    white-space: nowrap;
}

.password-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.4);
}

.password-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.password-error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    padding: 0.8rem;
    border-radius: 15px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive password form */
@media screen and (max-width: 480px) {
    .password-input-group {
        flex-direction: column;
    }

    #albumPassword {
        min-width: auto;
        margin-bottom: 0.5rem;
    }
}