/* ReviewDeck - Global Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a73e8;
  --primary-dark: #185abc;
  --primary-light: #e8f0fe;
  --primary-strong: #174ea6;
  --accent: #34a853;
  --accent-soft: #e6f4ea;
  --success: #188038;
  --danger: #d93025;
  --warning: #f9ab00;
  --info: #1a73e8;
  --dark: #202124;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f4;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-400: #9aa0a6;
  --gray-500: #5f6368;
  --gray-600: #3c4043;
  --gray-700: #2d3135;
  --gray-800: #202124;
  --gray-900: #171717;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 28px rgba(15, 23, 42, .06);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, .10);
  --shadow-lg: 0 24px 56px rgba(15, 23, 42, .14);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--gray-800);
  background: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, .page-header h2, .page-title, .hero-title, .auth-card-header h2 {
  font-family: var(--font);
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; white-space: nowrap; box-shadow: none; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: rgba(26, 115, 232, .2); box-shadow: 0 8px 18px rgba(26, 115, 232, .18); }
.btn-primary:hover { background: var(--primary-dark); border-color: rgba(26, 115, 232, .3); }
.btn-secondary { background: rgba(255,255,255,.9); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: #fff; border-color: rgba(26, 115, 232, .24); color: var(--primary-dark); }
.btn-outline { background: rgba(255,255,255,.72); color: var(--primary-dark); border-color: rgba(26, 115, 232, .18); }
.btn-outline:hover { background: var(--primary-light); border-color: rgba(26, 115, 232, .28); }
.btn-danger { background: var(--danger); color: #fff; border-color: rgba(217, 48, 37, .2); box-shadow: 0 8px 18px rgba(217, 48, 37, .14); }
.btn-danger:hover { background: #b3261e; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xs { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn-google { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--gray-300); color: var(--gray-700); padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: 14px; text-decoration: none; transition: all .18s ease; }
.btn-google:hover { border-color: rgba(26, 115, 232, .24); color: var(--primary-dark); background: #fff; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-row.mt-2 { margin-top: 8px; }
.btn-row.mt-3 { margin-top: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--gray-600); margin-bottom: 9px; }
.form-control { width: 100%; padding: 15px 18px; border: 1px solid var(--gray-300); border-radius: 16px; font-family: var(--font); font-size: 15px; color: var(--gray-800); background: rgba(255,255,255,.94); transition: border-color .15s, box-shadow .15s, background .15s, transform .15s; outline: none; }
.form-control:focus { border-color: rgba(26, 115, 232, .5); box-shadow: 0 0 0 4px rgba(26, 115, 232, .10); background: #fff; transform: translateY(-1px); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; }
.form-control-sm { padding: 10px 14px; font-size: 13px; border: 1px solid rgba(201, 191, 173, .95); border-radius: 999px; font-family: var(--font); color: var(--gray-800); background: rgba(255,255,255,.88); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-between { display: flex; justify-content: space-between; align-items: center; }
.help-text { font-size: 11px; color: var(--gray-400); margin-top: 4px; display: block; }
.text-warn { color: var(--warning); }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* Alerts */
.alert { padding: 15px 18px; border-radius: 16px; margin-bottom: 14px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow); }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-close { background: none; border: none; cursor: pointer; font-size: 14px; opacity: .6; color: inherit; }
.alert-close:hover { opacity: 1; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-default { background: var(--gray-100); color: var(--gray-600); }
.badge-success, .badge-positive, .badge-active, .badge-published, .badge-replied { background: #dcfce7; color: #166534; }
.badge-danger, .badge-negative, .badge-failed { background: #fee2e2; color: #991b1b; }
.badge-warn, .badge-neutral, .badge-pending, .badge-suggested, .badge-scheduled { background: #fef3c7; color: #92400e; }
.badge-info, .badge-approved { background: #dbeafe; color: #1e40af; }
.badge-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-600); }
.badge-spam, .badge-ignored { background: var(--gray-100); color: var(--gray-500); }
.badge-status-draft { background: var(--gray-100); color: var(--gray-500); }
.badge-status-published { background: #dcfce7; color: #166534; }
.badge-status-scheduled { background: #fef3c7; color: #92400e; }
.badge-status-failed { background: #fee2e2; color: #991b1b; }
.badge-status-cancelled { background: var(--gray-100); color: var(--gray-400); }
.badge-status-pending { background: #fef3c7; color: #92400e; }
.badge-status-replied { background: #dcfce7; color: #166534; }
.badge-status-suggested { background: #dbeafe; color: #1e40af; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 18px; font-weight: 700; color: var(--gray-800); letter-spacing: .01em; }
.card-body { padding: 22px; }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 12px; }
.mt-2 { margin-top: 8px; }

/* Tables */
.table-card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { background: #f8fafc; padding: 13px 16px; text-align: left; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: 16px; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200); font-size: 13px; color: var(--gray-600); text-decoration: none; transition: all .15s; }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Empty state */
.empty-state { padding: 56px 24px; text-align: center; }
.empty-icon { font-size: 2.8rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { color: var(--gray-500); font-size: 15px; margin: 0 auto 18px; max-width: 420px; }

/* Toggle switch */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.toggle-row:last-child { border-bottom: none; }
.toggle-row span:first-child { font-size: 14px; color: var(--gray-700); }
.toggle-checkbox { display: none; }
.toggle-switch { width: 40px; height: 22px; background: var(--gray-300); border-radius: 20px; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: left .2s; }
.toggle-checkbox:checked + .toggle-switch { background: var(--primary); }
.toggle-checkbox:checked + .toggle-switch::after { left: 21px; }
.toggle-group { border: 1px solid var(--gray-100); border-radius: var(--radius-sm); padding: 0 12px; margin-top: 12px; }

/* Toggle button */
.toggle-btn { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; border: 1.5px solid transparent; cursor: pointer; }
.toggle-btn.on { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.toggle-btn.off { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-200); }

/* Info box */
.info-box { background: linear-gradient(135deg, rgba(223, 247, 242, .95) 0%, rgba(255, 243, 216, .76) 100%); border: 1px solid rgba(15, 118, 110, .14); border-radius: 16px; padding: 16px 18px; }
.info-box h4 { font-size: 15px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.info-box p { font-size: 14px; color: var(--gray-600); }

/* Rating stars */
.rating-stars { color: #f59e0b; font-size: 15px; letter-spacing: -2px; }

/* Text helpers */
.text-muted { color: var(--gray-400); font-size: 13px; }
.text-success { color: var(--success); font-size: 14px; }
.text-danger { color: var(--danger); font-size: 14px; }
.text-warning { color: var(--warning); font-size: 14px; }
.text-center { text-align: center; }
.link-sm { font-size: 14px; color: var(--primary); text-decoration: none; }
.link-sm:hover { text-decoration: underline; }
.breadcrumb { display: inline-block; color: var(--gray-400); font-size: 12px; text-decoration: none; margin-bottom: 4px; }
.breadcrumb:hover { color: var(--primary); }

/* Detail grid */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-list { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.detail-row label { color: var(--gray-500); font-weight: 500; }
.detail-row span { color: var(--gray-800); text-align: right; }

/* Settings grid */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Filter bar */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; background: #ffffff; padding: 14px; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
.filter-bar > * { min-width: 0; }

/* Score badges */
.score-badge { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.score-high { background: #dcfce7; color: #166534; }
.score-mid { background: #fef3c7; color: #92400e; }
.score-low { background: #fee2e2; color: #991b1b; }

/* Toast */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: var(--radius-sm); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateX(60px); transition: opacity .3s ease, transform .3s ease; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); }

/* Compliance note */
.compliance-note { font-size: 11px; color: var(--gray-400); margin-top: 8px; }

/* Feature list */
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feature-list li { font-size: 14px; color: var(--gray-700); }

/* Misc */
code { background: #f8fafc; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-family: monospace; color: var(--primary-strong); }
.error-stack { background: #f8fafc; padding: 12px; border-radius: var(--radius-sm); font-size: 11px; overflow-x: auto; text-align: left; margin-top: 12px; }

@media (max-width: 768px) {
  .detail-grid, .settings-grid, .form-row { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .btn, .filter-bar .form-control-sm, .filter-bar input { width: 100%; }
  .page-btn { min-width: 40px; }
  .card-header, .card-body { padding-left: 18px; padding-right: 18px; }
  .detail-row { flex-direction: column; gap: 4px; align-items: flex-start; }
  .detail-row span { text-align: left; }
  .btn-row { align-items: stretch; }
  .btn-row .btn { width: 100%; justify-content: center; }
  .form-row-between { flex-direction: column; align-items: stretch; gap: 12px; }
  .table-card { border-radius: 18px; }
  .data-table { min-width: 640px; }
  .pagination { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .btn { width: 100%; justify-content: center; }
  .btn-sm, .btn-xs { width: auto; }
  .card-header h3 { font-size: 16px; }
  .empty-state { padding: 42px 18px; }
  .empty-state h3 { font-size: 18px; }
  .alert { padding: 13px 14px; align-items: flex-start; }
}
