/* Stili personalizzati per l'applicazione di analisi SEO */

body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.footer {
    background-color: #0d6efd;
    margin-top: 3rem;
    padding: 2rem 0;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
}

.footer h5 {
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

.footer .list-unstyled a {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.footer .list-unstyled a:hover {
    opacity: 1;
}

.footer .social-links {
    display: flex;
    gap: 1rem;
}

.footer hr {
    margin: 2rem 0;
    opacity: 0.2;
}

.footer .copyright {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
        background-color: #0d6efd !important;
    }

    .footer h5 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .footer p,
    .footer a {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .footer .col-md-4 {
        margin-bottom: 1.2rem;
    }

    .footer .col-md-4:last-child {
        margin-bottom: 0;
    }

    .footer .list-unstyled li {
        margin-bottom: 0.3rem;
    }

    .footer .social-links {
        gap: 0.8rem;
    }

    .footer .copyright {
        font-size: 0.8rem;
        padding-top: 1rem;
    }

    .footer hr {
        margin: 1rem 0;
    }
}

/* Stile per l'overlay di caricamento */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 20px;
}

/* Stile per le liste di intestazioni */
.max-height-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Stili per i punteggi e metriche */
.progress {
    height: 20px;
    margin-bottom: 10px;
}

.progress-bar {
    text-shadow: 0 0 2px #000;
}

/* Animazioni e transizioni */
.card {
    -webkit-transition: transform 0.3s, box-shadow 0.3s;
    -moz-transition: transform 0.3s, box-shadow 0.3s;
    -o-transition: transform 0.3s, box-shadow 0.3s;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    -o-transform: translateY(-5px);
    transform: translateY(-5px);
    -webkit-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Stili per i risultati dell'analisi */
.alert {
    border-radius: 8px;
}

.badge {
    font-weight: 500;
    padding: 6px 10px;
}

/* Stile per i risultati principali */
.display-1,
.display-2,
.display-3,
.display-4 {
    font-weight: 600 !important;
}

/* Stile per documenti stampabili */
@media print {

    .navbar,
    .footer,
    .btn {
        display: none !important;
    }

    body {
        background-color: white !important;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .card-header {
        background-color: #f8f9fa !important;
        color: #000 !important;
    }

    .progress {
        border: 1px solid #ddd;
    }

    .progress-bar {
        background-color: #6c757d !important;
        color: #fff !important;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }
}

/* Bottone Installazione WebApp - base */
#install-container {
    display: none;
    transition: all 0.3s ease;
}

/* Solo su dispositivi mobili */
@media (max-width: 768px) {
    #install-container.active {
        display: block !important;
        margin-bottom: 1rem !important;
    }
}

#install-button {
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 30px;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #ffffff;
    border: none;
    transition: all 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#install-button:hover {
    background: linear-gradient(135deg, #6610f2, #0d6efd);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

#install-button:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.5);
}

/* Effetto FadeIn elegante */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.animate-install {
    animation: fadeInUp 0.8s ease forwards;
}

/* nasconde il menu “meno” se siamo nell’app */
html.is-pwa .nav-item.d-lg-none {
    display: none !important;
}

/* rende visibile il pulsante “Torna all’App” */
.back-to-app {
    display: none;
}

html.is-pwa .back-to-app {
    display: block;
}

/* ─── Footer PWA vs Browser ─────────────────────────── */

/* default: browser mostra il footer completo, nasconde quello minimale */
footer.not-pwa {
    display: block;
}

footer.pwa-footer {
    display: none;
}

/* in standalone PWA: html ha classe .is-pwa */
html.is-pwa footer.not-pwa {
    display: none !important;
}

html.is-pwa footer.pwa-footer {
    display: block !important;
}

/* --- Feedback & Rating System Styles --- */
.rating-box {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.rating-box.compact {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    margin-bottom: 1.2rem;
    background: #fbfbfb;
    box-shadow: none;
    border: 1px solid #eee;
    position: relative;
    border-radius: 50px;
    /* Più arrotondato come un badge */
}

/* Responsività per la box valutazione */
@media (max-width: 576px) {
    .rating-box.compact {
        display: flex !important;
        flex-direction: column;
        width: fit-content;
        max-width: 280px;
        border-radius: 15px;
        /* Meno arrotondato su mobile per stare su due righe */
        padding: 12px 20px !important;
    }

    .border-start-sm {
        border-top: 1px solid #eee;
        margin-top: 8px;
        padding-top: 8px;
        width: 100%;
    }
}

@media (min-width: 577px) {
    .border-start-sm {
        border-left: 1px solid #eee;
    }
}

.stars-interactive {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 5px;
}

.stars-interactive input {
    display: none;
}

.stars-interactive label {
    cursor: pointer;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ccc'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
    transition: transform 0.2s ease;
}

.stars-interactive label:hover,
.stars-interactive label:hover~label,
.stars-interactive input:checked~label {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffc107'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.stars-interactive label:active {
    transform: scale(0.9);
}

.static-stars i {
    font-size: 0.9rem;
    margin-right: 2px;
}

.feedback-success-msg {
    display: none;
    color: #198754;
    font-weight: 500;
    margin-top: 10px;
}

/* Modal Suggerimenti Style */
#feedbackModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

#feedbackModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
}

#feedbackModal .modal-body {
    padding: 2rem;
}

#feedbackModal .modal-footer {
    border-top: 1px solid #eee;
    padding: 1.2rem;
}

/* Target Keyword Analysis: niente scrollbar interna, overflow contenuto (desktop) */
#target-keyword-analysis {
    overflow-x: hidden;
}
/* Evita scrollbar verticale da collapse/accordion (Bootstrap può lasciare max-height) */
#target-keyword-analysis .collapse.show,
#target-keyword-analysis .accordion-collapse.collapse.show {
    max-height: none !important;
    overflow: visible !important;
}
#target-keyword-analysis .accordion-body,
#target-keyword-analysis .card-body {
    overflow-x: hidden;
    overflow-y: visible;
    max-height: none !important;
}
#target-keyword-analysis .row .col-md-6 {
    min-width: 0;
}
/* Lista "Dove appare" e altre list-group: niente scroll interno */
#target-keyword-analysis .list-group {
    max-height: none !important;
    overflow: visible !important;
}
#target-keyword-analysis .accordion-item,
#target-keyword-analysis .accordion-item .row {
    overflow: visible !important;
}

/* Analisi Semantica: la progress bar non deve uscire dalla card (desktop) */
#target-keyword-analysis .semantic-progress-block {
    max-width: 100%;
    min-width: 0;
}
#target-keyword-analysis .semantic-progress-block .progress {
    max-width: 100%;
}