/**
 * @author Fabio Compagnoni
 * @version 1.0.1
 */

/*Stili dedicati alla parte delle recensioni*/
.contRec {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
}

/* Box Media Valutazione */
.media {
    background: linear-gradient(135deg, #19255C 0%, #0E1E37 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    color: white;
    min-width: 280px;
    box-shadow: 0 8px 24px rgba(25, 37, 92, 0.2);
    flex-direction: column;
}

.media #vMedia {
    font-size: 4rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.media #stelle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #FFD700;
}

.media p {
    margin: 0.5rem 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.media #nRec {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Container recensioni */
.rRec {
    flex: 1;
}
@media(max-width:978px){
    .rRec{
        width:100%;
    }
}

/* Form inserimento recensione */
#insertRec {
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

#insertRec:hover {
    border-color: #19255C;
    box-shadow: 0 4px 12px rgba(25, 37, 92, 0.1);
}

#insertRec h3 {
    color: var(--bs-body-color);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Stelle selezionabili */
#stelleVal {
    display: flex;
    gap: 0.5rem;
    font-size: 2rem;
    margin-top: 0.5rem;
}

#stelleVal i {
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

#stelleVal i:hover,
#stelleVal i.fa-solid {
    color: #FFD700;
    transform: scale(1.1);
}

#stelleVal i.fa-solid {
    animation: starPop 0.3s ease;
}

@keyframes starPop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Textarea recensione */
#testoRecIns {
    min-height: 120px;
    border-radius: 8px;
    border: 2px solid var(--bs-border-color);
    transition: border-color 0.3s ease;
}

#testoRecIns:focus {
    border-color: #19255C;
    box-shadow: 0 0 0 0.25rem rgba(25, 37, 92, 0.1);
}

/* Bottone invia recensione */
#btnMakeRecensione {
    background: linear-gradient(135deg, #19255C 0%, #0E1E37 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#btnMakeRecensione:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 37, 92, 0.3);
}

/* Elenco recensioni */
.elencoRecensioni {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Card singola recensione */
.recensione.card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bs-body-bg);
}

.recensione.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.recensione .card-body {
    padding: 1.5rem;
}

.recensione h6 {
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.recensione small {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

/* Stelle nelle recensioni */
.stelleRec {
    color: #FFD700;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* Testo recensione */
.testoRecensione {
    color: var(--bs-body-color);
    line-height: 1.6;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

/* Bottone elimina recensione */
.recensione .btn-outline-danger {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Alert messages */
.recensione .alert {
    border-radius: 8px;
    margin-bottom: 0;
}

/* Loading spinner */
.elencoRecensioni .spinner-border {
    color: #19255C;
}

/* Empty state migliorato */
.empty-reviews-state {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    margin: 2rem 0;
    margin-top:0;
    animation: fadeIn 0.6s ease-out;
}

.empty-reviews-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.empty-reviews-state h4 {
    color: #19255C;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-reviews-state p {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Empty rating nella media box */
.empty-rating {
    margin-top: 1rem;
}

.empty-rating .stars-placeholder {
    font-size: 2rem;
    color: rgba(255, 215, 0, 0.3);
    letter-spacing: 0.5rem;
}

/* Media box quando non ci sono recensioni */
.media.empty-state {
    background: linear-gradient(135deg, rgba(25, 37, 92, 0.1) 0%, rgba(14, 30, 55, 0.1) 100%);
    border: 2px dashed #19255C;
}

.media.empty-state #vMedia {
    background: none;
    -webkit-text-fill-color: inherit;
    color: #19255C;
    opacity: 0.6;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* Responsive */
@media (max-width: 992px) {
    .contRec {
        flex-direction: column;
    }

    .media {
        min-width: 100%;
    }

    #stelleVal {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .media #vMedia {
        font-size: 3rem;
    }

    #stelleVal {
        font-size: 1.5rem;
    }

    #insertRec {
        padding: 1rem;
    }

    .recensione .card-body {
        padding: 1rem;
    }
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .recensione.card {
        background: var(--bs-body-bg);
        border: 1px solid var(--bs-border-color);
    }

    #insertRec {
        background: var(--bs-body-bg);
    }

    #testoRecIns {
        background: var(--bs-body-bg);
        color: var(--bs-body-color);
    }
}

/* Animation utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recensione.card {
    animation: fadeInUp 0.4s ease-out;
}

.recensione.card:nth-child(1) { animation-delay: 0.1s; }
.recensione.card:nth-child(2) { animation-delay: 0.2s; }
.recensione.card:nth-child(3) { animation-delay: 0.3s; }
.recensione.card:nth-child(4) { animation-delay: 0.4s; }
.recensione.card:nth-child(5) { animation-delay: 0.5s; }