body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

.header {
    padding: 2rem 0;
    text-align: center;
    background: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.9) 100%);
}

.page-title {
    font-family: 'Righteous', cursive;
    font-size: 3rem;
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: transparent;
    border: 2px solid #ffff00;
    color: #ffff00;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #ffff00;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 0, 0.3);
}

.gallery-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 4rem;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255,255,0,0.05) 0%, rgba(0,0,0,0.1) 100%);
    padding: 2rem;
    border: 1px solid rgba(255,255,0,0.2);
}

.category-title {
    font-family: 'Righteous', cursive;
    font-size: 2rem;
    color: #ffff00;
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    border-bottom: 2px solid #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.category-stats {
    text-align: center;
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.empty-category {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    border: 2px dashed #333;
    border-radius: 10px;
    margin: 1rem 0;
}

.btn-outline-warning {
    border: 2px solid #ffc107;
    color: #ffc107;
    background-color: transparent;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

.category-filter {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 0, 0.3);
    margin-top: 1rem;
}

.category-filter .form-select {
    background-color: #222;
    border: 2px solid #ffc107;
    color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.category-filter .form-select:focus {
    border-color: #ffff00;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 0, 0.25);
    background-color: #333;
}

.category-filter .form-select option {
    background-color: #222;
    color: #fff;
}

.category-buttons .btn {
    background-color: #333;
    border: 1px solid #666;
    color: #fff;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.category-buttons .btn:hover {
    background-color: #555;
    border-color: #ffc107;
    color: #fff;
    transform: translateY(-1px);
}

.category-buttons .btn.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    font-weight: 600;
}

.category-buttons .btn-all {
    background-color: #ffff00;
    border-color: #ffff00;
    color: #000;
    font-weight: 600;
}

.category-buttons .btn-all:hover {
    background-color: #e6e600;
    border-color: #e6e600;
    color: #000;
    transform: translateY(-1px);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    border: 3px dashed #ffff00;
    background-color: #111;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 0, 0.3);
    border-style: solid;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-caption {
    padding: 0.8rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffff00;
    text-align: center;
    font-size: 0.9rem;
    position: absolute;
    bottom: 0;
    width: 100%;
    transition: all 0.3s ease;
    max-height: 40%;
    overflow-y: auto;
}

.image-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

/* Stile quando il titolo ha una descrizione sotto */
.image-title.has-description {
    margin-bottom: 0.3rem;
}

.image-description {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.3;
    margin-top: 0.3rem;
}

.gallery-item:hover .gallery-caption {
    background-color: #ffff00;
    color: #000;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Badge Novità */
.new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4444;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    font-size: 16px;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.2);
}

.favorite-btn.active:hover {
    background: rgba(255, 68, 68, 0.3);
}

/* Banner novità */
.news-banner {
    background: linear-gradient(45deg, #ff4444, #ff6666);
    border: 2px solid #ff2222;
    border-radius: 15px;
    padding: 15px 20px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.3);
    animation: glow 3s ease-in-out infinite alternate;
}

.news-banner h3 {
    color: #fff;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.news-banner .categories-list {
    text-align: center;
    font-size: 1.1rem;
}

.news-banner .category-link {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-banner .category-link:hover {
    color: #ffff00;
    text-shadow: 0 0 5px rgba(255, 255, 0, 0.7);
    transform: scale(1.05);
}

@keyframes glow {
    0% { box-shadow: 0 5px 20px rgba(255, 68, 68, 0.3); }
    100% { box-shadow: 0 5px 30px rgba(255, 68, 68, 0.6); }
}

/* Pulsante contattami fisso */
.contact-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    background: linear-gradient(45deg, #ffff00, #ffd700);
    border: 2px solid #ffaa00;
    color: #000;
    font-weight: bold;
    border-radius: 25px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(255, 255, 0, 0.3);
    transition: all 0.3s ease;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ffff00);
    color: #000;
}

/* Pulsante preferiti fisso */
.favorites-btn {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    background: linear-gradient(45deg, #ff4444, #ff6666);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
    transition: all 0.3s ease;
}

.favorites-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.5);
    background: linear-gradient(45deg, #ff6666, #ff4444);
    color: #fff;
}

/* Modal contatti personalizzato */
.contact-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1060;
    backdrop-filter: blur(5px);
}

.contact-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #111;
    border: 2px solid #ffff00;
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(255, 255, 0, 0.3);
}

.contact-modal h3 {
    color: #ffff00;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    color: #fff;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: block;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #222;
    color: #fff;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #ffff00;
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.3);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.contact-form button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-form .btn-send {
    background: linear-gradient(45deg, #ffff00, #ffd700);
    color: #000;
}

.contact-form .btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 0, 0.4);
}

.contact-form .btn-cancel {
    background: #666;
    color: #fff;
}

.contact-form .btn-cancel:hover {
    background: #777;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-question {
    color: #ffff00;
    font-weight: bold;
    font-size: 18px;
    background: #333;
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 120px;
    text-align: center;
}

.captcha-refresh {
    background: #555;
    border: none;
    color: #ffff00;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.captcha-refresh:hover {
    background: #666;
}

/* Modal preferiti */
.favorites-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.favorites-modal {
    background-color: #222;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #333;
    border-radius: 15px 15px 0 0;
}

.favorites-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
}

.favorites-close {
    background: #ff4444;
    border: none;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
}

.favorites-close:hover {
    background: #ff6666;
}

.favorites-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.favorites-item {
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
    position: relative;
}

.favorites-item:hover {
    transform: translateY(-5px);
}

.favorites-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.favorites-item-info {
    padding: 15px;
}

.favorites-item h4 {
    color: #fff;
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.favorites-item p {
    color: #ccc;
    margin: 0;
    font-size: 0.85rem;
}

.favorites-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 68, 68, 0.8);
    border: none;
    color: #fff;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
}

.favorites-remove:hover {
    background: rgba(255, 68, 68, 1);
}


.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(255, 255, 0, 0.2);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 3rem;
    color: #ffff00;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.close-lightbox:hover {
    color: #fff;
    transform: scale(1.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: #ffff00;
    cursor: pointer;
    padding: 1rem;
    user-select: none;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    color: #fff;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

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

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .gallery-item img {
        height: 200px;
    }

    .close-lightbox {
        top: 10px;
        right: 20px;
        font-size: 2rem;
    }

    .lightbox-nav {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(0, 0, 0, 0.7);
        border-radius: 50%;
        color: #ffff00;
        border: 2px solid #ffff00;
        z-index: 1002;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-nav:hover {
        background-color: #ffff00;
        color: #000;
        transform: scale(1.1);
    }

    .category-buttons {
        justify-content: center !important;
    }

    .category-buttons .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    /* Nascondi pulsante desktop su mobile */
    .back-to-top-desktop {
        display: none !important;
    }

    /* Mostra pulsante mobile */
    .back-to-top-mobile {
        display: block !important;
        margin-top: 8px;
        text-align: center;
    }

    .back-to-top-mobile .btn {
        font-size: 12px;
        padding: 4px 12px;
    }
}

/* Stili per pulsanti "Su" responsive - Desktop */
.back-to-top-desktop {
    display: block !important;
}

.back-to-top-mobile {
    display: none !important;
}

/* Stili per il filtro categoria - Desktop */
.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    margin-bottom: 0 !important;
    white-space: nowrap;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-controls select {
    width: auto;
    max-width: 300px;
}

/* Media query aggiuntivo per assicurare il funzionamento */
@media (max-width: 767px) {
    .back-to-top-desktop {
        display: none !important;
    }

    .back-to-top-mobile {
        display: block !important;
        margin-top: 8px;
        text-align: center;
    }

    /* Layout mobile per il filtro categoria */
    .filter-container {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .filter-label {
        text-align: center;
        margin-bottom: 0.5rem !important;
    }

    .filter-controls {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        align-items: center;
    }

    .filter-controls select {
        max-width: 250px;
        width: 100%;
    }

    .filter-controls button {
        width: auto;
    }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeInScale {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes fadeOutScale {
    from {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}
