/**
 * SEO Analyzer Tool Pro - Stili Frontend
 * ========================================
 * Versione: 5.5.1
 * Struttura del file:
 * [1] Contenitore principale e layout base
 * [2] Input e pulsante
 * [3] Cerchio del punteggio
 * [4] Sezioni e card
 * [5] Check list e stati
 * [6] Accordion nativo (per liste lunghe)
 * [7] Griglia SEO Tecnica
 * [8] Keyword tags
 * [9] Messaggi di stato (loading, errori, ecc.)
 * [10] SEZIONE SUGGERIMENTI GENERATIVI
 * [11] LINK IMMAGINI
 * [12] DOPPIO PUNTEGGIO
 * [13] BOTTONE PDF
 */

/* ------------------------------------------------------------
   [1] CONTENITORE PRINCIPALE E LAYOUT BASE
   ------------------------------------------------------------ */
.seo-box {
    max-width: 800px;
    margin: 40px auto;
    padding: 25px;
    background: #0f172a;
    color: #f1f5f9;
    border-radius: 20px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.seo-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.8rem;
    color: #38bdf8;
}

/* ------------------------------------------------------------
   [2] INPUT E PULSANTE
   ------------------------------------------------------------ */
.seo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.seo-box input {
    flex: 1;
    padding: 14px 18px;
    border-radius: 50px;
    border: 1px solid #334155;
    background: #1e293b;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
}

.seo-box input:focus {
    border-color: #38bdf8;
}

.seo-box button {
    padding: 14px 28px;
    background: #3b82f6;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.seo-box button:hover {
    background: #2563eb;
}

/* ------------------------------------------------------------
   [13] BOTTONE PDF
   ------------------------------------------------------------ */
.seo-pdf-button {
    background: #a855f7 !important;
    box-shadow: 0 4px 6px -1px rgba(168, 85, 247, 0.3) !important;
    margin-bottom: 10px;
}

.seo-pdf-button:hover {
    background: #9333ea !important;
}

.seo-pdf-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ------------------------------------------------------------
   [3] CERCHIO DEL PUNTEGGIO
   ------------------------------------------------------------ */
.seo-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.seo-score-text {
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: 500;
}

/* ------------------------------------------------------------
   [4] SEZIONI E CARD
   ------------------------------------------------------------ */
.seo-section {
    margin-top: 25px;
    padding: 20px;
    background: #1e293b;
    border-radius: 16px;
    border-left: 4px solid #3b82f6;
}

.seo-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #e2e8f0;
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ------------------------------------------------------------
   [5] CHECK LIST E STATI
   ------------------------------------------------------------ */
.seo-checks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.seo-check-item {
    background: #0f172a;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #334155;
}

.seo-check-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 8px;
}

.seo-check-icon {
    font-size: 1.2rem;
}

.seo-check-recommendation {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.5;
    padding-left: 30px;
}

/* Colori in base allo stato */
.seo-check-item.good .seo-check-header {
    color: #4ade80;
}
.seo-check-item.bad .seo-check-header {
    color: #f87171;
}
.seo-check-item.info .seo-check-header {
    color: #60a5fa;
}

/* Liste generiche */
.seo-list {
    margin: 0;
    padding-left: 20px;
    color: #cbd5e1;
}

.seo-list li {
    margin-bottom: 5px;
    word-break: break-word;
}

/* ------------------------------------------------------------
   [6] ACCORDION NATIVO (PER LISTE LUNGHE)
   ------------------------------------------------------------ */
.seo-accordion {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 5px 15px;
    margin-top: 10px;
}

.seo-accordion summary {
    padding: 15px 0;
    cursor: pointer;
    list-style: none; /* nasconde il triangolo di default */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #e2e8f0;
    font-weight: 500;
    user-select: none;
}

.seo-accordion summary::-webkit-details-marker {
    display: none; /* nasconde il triangolo su Chrome */
}

.seo-accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.2s;
    color: #94a3b8;
}

.seo-accordion[open] .seo-accordion-icon {
    transform: rotate(180deg);
}

.seo-accordion-content {
    padding: 5px 0 15px 20px;
    border-top: 1px solid #334155;
}

.seo-accordion .seo-list {
    margin: 0;
    padding-left: 20px;
}

/* ------------------------------------------------------------
   [7] GRIGLIA SEO TECNICA
   ------------------------------------------------------------ */
.seo-tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.seo-missing {
    color: #f87171;
    font-style: italic;
}

.seo-good {
    color: #4ade80;
}
.seo-warning {
    color: #fbbf24;
}

/* ------------------------------------------------------------
   [8] KEYWORD TAGS
   ------------------------------------------------------------ */
.seo-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.seo-keyword {
    background: #334155;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: #e2e8f0;
}

/* ------------------------------------------------------------
   [9] MESSAGGI DI STATO (LOADING, ERRORI)
   ------------------------------------------------------------ */
.seo-error {
    background: #7f1d1d;
    color: #fecaca;
    padding: 15px;
    border-radius: 12px;
    font-weight: 500;
}

.seo-loading {
    text-align: center;
    padding: 30px;
    font-size: 1.2rem;
}

/* ------------------------------------------------------------
   [10] SEZIONE SUGGERIMENTI GENERATIVI
   ------------------------------------------------------------ */
.seo-suggestions {
    border-left-color: #a855f7; /* viola per distinguere */
    background: #1e1b4b; /* sfondo leggermente diverso */
}

.seo-suggestion-item {
    background: #0f172a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #334155;
}

.seo-suggestion-item:last-child {
    margin-bottom: 0;
}

.seo-suggestion-item strong {
    color: #c084fc;
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.seo-suggestion-item code {
    background: #1e293b;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: monospace;
    color: #f1f5f9;
    word-break: break-all;
}

.seo-suggestion-item .seo-list {
    margin-top: 8px;
}

.seo-suggestion-item .seo-list li {
    margin-bottom: 10px;
}

/* [11] LINK IMMAGINI */
.seo-image-link {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px dotted;
}
.seo-image-link:hover {
    color: #93c5fd;
    border-bottom: 1px solid;
}

/* ------------------------------------------------------------
   [12] DOPPIO PUNTEGGIO
   ------------------------------------------------------------ */
.seo-dual-score {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.seo-score-item {
    text-align: center;
}

.seo-score-label {
    font-weight: 600;
    margin-top: 8px;
    font-size: 1rem;
}

.seo-score-note {
    font-size: 0.8rem;
    color: #94a3b8;
}

.seo-score-impact {
    background: #1e293b;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 0.95rem;
    display: inline-block;
    margin-top: 5px;
}

/* ------------------------------------------------------------
   [14] STILI PER STAMPA/PDF
   ------------------------------------------------------------ */
@media print {
    .seo-input-group,
    #seo-pdf-btn,
    .seo-pdf-button {
        display: none !important;
    }
    
    .seo-box {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .seo-section {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: avoid;
    }
    
    .seo-check-item {
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
    }
    
    .seo-check-recommendation {
        color: #334155 !important;
    }
    
    .seo-keyword {
        background: #e2e8f0 !important;
        color: #1e293b !important;
    }
    
    .seo-suggestion-item {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
    }
    
    .seo-suggestion-item code {
        background: #e2e8f0 !important;
        color: #1e293b !important;
    }
    
    .seo-accordion {
        background: #f8fafc !important;
    }
    
    .seo-accordion-content {
        border-top-color: #cbd5e1 !important;
    }
}