/**
 * EPT Validator - Modern CSS v1.1.0
 * Font ridotti + responsive sidebar
 * 
 * @package EPT_Validator
 * @version 1.1.0
 */

/* ============================================
   CONTAINER
   ============================================ */

#ept-validation-results {
    margin-top: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================
   1. SPEEDOMETER
   ============================================ */

.ept-score-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
}

/* FIX v3.0: Speedometer container con flex per centratura perfetta */
.ept-speedometer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
}

.ept-speedometer {
    position: relative;
    width: 100%;
    max-width: 280px; /* Dimensione ottimale per sidebar */
    margin: 0 auto;
}

.ept-speedometer-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Numero e label ora dentro SVG - questi CSS non servono più */

.ept-speedometer-status {
    margin-top: 12px;
    padding: 6px 16px;
    border-radius: 16px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}

.ept-status-excellent {
    background: #d1fae5;
    color: #065f46;
}

.ept-status-good {
    background: #dbeafe;
    color: #1e40af;
}

.ept-status-fair {
    background: #fef3c7;
    color: #92400e;
}

.ept-status-poor {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   2. PRIORITÀ IMMEDIATE (Redesign v3.0)
   ============================================ */

/* ============================================
   2.5. ANTEPRIMA SERP (v3.0)
   ============================================ */

.ept-serp-preview {
    background: #f8f9fa;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    font-family: Arial, sans-serif;
    min-height: 120px; /* Altezza minima per contenere tutto */
}

.ept-serp-label {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ept-serp-url {
    color: #5f6368;
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.3;
    word-break: break-all; /* Permetti wrapping URL lunghi */
}

.ept-serp-title {
    color: #1a0dab;
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 6px;
    cursor: pointer;
    line-height: 1.3;
    word-wrap: break-word; /* Permetti wrapping titolo */
}

.ept-serp-title:hover {
    text-decoration: underline;
}

.ept-serp-description {
    color: #4d5156;
    font-size: 13px;
    line-height: 1.58;
    word-wrap: break-word; /* Permetti wrapping description */
    max-height: none; /* Rimuovi limite altezza */
}

/* ============================================
   3. PRIORITÀ IMMEDIATE (Redesign v3.0)
   ============================================ */

.ept-priorities-card {
    background: #fffbeb; /* Giallo chiaro */
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.ept-priorities-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ept-priorities-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.ept-priorities-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #78350f;
}

.ept-priority-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: white;
    border: 1px solid #e5e7eb;
}

.ept-priority-item:last-child {
    margin-bottom: 0;
}

.ept-priority-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.4;
}

.ept-priority-text {
    flex: 1;
    font-size: 12px;
    line-height: 1.5;
    color: #374151;
}

/* Priority types */
.ept-priority-error {
    background: #fef2f2;
    border-color: #fca5a5;
}

.ept-priority-error .ept-priority-text {
    color: #991b1b;
}

.ept-priority-warning {
    background: #fffbeb;
    border-color: #fcd34d;
}

.ept-priority-warning .ept-priority-text {
    color: #92400e;
}

.ept-priority-info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.ept-priority-info .ept-priority-text {
    color: #1e40af;
}

.ept-toggle-all {
    width: 100%;
    padding: 8px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.ept-toggle-all:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.ept-all-suggestions {
    margin-top: 10px;
}

/* ============================================
   3. BREAKDOWN ACCORDION
   ============================================ */

.ept-breakdown-accordion {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.ept-accordion-item {
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.ept-accordion-item:last-child {
    margin-bottom: 0;
}

.ept-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.2s;
}

.ept-accordion-header:hover {
    background: #f3f4f6;
}

.ept-accordion-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* Fix overflow */
}

.ept-accordion-toggle {
    font-size: 10px;
    color: #6b7280;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.ept-accordion-label {
    font-size: 11px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ept-accordion-weight {
    font-size: 9px;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.ept-accordion-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ept-accordion-score {
    font-size: 11px;
    font-weight: 600;
    color: #111827;
}

.ept-accordion-icon {
    font-size: 14px;
}

.ept-accordion-content {
    display: none;
    padding: 12px;
    background: white;
}

.ept-accordion-bar-container {
    background: #f3f4f6;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 10px;
    overflow: hidden;
}

.ept-accordion-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

.ept-accordion-issues {
    margin-top: 6px;
}

.ept-accordion-issue {
    padding: 6px 10px;
    margin-bottom: 6px;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.4;
    color: #991b1b;
}

.ept-accordion-issue:last-child {
    margin-bottom: 0;
}

.ept-accordion-ok {
    padding: 6px 10px;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    border-radius: 4px;
    font-size: 10px;
    color: #065f46;
}

/* ============================================
   4. METADATA
   ============================================ */

.ept-metadata {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
}

.ept-metadata-item {
    text-align: center;
}

.ept-metadata-label {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 4px;
}

.ept-metadata-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.ept-eeat-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.ept-eeat-alto {
    background: #d1fae5;
    color: #065f46;
}

.ept-eeat-medio {
    background: #dbeafe;
    color: #1e40af;
}

.ept-eeat-basso {
    background: #fef3c7;
    color: #92400e;
}

/* ============================================
   ERROR BOX
   ============================================ */

.ept-error-box {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.ept-error-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.ept-error-title {
    font-size: 16px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 6px;
}

.ept-error-message {
    font-size: 12px;
    color: #7f1d1d;
    line-height: 1.5;
}

/* ============================================
   ANIMAZIONI
   ============================================ */

@keyframes ept-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ept-score-card,
.ept-top-suggestions,
.ept-breakdown-accordion,
.ept-metadata {
    animation: ept-fade-in 0.4s ease-out;
}

/* ============================================
   RESPONSIVE - SIDEBAR STRETTA
   ============================================ */

/* Quando la sidebar è < 300px */
@media (max-width: 300px) {
    .ept-speedometer {
        max-width: 160px;
    }
    
    .ept-speedometer-number {
        font-size: 32px;
    }
    
    .ept-accordion-label {
        font-size: 10px;
    }
    
    .ept-top-text {
        font-size: 10px;
    }
}

/* Mobile standard */
@media (max-width: 782px) {
    .ept-metadata {
        grid-template-columns: 1fr;
    }
    
    .ept-speedometer {
        max-width: 180px;
    }
}

/* ============================================
   KEYWORD ANALYSIS BOX
   ============================================ */

.ept-keyword-analysis {
    background: #f0f9ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.ept-keyword-header {
    margin-bottom: 8px;
    font-size: 14px;
    color: #1f2937;
}

.ept-keyword-text {
    color: #3b82f6;
    font-weight: 700;
    font-size: 16px;
}

.ept-keyword-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #4b5563;
}

.ept-keyword-stat strong {
    color: #1f2937;
}

.ept-keyword-found {
    background: #d1fae5;
    color: #065f46;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 8px;
}

.ept-keyword-missing {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 8px;
}
