/* ─── WhatsApp Chat Formatter Styles ────────────────────────────── */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a1a; min-height: 100vh; }

.container { max-width: 800px; margin: 0 auto; padding: 20px; }

/* Header */
.header { text-align: center; padding: 32px 0 24px; }
.header .logo { font-size: 48px; margin-bottom: 8px; }
.header h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; color: #075e54; }
.header .subtitle { color: #667; font-size: 14px; }

/* Cards */
.card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Upload */
.upload-zone { border: 2px dashed #25d366; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all .2s; background: #f0faf4; }
.upload-zone:hover, .upload-zone.dragover { border-color: #075e54; background: #dcf8c6; }
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-text { font-size: 16px; margin-bottom: 8px; }
.upload-hint { font-size: 14px; color: #888; }
.upload-hint a { color: #075e54; text-decoration: none; font-weight: 600; }
.upload-hint a:hover { text-decoration: underline; }

/* Steps */
.steps { margin-top: 20px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; color: #555; }
.step-num { display: inline-flex; width: 24px; height: 24px; background: #25d366; color: #fff; border-radius: 50%; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step code { background: #f0f0f0; padding: 1px 5px; border-radius: 3px; font-size: 12px; }

/* Results */
.results-header { margin-bottom: 16px; }
.results-header h2 { font-size: 18px; margin-bottom: 4px; }
.results-header p { color: #888; font-size: 13px; margin-bottom: 8px; }
.results-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn { padding: 8px 16px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-export { background: #e8f5e9; color: #2e7d32; }
.btn-export:hover { background: #c8e6c9; }
.btn-export:disabled { opacity: .4; cursor: not-allowed; }
.btn-pro { background: #ff9900; color: #fff; padding: 10px 20px; }
.btn-pro:hover { background: #e68a00; }
.btn-sample { background: #e8eaf6; color: #3f51b5; }
.btn-sample:hover { background: #c5cae9; }
.free-hint { font-size: 12px; color: #999; margin-top: 8px; }
.free-hint a { color: #ff9900; text-decoration: none; font-weight: 600; cursor: pointer; }

/* Entry List */
.entry-list { }
.entry-item { border-bottom: 1px solid #f0f0f0; }
.entry-header { display: flex; justify-content: space-between; align-items: center; padding: 12px; cursor: pointer; transition: background .15s; font-size: 13px; }
.entry-header:hover { background: #fafafa; }
.entry-header .sender { font-weight: 600; color: #075e54; }
.entry-header .time { color: #999; font-size: 12px; }
.entry-header .sys-label { color: #888; font-style: italic; font-size: 12px; }
.open-indicator { color: #bbb; font-size: 10px; transition: transform .2s; }
.entry-body { display: none; padding: 0 12px 12px; }
.entry-item.open .entry-body { display: block; }
.entry-text { font-size: 14px; line-height: 1.6; color: #333; white-space: pre-wrap; word-break: break-word; }
.entry-media { color: #667; font-style: italic; font-size: 13px; }
.entry-system { color: #888; font-style: italic; }

/* Filters */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 12px 0; margin-bottom: 12px; border-bottom: 1px solid #eee; }
.filter-bar label { font-size: 12px; color: #666; }
.filter-bar input, .filter-bar select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.filter-bar input[type="date"] { width: 150px; }
.filter-bar input[type="text"] { width: 160px; }
.filter-stats { font-size: 12px; color: #888; padding: 4px 12px; background: #f9f9f9; border-radius: 6px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-card { text-align: center; padding: 14px; background: #f9fafb; border-radius: 8px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; color: #075e54; }
.stat-card .stat-label { font-size: 11px; color: #888; margin-top: 2px; }
.sender-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sender-stat { padding: 6px 12px; background: #e8f5e9; border-radius: 16px; font-size: 12px; color: #2e7d32; }

/* PRO Card */
.pro-card { background: linear-gradient(135deg, #fff7ed, #fffbeb); border: 1px solid #fde68a; }
.pro-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pro-badge-large { background: #ff9900; color: #fff; padding: 4px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.pro-header span { font-size: 14px; color: #555; flex: 1; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 12px; padding: 32px; max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: #999; }
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.compare-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.compare-table th { background: #f9fafb; padding: 10px 12px; text-align: left; border-bottom: 2px solid #e5e7eb; }
.compare-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
.pro-price { text-align: center; font-size: 24px; font-weight: 700; color: #ff9900; margin: 16px 0; }
.pro-price-sub { font-size: 13px; color: #888; font-weight: 400; }
.license-row { display: flex; gap: 8px; margin: 12px 0; }
.license-row input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
.pro-hint { text-align: center; font-size: 12px; color: #999; }
.pro-hint a { color: #6366f1; text-decoration: none; }

/* Footer */
.footer { text-align: center; padding: 24px 0; color: #aaa; font-size: 13px; }
.footer p { margin-bottom: 4px; }
.footer-small { font-size: 12px; color: #ccc; }

/* Error */
.error { text-align: center; padding: 40px 20px; color: #d32f2f; font-size: 14px; }

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 12px; }
  .header h1 { font-size: 20px; }
  .results-actions { gap: 6px; }
  .btn { font-size: 12px; padding: 6px 12px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input { width: 100% !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
