
/* Scoped styles for the Readability & Headline Analyzer (frontend-only) */
.rha { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; line-height: 1.6; }
.rha * { box-sizing: border-box; }

.rha .container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.rha .header { text-align: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; border-radius: 12px; margin-bottom: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.rha .header h1 { font-size: 2.5rem; margin-bottom: 10px; font-weight: 700; }
.rha .header p { font-size: 1.1rem; opacity: 0.9; }

.rha .main-grid { display: grid; grid-template-columns: 1fr 400px; gap: 20px; margin-bottom: 20px; }
.rha .text-panel, .rha .analyzer-panel { background: white; border: 2px solid #e1e5e9; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.rha .panel-header { background: #f8f9fa; padding: 15px 20px; border-bottom: 1px solid #e1e5e9; display: flex; justify-content: space-between; align-items: center; }
.rha .panel-title { font-weight: 600; color: #2c3e50; font-size: 16px; display: flex; align-items: center; gap: 8px; }

.rha .text-area { width: 100%; height: 600px; border: none; padding: 20px; font-size: 16px; line-height: 1.8; resize: none; outline: none; font-family: 'Georgia', 'Times New Roman', serif; }
.rha .text-area:focus { background: #f8f9fa; }

.rha .analyzer-panel { height: fit-content; position: sticky; top: 20px; }
.rha .analysis-group { padding: 20px; border-bottom: 1px solid #e1e5e9; }
.rha .analysis-group:last-child { border-bottom: none; }
.rha .analysis-group h3 { font-size: 14px; font-weight: 600; color: #2c3e50; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }

.rha .metric-card { background: #f8f9fa; border: 1px solid #e1e5e9; border-radius: 8px; padding: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.rha .metric-label { font-size: 14px; color: #6b7280; }
.rha .metric-value { font-size: 18px; font-weight: 600; color: #2c3e50; }

.rha .readability-score { background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%); color: white; padding: 20px; border-radius: 12px; text-align: center; margin-bottom: 15px; }
.rha .readability-score.excellent { background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%); }
.rha .readability-score.good { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.rha .readability-score.fair { background: linear-gradient(135deg, #facc15 0%, #eab308 100%); color: #000; }
.rha .readability-score.difficult { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.rha .readability-score.very-difficult { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.rha .score-number { font-size: 48px; font-weight: 700; margin-bottom: 5px; }
.rha .score-label { font-size: 16px; opacity: 0.9; margin-bottom: 5px; }
.rha .score-description { font-size: 14px; opacity: 0.8; }

.rha .power-words-list { max-height: 150px; overflow-y: auto; background: #f0f9ff; border-radius: 6px; padding: 10px; }
.rha .power-word { display: inline-block; background: #3b82f6; color: white; padding: 4px 8px; border-radius: 12px; font-size: 12px; margin: 2px; font-weight: 500; }
.rha .power-word.emotional { background: #ef4444; }
.rha .power-word.action { background: #22c55e; }
.rha .power-word.urgency { background: #f97316; }
.rha .power-word.value { background: #8b5cf6; }

.rha .suggestions-list { max-height: 200px; overflow-y: auto; }
.rha .suggestion { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.rha .suggestion.critical { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.rha .suggestion.warning { background: #fffbeb; border-color: #fde68a; color: #d97706; }
.rha .suggestion.tip { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.rha .suggestion-icon { font-weight: bold; margin-right: 6px; }

.rha .btn { padding: 12px 16px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-bottom: 10px; }
.rha .btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.rha .btn-primary { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.rha .btn-export { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }

.rha .headline-analyzer { background: #f8f9fa; border: 2px dashed #d1d5db; border-radius: 8px; padding: 15px; margin-bottom: 15px; }
.rha .headline-input { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; margin-bottom: 10px; }
.rha .headline-score { display: flex; justify-content: space-between; align-items: center; background: white; padding: 8px 12px; border-radius: 6px; font-size: 13px; }

.rha .ai-optimization { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); color: white; padding: 15px; border-radius: 10px; margin-bottom: 15px; }
.rha .ai-score { font-size: 24px; font-weight: bold; margin-bottom: 5px; }
.rha .progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.rha .progress-fill { height: 100%; background: rgba(255,255,255,0.8); transition: width 0.3s ease; }

.rha .file-input-container { margin-bottom: 15px; }
.rha .file-input { display: none; }
.rha .file-input-label { display: block; padding: 10px; background: #f8f9fa; border: 2px dashed #d1d5db; border-radius: 8px; text-align: center; cursor: pointer; transition: all 0.3s ease; font-size: 14px; color: #6b7280; }
.rha .file-input-label:hover { border-color: #667eea; background: #f0f4ff; }

.rha .error-message { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.rha .success-message { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.rha .hidden { display: none; }

.rha .export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rha .keyword-density { max-height: 120px; overflow-y: auto; font-size: 12px; }
.rha .keyword-item { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #e5e7eb; }

@media (max-width: 1024px) {
  .rha .main-grid { grid-template-columns: 1fr; }
  .rha .analyzer-panel { position: static; }
  .rha .container { padding: 10px; }
  .rha .header h1 { font-size: 2rem; }
  .rha .export-options { grid-template-columns: 1fr; }
}
