/* ===== Text Analyzer - Modern Styles ===== */

/* Layout */
.ta-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.ta-main { min-width: 0; }
.ta-card {
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 18px;
  padding: 32px; box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.ta-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Stats grid */
.ta-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.ta-stat-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-soft); border-radius: 12px; padding: 16px;
  border: 1px solid var(--border-light); transition: all 0.2s;
}
.ta-stat-item:hover { border-color: var(--primary-100); }
.ta-stat-icon {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 18px; flex-shrink: 0;
}
.ta-stat-icon.chars { background: #eef2ff; color: #6366f1; }
.ta-stat-icon.words { background: #dcfce7; color: #16a34a; }
.ta-stat-icon.lines { background: #fef3c7; color: #d97706; }
.ta-stat-icon.paragraphs { background: #f3e8ff; color: #9333ea; }
.ta-stat-icon.sentences { background: #ffe4e6; color: #e11d48; }
.ta-stat-icon.reading { background: #ecfdf5; color: #10b981; }
.ta-stat-info { display: flex; flex-direction: column; }
.ta-stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.ta-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Dark mode stat icons */
body[data-theme="dark"] .ta-stat-icon.chars { background: #312e81; color: #a5b4fc; }
body[data-theme="dark"] .ta-stat-icon.words { background: #064e3b; color: #34d399; }
body[data-theme="dark"] .ta-stat-icon.lines { background: #78350f; color: #fbbf24; }
body[data-theme="dark"] .ta-stat-icon.paragraphs { background: #4c1d95; color: #c084fc; }
body[data-theme="dark"] .ta-stat-icon.sentences { background: #881337; color: #fda4af; }
body[data-theme="dark"] .ta-stat-icon.reading { background: #064e3b; color: #34d399; }

/* Section */
.ta-section { margin-bottom: 16px; }
.ta-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--text-secondary);
}
.ta-section-actions { display: flex; gap: 6px; }
.ta-action-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-light);
  background: var(--bg); color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 12px;
}
.ta-action-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Textarea */
.ta-textarea {
  width: 100%; min-height: 220px; padding: 14px 16px;
  border: 2px solid var(--border-light); border-radius: 12px;
  font-size: 14px; font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: var(--bg); color: var(--text); outline: none;
  resize: vertical; transition: border-color 0.2s; line-height: 1.6;
  box-sizing: border-box;
}
.ta-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
body[data-theme="dark"] .ta-textarea { background: var(--bg-muted); border-color: var(--border); }

/* Options */
.ta-options {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 8px; margin-bottom: 16px;
}
.ta-option-label { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Extra info */
.ta-extra {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border-light);
}
.ta-extra-item { font-size: 13px; color: var(--text-secondary); }
.ta-extra-item strong { color: var(--text); }

/* How-to list */
.ta-howto-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ta-howto-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.ta-howto-num {
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* Sidebar shared */
.sidebar-section { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.sidebar-header { text-align: center; padding: 28px 20px !important; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; border-color: transparent !important; }
.sidebar-header h1 { font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.sidebar-header p { font-size: 0.82rem; color: rgba(255,255,255,0.85); }
body[data-theme="dark"] .sidebar-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important; }
.sidebar-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.sidebar-title i { color: var(--primary); font-size: 0.9rem; }
.sidebar-tools { display: flex; flex-direction: column; gap: 8px; }
.sidebar-tool { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: all 0.2s ease; text-decoration: none; background: var(--bg-soft); }
.sidebar-tool:hover { background: var(--primary-50); transform: translateX(3px); }
.sidebar-tool-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 16px; flex-shrink: 0; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.sidebar-tool-info { flex: 1; min-width: 0; }
.sidebar-tool-name { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sidebar-tool-desc { font-size: 0.78rem; color: var(--text-muted); }
.ad-placeholder { width: 300px; height: 250px; flex-shrink: 0; margin: 0 auto; background: var(--bg-card); border: 2px dashed var(--border); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; }
.ad-placeholder .ad-icon { font-size: 1.8rem; color: var(--text-muted); margin-bottom: 10px; opacity: 0.4; }
.ad-placeholder .ad-label { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.ad-placeholder .ad-size { font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }
.calc-seo { margin-top: 24px; padding: 16px; background: var(--bg-soft); border-radius: 12px; }
.calc-seo p { font-size: 12.5px; color: var(--text-muted); line-height: 1.7; }

/* Dark mode */
body[data-theme="dark"] .ta-card { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .ta-stat-item { background: var(--bg-muted); border-color: var(--border); }
body[data-theme="dark"] .ta-stat-item:hover { border-color: var(--primary-100); }
body[data-theme="dark"] .ta-action-btn { background: var(--bg-muted); border-color: var(--border); }
body[data-theme="dark"] .ta-action-btn:hover { background: var(--primary); border-color: var(--primary); }
body[data-theme="dark"] .ta-extra { border-top-color: var(--border); }
body[data-theme="dark"] .sidebar-section { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .sidebar-tool { background: var(--bg-muted); }
body[data-theme="dark"] .sidebar-tool:hover { background: var(--primary-50); }
body[data-theme="dark"] .ad-placeholder { background: var(--bg-card); border-color: var(--border); }
body[data-theme="dark"] .calc-seo { background: var(--bg-muted); }

/* Responsive */
@media (max-width: 1024px) { .ta-layout { grid-template-columns: 1fr 280px; gap: 20px; } }
@media (max-width: 860px) { .ta-layout { grid-template-columns: 1fr; } .ta-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (max-width: 768px) {
  .ta-card { padding: 20px; }
  .ta-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ta-extra { grid-template-columns: 1fr; }
  .ta-stat-value { font-size: 18px; }
  .ta-textarea { min-height: 160px; }
}
@media (max-width: 640px) { .ta-sidebar { grid-template-columns: 1fr; } }