/**
 * EPT Validator - Metabox & Sidebar Styles
 * Works with Classic Editor and Block Editor
 * 
 * @package EPT_Validator
 * @since 1.0.0
 */

/* ============================================
   COMMON STYLES (Classic + Gutenberg)
   ============================================ */

.ept-metabox-wrapper,
.ept-sidebar-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
}

/* Info Box (Usage Counter) */
.ept-info-box {
    background: #f0f6ff;
    border: 1px solid #c7d9f1;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
}

.ept-info-text {
    font-size: 13px;
    color: #1e3a5f;
    margin: 0;
    line-height: 1.6;
}

.ept-info-text strong {
    color: #2563eb;
    font-weight: 600;
}

/* Validate Button */
.ept-validate-button {
    width: 100%;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: white !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border-radius: 4px;
}

.ept-validate-button:hover:not(:disabled) {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.ept-validate-button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* Result Cards */
.ept-result-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.ept-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ept-result-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.ept-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.ept-result-description {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* Score Badge */
.ept-score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

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

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

.ept-score-medium {
    background: #fef3c7;
    color: #92400e;
}

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

/* Statistics List */
.ept-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #374151;
}

.ept-stats-list li {
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
}

.ept-stats-list li:last-child {
    border-bottom: none;
}

.ept-stats-list strong {
    float: right;
    color: #111827;
    font-weight: 600;
}

/* Structure Checks */
.ept-checks-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.ept-checks-list li {
    padding: 6px 0;
}

.ept-checks-list .check-pass {
    color: #059669;
}

.ept-checks-list .check-fail {
    color: #dc2626;
}

/* Warnings */
.ept-warnings {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.ept-warnings-title {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin: 0 0 8px 0;
}

.ept-warnings-list {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
    font-size: 12px;
    color: #78350f;
}

.ept-warnings-list li {
    margin-bottom: 4px;
}

/* Pro CTA */
.ept-pro-cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    color: white;
    text-align: center;
}

.ept-pro-cta p {
    margin: 0 0 12px 0;
    font-size: 14px;
}

.ept-pro-cta ul {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    font-size: 13px;
    text-align: left;
}

.ept-pro-cta ul li {
    padding: 4px 0 4px 20px;
    position: relative;
}

.ept-pro-cta ul li:before {
    content: "âœ“";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.ept-pro-cta .button {
    background: white !important;
    color: #667eea !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    transition: transform 0.2s ease;
}

.ept-pro-cta .button:hover {
    transform: scale(1.05);
}

/* ============================================
   CLASSIC EDITOR SPECIFIC
   ============================================ */

#italseva_validator_simple .inside {
    margin: 0;
    padding: 12px;
}

#ept-validate-meta-btn {
    margin-bottom: 12px;
}

/* ============================================
   GUTENBERG SPECIFIC
   ============================================ */

.ept-validator-sidebar .components-panel__body {
    border-top: 1px solid #e0e0e0;
}

.ept-validator-sidebar .components-panel__body-toggle {
    padding: 16px;
}

.ept-validator-sidebar .components-panel__row {
    display: block;
    padding: 0;
}

/* Gutenberg notices */
.ept-sidebar-content .notice {
    margin: 12px 0;
    padding: 8px 12px;
}

.ept-sidebar-content .notice p {
    margin: 0;
    font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 782px) {
    .ept-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ept-score-badge {
        margin-top: 8px;
    }
    
    .ept-stats-list strong {
        float: none;
        display: block;
        margin-top: 4px;
    }
}

/* ============================================
   CANNIBALIZATION HEADER LAYOUT FIX
   Ensure the "Ricontrolla" button doesn't overflow on narrow sidebars
   ============================================ */
.ept-result-card .ept-result-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ept-result-card .ept-recheck-cannibalization {
  flex-shrink: 0;
  align-self: center;
  margin-left: auto; /* keep it to the right when space allows */
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.ept-result-card,
.ept-warnings,
.ept-pro-cta {
    animation: ept-fade-in 0.3s ease-out;
}

/* Spinner for validation button */
.ept-validate-button .components-spinner {
    margin-right: 8px;
}

/**
 * EPT Validator - LLM Optimization Styles v2.5
 * Stili aggiuntivi per la sezione Ottimizzazione LLM nel Classic Editor
 * 
 * AGGIUNGI QUESTI STILI al tuo file ept-metabox.css esistente
 */

/* ========================================
   LLM OPTIMIZATION SECTION
   ======================================== */

.ept-llm-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.1);
}

.ept-llm-title {
  font-size: 18px;
  font-weight: 700;
  color: #0c4a6e;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ept-llm-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 16px 0;
  font-style: italic;
}

.ept-llm-stats {
  background: white;
  border-radius: 6px;
  padding: 16px;
}

.ept-llm-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e0f2fe;
}

.ept-llm-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ept-llm-label {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
}

.ept-llm-value {
  font-size: 16px;
  font-weight: 700;
  color: #0c4a6e;
}

.ept-llm-value.good {
  color: #15803d;
}

.ept-llm-value.warning {
  color: #ea580c;
}

.ept-llm-value small {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
}

/* Progress Bars */
.ept-llm-progress {
  margin: 8px 0 16px 0;
}

.ept-llm-progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ept-llm-progress-fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 5px;
}

.ept-llm-progress-fill.good {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.ept-llm-progress-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Penalty Notice */
.ept-llm-penalty {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 4px;
  font-size: 14px;
  color: #92400e;
  font-weight: 600;
}

/* LLM Suggestions */
.ept-llm-suggestions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px dashed #bae6fd;
}

.ept-llm-suggestions strong {
  display: block;
  margin-bottom: 10px;
  color: #0c4a6e;
  font-size: 14px;
}

.ept-llm-suggestion-item {
  padding: 8px 12px;
  background: #f0f9ff;
  border-left: 3px solid #0ea5e9;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.5;
}

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

/* Info Box */
.ept-llm-info {
  margin-top: 16px;
  padding: 12px 14px;
  background: white;
  border: 2px solid #bae6fd;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}

.ept-llm-info strong {
  color: #0c4a6e;
  font-size: 14px;
}

/* Animazioni */
@keyframes llmSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ept-llm-section {
  animation: llmSlideIn 0.4s ease-out;
}

/* Responsive */
@media (max-width: 782px) {
  .ept-llm-section {
    padding: 16px;
  }
  
  .ept-llm-stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .ept-llm-value {
    font-size: 18px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .ept-llm-section {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    border-color: #0ea5e9;
  }
  
  .ept-llm-title,
  .ept-llm-label {
    color: #e0f2fe;
  }
  
  .ept-llm-stats {
    background: #1e293b;
  }
  
  .ept-llm-suggestion-item {
    background: #1e293b;
    color: #bae6fd;
  }
  
  .ept-llm-info {
    background: #1e293b;
    border-color: #0ea5e9;
    color: #cbd5e1;
  }
}

/* ============================================
   LOCKED FEATURES (FREE tier teaser)
   ============================================ */

/* Locked Link Suggestions Box */
.ept-link-suggestions-locked {
    animation: pulse-glow 3s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    }
}

.ept-link-suggestions-locked .button-primary:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.5) !important;
}

/* Locked features general styling */
.ept-upgrade-cta {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    margin-top: 12px;
}

.ept-upgrade-cta .button {
    background: white !important;
    color: #2563eb !important;
    border: none !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.ept-upgrade-cta .button:hover {
    background: #f8fafc !important;
    transform: scale(1.02);
}

