/* AI Plagiarism Checker — Scoped Styles */
#apc-wrap *, #apc-wrap *::before, #apc-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }
#apc-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.6; color: #1a1a2e; max-width: 1100px; margin: 0 auto; padding: 0 16px 60px; }
.apc-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 24px; border-bottom: 1px solid #e8e8f0; margin-bottom: 40px; }
.apc-brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.apc-logo-icon { font-size: 20px; }
.apc-auth-area { display: flex; align-items: center; gap: 10px; }
#apc-user-info { display: flex; align-items: center; gap: 10px; }
.apc-user-name { font-size: 14px; font-weight: 500; color: #444; }
.apc-plan-badge { background: #f0eeff; color: #6c63ff; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; }
.apc-plan-badge.paid { background: #e8f5e9; color: #2e7d32; }
.apc-hero { text-align: center; margin-bottom: 40px; }
.apc-hero-title { font-size: 36px; font-weight: 800; color: #1a1a2e; letter-spacing: -0.8px; margin-bottom: 12px; }
.apc-hero-sub { font-size: 16px; color: #666; max-width: 520px; margin: 0 auto 24px; }
.apc-usage-bar { display: inline-flex; align-items: center; gap: 12px; background: #f8f7ff; border: 1px solid #e0deff; border-radius: 100px; padding: 8px 20px; font-size: 13px; color: #555; }
.apc-usage-track { width: 80px; height: 6px; background: #e0deff; border-radius: 3px; overflow: hidden; }
.apc-usage-fill { height: 100%; background: linear-gradient(90deg, #6c63ff, #a78bfa); border-radius: 3px; transition: width 0.4s ease; }
.apc-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 720px) { .apc-tool-grid { grid-template-columns: 1fr; } .apc-hero-title { font-size: 26px; } }
.apc-panel { background: #fff; border: 1.5px solid #e8e8f0; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.apc-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f8; background: #fafafa; }
.apc-panel-label { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.8px; }
.apc-textarea { flex: 1; min-height: 280px; padding: 18px; border: none; outline: none; font-family: inherit; font-size: 14px; line-height: 1.7; color: #333; resize: none; background: transparent; }
.apc-output-area { flex: 1; min-height: 280px; padding: 18px; overflow-y: auto; }
.apc-output-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #ccc; text-align: center; min-height: 200px; }
.apc-placeholder-icon { font-size: 32px; opacity: 0.4; }
.apc-panel-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid #f0f0f8; background: #fafafa; }
.apc-char-count { font-size: 12px; color: #bbb; }
.apc-btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px; font-family: inherit; font-weight: 600; cursor: pointer; transition: all 0.15s ease; text-decoration: none; }
.apc-btn:active { transform: scale(0.97); }
.apc-btn-primary { background: #6c63ff; color: #fff; }
.apc-btn-primary:hover { background: #5a52e0; color: #fff; text-decoration: none; }
.apc-btn-ghost { background: transparent; color: #666; border: 1px solid #e0e0e8; }
.apc-btn-ghost:hover { background: #f5f5ff; border-color: #a78bfa; color: #6c63ff; }
.apc-btn-sm { padding: 7px 14px; font-size: 13px; }
.apc-btn-xs { padding: 5px 10px; font-size: 12px; }
.apc-btn-lg { padding: 12px 24px; font-size: 15px; }
.apc-btn-full { width: 100%; justify-content: center; }
.apc-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: apc-spin 0.7s linear infinite; }
@keyframes apc-spin { to { transform: rotate(360deg); } }

/* Score Card */
.apc-score-card { display: flex; gap: 20px; align-items: center; padding: 16px; background: #f8f7ff; border-radius: 12px; margin-bottom: 16px; }
.apc-score-circle { width: 90px; height: 90px; border-radius: 50%; border: 5px solid #4caf50; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.apc-score-num { font-size: 20px; font-weight: 800; }
.apc-score-label { font-size: 9px; color: #888; text-transform: uppercase; }
.apc-score-info { flex: 1; }
.apc-score-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #ede; }
.apc-score-row:last-child { border-bottom: none; }

/* Highlighted Text */
.apc-highlight-section { margin-bottom: 16px; }
.apc-highlight-section h4 { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 10px; }
.apc-highlighted-text { font-size: 13px; line-height: 1.8; color: #333; background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 12px; max-height: 200px; overflow-y: auto; }
mark.apc-dup { background: #ffcdd2; color: #c62828; border-radius: 3px; padding: 1px 2px; }
mark.apc-rep { background: #fff9c4; color: #f57f17; border-radius: 3px; padding: 1px 2px; }
mark.apc-ai  { background: #e1f5fe; color: #0277bd; border-radius: 3px; padding: 1px 2px; }

/* Issues */
.apc-issues-section h4 { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.apc-issues-list { list-style: none; }
.apc-issues-list li { font-size: 12px; color: #666; padding: 5px 0; border-bottom: 1px solid #f0f0f0; padding-left: 16px; position: relative; }
.apc-issues-list li::before { content: '⚠️'; position: absolute; left: 0; font-size: 10px; }

/* Legend */
.apc-legend { display: flex; gap: 20px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.apc-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; }
.apc-highlight-dup { width: 14px; height: 14px; background: #ffcdd2; border-radius: 3px; display: inline-block; }
.apc-highlight-rep { width: 14px; height: 14px; background: #fff9c4; border-radius: 3px; display: inline-block; }
.apc-highlight-ai  { width: 14px; height: 14px; background: #e1f5fe; border-radius: 3px; display: inline-block; }

/* Limit Banner */
.apc-limit-banner { background: linear-gradient(135deg,#fafafe,#f5f0ff); border: 1.5px solid #d8d0ff; border-radius: 20px; padding: 40px 32px; text-align: center; margin-bottom: 40px; }
.apc-limit-banner h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.apc-limit-banner p { color: #666; margin-bottom: 32px; }
.apc-pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 560px; margin: 0 auto; }
@media (max-width: 520px) { .apc-pricing-grid { grid-template-columns: 1fr; } }
.apc-pricing-card { background: #fff; border: 1.5px solid #e8e8f0; border-radius: 16px; padding: 24px; position: relative; }
.apc-pricing-popular { border-color: #6c63ff; }
.apc-popular-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: #6c63ff; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 14px; border-radius: 20px; white-space: nowrap; }
.apc-pricing-name { font-size: 13px; font-weight: 600; color: #888; margin-bottom: 8px; text-transform: uppercase; }
.apc-pricing-price { font-size: 36px; font-weight: 800; color: #1a1a2e; margin-bottom: 16px; }
.apc-pricing-price span { font-size: 14px; font-weight: 400; color: #888; }
.apc-pricing-features { list-style: none; margin-bottom: 20px; text-align: left; }
.apc-pricing-features li { font-size: 13px; color: #555; padding: 4px 0; }

/* Modal */
.apc-modal-overlay { position: fixed; inset: 0; background: rgba(10,10,30,0.5); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.apc-modal { background: #fff; border-radius: 20px; padding: 36px 32px; width: 100%; max-width: 420px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.apc-modal-close { position: absolute; top: 16px; right: 18px; background: none; border: none; font-size: 22px; color: #aaa; cursor: pointer; }
.apc-modal-title { font-size: 22px; font-weight: 700; color: #1a1a2e; margin-bottom: 20px; }
.apc-form-group { margin-bottom: 16px; }
.apc-form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.apc-input { width: 100%; padding: 11px 14px; border: 1.5px solid #e0e0e8; border-radius: 10px; font-family: inherit; font-size: 14px; color: #333; outline: none; }
.apc-input:focus { border-color: #6c63ff; }
.apc-form-error { background: #fff5f5; border: 1px solid #ffd0d0; color: #c0392b; font-size: 13px; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.apc-form-switch { text-align: center; font-size: 13px; color: #888; margin-top: 16px; }
.apc-form-switch a { color: #6c63ff; text-decoration: none; font-weight: 600; }
.apc-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1a1a2e; color: #fff; padding: 12px 24px; border-radius: 100px; font-size: 14px; font-weight: 500; z-index: 999999; white-space: nowrap; }
