/* ChargeScrub Styles v1.0.0 - Based on CPT Coding Assistant */
:root { --brand: #2563eb; --brand-d: #1e40af; --ink: #111827; --muted: #6b7280; --ring: rgba(37,99,235,.18); --surface: #fff; --border: #e5e7eb; --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --success: #10b981; --warning: #f59e0b; --danger: #dc2626; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: #fafafa; }
.container { max-width: 800px; margin: 32px auto; padding: 0 16px; }
h1, h2, h3 { margin: 0 0 12px; }
h1 { font-size: 1.9rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 1.1rem; border-radius: 10px; border: 2px solid var(--brand); background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; transition: all 0.12s; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.65; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: #f3f4f6; }
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn-ghost:hover { background: var(--slate-100); }
.btn-primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 100%); border-color: var(--brand-d); font-size: 1rem; padding: 0.8rem 1.4rem; }
.btn-primary:hover { filter: brightness(1.1); }
.btn .spinner { width: 1.1em; height: 1.1em; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.75s linear infinite; }

.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 18px; margin: 14px 0; }
.result-box { background: #fff; border: 2px solid #111827; border-radius: 16px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.12); }

.status-row { display: flex; gap: 16px; margin-bottom: 16px; }
.status-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.status-dot.offline { background: var(--danger); }
.status-dot.checking { background: var(--warning); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Drop Zone */
.drop-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--slate-50); }
.drop-zone:hover { border-color: var(--brand); background: #eff6ff; }
.drop-zone.drag-over { border-color: var(--brand); background: #dbeafe; border-style: solid; }
.drop-zone.has-file { display: none; }

/* File Info */
.file-info { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #eff6ff; border: 2px solid var(--brand); border-radius: 12px; }
.file-icon { color: var(--brand); }
.file-details { flex: 1; }
.file-name { display: block; font-weight: 600; }
.file-size { display: block; margin-top: 2px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card { background: var(--slate-50); border: 1.5px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; font-weight: 500; }
.stat-card.stat-charge { background: #dcfce7; border-color: #86efac; }
.stat-card.stat-charge .stat-value { color: #166534; }
.stat-card.stat-deny { background: #fee2e2; border-color: #fca5a5; }
.stat-card.stat-deny .stat-value { color: #991b1b; }
.stat-card.stat-review { background: #dbeafe; border-color: #60a5fa; }
.stat-card.stat-review .stat-value { color: #1e40af; }

/* Download button pulse animation */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.7); }
}

/* Rules Accordion */
.rules-accordion { background: var(--slate-50); border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.rules-accordion[open] { padding-bottom: 16px; }
.rules-accordion summary { outline: none; }
.rules-accordion summary::-webkit-details-marker { display: none; }
.rules-content ol li { margin-bottom: 6px; }

/* Disclaimer */
.disclaimer { margin-top: 20px; background: #fef9c3; border: 2px solid #eab308; border-radius: 12px; padding: 16px; font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 0.8rem; color: #854d0e; line-height: 1.5; white-space: pre-line; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 12px 24px; border-radius: 8px; font-size: 0.9rem; z-index: 10000; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Progress Overlay */
.progress-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center; z-index: 9999; }
.progress-overlay.active { display: flex; }
.progress-card { background: white; border: 2px solid #000; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); padding: 32px; max-width: 420px; width: 90%; text-align: center; }
.progress-spinner { margin: 0 auto 20px; width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.progress-bar { width: 100%; height: 8px; background: var(--slate-200); border-radius: 4px; overflow: hidden; margin: 16px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand) 0%, #3b82f6 100%); border-radius: 4px; transition: width 0.5s ease-in-out; width: 0%; }

/* Action row */
.action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 600px) { 
    .container { margin: 16px auto; padding: 0 12px; } 
    h1 { font-size: 1.5rem; } 
    .result-box { padding: 16px; } 
    .action-row { flex-direction: column; } 
    .action-row .btn { width: 100%; } 
}
