/* ─── DBD AI PoC — Shared Theme ─────────────────────────────────────────────── */
/* Font: IBM Plex Sans Thai | Colors: DBD Blue + AWS Orange + Dakok */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'IBM Plex Sans Thai', 'Segoe UI', sans-serif; background: #f4f7fa; color: #1a202c; min-height: 100vh; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.header { background: linear-gradient(135deg, #0f2557 0%, #1a3d8a 50%, #232f3e 100%); color: #fff; padding: .7rem 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.header-left { display: flex; align-items: center; gap: .6rem; }
.header-logo { width: 32px; height: 32px; border-radius: 6px; }
.header h1 { font-size: 1rem; font-weight: 600; }
.header-right { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.btn-prefill { padding: .3rem .6rem; border: none; border-radius: 5px; font-size: .7rem; font-weight: 600; cursor: pointer; color: #fff; transition: opacity .2s; }
.btn-prefill:hover { opacity: .85; }
.btn-prefill.orange { background: #f47e2e; }
.btn-prefill.green { background: #38a169; }
.btn-prefill.blue { background: #3182ce; }
.btn-prefill.amber { background: #d69e2e; }
.btn-prefill.purple { background: #805ad5; }
.model-select { background: #1a3d8a; color: #fff; border: 1px solid #4a7ab5; padding: .3rem .5rem; border-radius: 5px; font-size: .7rem; font-weight: 600; cursor: pointer; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 920px; margin: 0 auto; padding: 1.5rem; }
.hidden { display: none; }
.page-dots { display: flex; justify-content: center; gap: .4rem; margin-bottom: 1.2rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e0; }
.dot.active { width: 24px; border-radius: 4px; background: #1a3d8a; }
.dot.done { background: #38a169; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 10px; padding: 1.4rem; margin-bottom: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid #e8ecf0; }
.card h2 { font-size: 1rem; font-weight: 600; color: #1a3d8a; margin-bottom: .8rem; }
.card h3 { font-size: .9rem; font-weight: 600; color: #2d3748; margin-bottom: .5rem; }

/* ─── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: .8rem; }
.form-group label { display: block; font-size: .8rem; color: #4a5568; margin-bottom: .25rem; font-weight: 500; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: .55rem .75rem; border: 1px solid #d1d9e0; border-radius: 6px; font-size: .85rem; font-family: inherit; transition: border .2s; background: #fff; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #3182ce; outline: none; box-shadow: 0 0 0 2px rgba(49,130,206,.15); }
.form-group textarea { min-height: 70px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .8rem; }

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn { padding: .6rem 1.2rem; border: none; border-radius: 6px; font-size: .85rem; cursor: pointer; font-weight: 600; font-family: inherit; transition: all .15s; }
.btn-primary { background: #1a3d8a; color: #fff; }
.btn-primary:hover { background: #0f2557; }
.btn-success { background: #38a169; color: #fff; }
.btn-success:hover { background: #2f855a; }
.btn-ai { background: linear-gradient(135deg, #1a3d8a, #3182ce); color: #fff; }
.btn-ai:hover { opacity: .9; }
.btn-ghost { padding: .5rem 1rem; background: #f7fafc; border: 1px solid #d1d9e0; border-radius: 6px; font-size: .8rem; cursor: pointer; font-weight: 500; color: #4a5568; font-family: inherit; }
.btn-ghost:hover { background: #edf2f7; border-color: #3182ce; color: #1a3d8a; }
.btn-outline { background: transparent; border: 2px solid #1a3d8a; color: #1a3d8a; padding: .5rem 1rem; border-radius: 6px; font-size: .85rem; cursor: pointer; font-weight: 600; font-family: inherit; }
.btn-outline:hover { background: #eff6ff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Upload Zone ────────────────────────────────────────────────────────────── */
.upload-zone { border: 2px dashed #cbd5e0; border-radius: 10px; padding: 1.5rem; text-align: center; cursor: pointer; transition: all .2s; }
.upload-zone:hover { border-color: #3182ce; background: #eff6ff; }
.upload-zone.has-file { border-color: #38a169; background: #f0fff4; }
.upload-zone input { display: none; }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.badge-pass { background: #c6f6d5; color: #22543d; }
.badge-fail { background: #fed7d7; color: #742a2a; }
.badge-warn { background: #fefcbf; color: #744210; }

/* ─── Confidence Bar ─────────────────────────────────────────────────────────── */
.conf-bar { display: flex; align-items: center; gap: .4rem; margin-top: .3rem; }
.conf-bar .bar { flex: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.conf-bar .fill { height: 100%; border-radius: 3px; transition: width .5s; }
.conf-bar .fill.h { background: #38a169; }
.conf-bar .fill.m { background: #d69e2e; }
.conf-bar .fill.l { background: #e53e3e; }

/* ─── Result Boxes ───────────────────────────────────────────────────────────── */
.inline-result { margin-top: .6rem; padding: .8rem; background: #f7fafc; border-radius: 8px; border: 1px solid #e8ecf0; font-size: .83rem; }
.obs-box { background: #fffbeb; border-left: 3px solid #d69e2e; padding: .6rem .8rem; margin-top: .4rem; border-radius: 0 6px 6px 0; font-size: .8rem; }
.rec-box { background: #eff6ff; border-left: 3px solid #3182ce; padding: .6rem .8rem; margin-top: .4rem; border-radius: 0 6px 6px 0; font-size: .8rem; }
.ref-box { background: #f7fafc; border-left: 3px solid #a0aec0; padding: .6rem .8rem; margin-top: .4rem; border-radius: 0 6px 6px 0; font-size: .76rem; color: #4a5568; }
.similar-tag { background: #fed7d7; color: #742a2a; padding: .1rem .4rem; border-radius: 10px; font-size: .72rem; display: inline-block; margin: .1rem; }

/* ─── Score Circle ───────────────────────────────────────────────────────────── */
.score-circle { width: 90px; height: 90px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 700; margin: 0 auto .8rem; }
.score-circle.good { background: #f0fff4; color: #22543d; border: 3px solid #38a169; }
.score-circle.mid { background: #fffff0; color: #744210; border: 3px solid #d69e2e; }
.score-circle.bad { background: #fff5f5; color: #742a2a; border: 3px solid #e53e3e; }

/* ─── Findings ───────────────────────────────────────────────────────────────── */
.finding-card { border: 1px solid #e8ecf0; border-radius: 8px; padding: .7rem; margin-bottom: .4rem; font-size: .83rem; }
.finding-card.critical { border-left: 4px solid #e53e3e; }
.finding-card.major { border-left: 4px solid #d69e2e; }
.finding-card.minor { border-left: 4px solid #3182ce; }

/* ─── Save Section ───────────────────────────────────────────────────────────── */
.save-section { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px; padding: 1.2rem; text-align: center; margin-top: 1rem; }
.save-section .app-id { font-size: 1.4rem; font-weight: 700; color: #1a3d8a; letter-spacing: 2px; margin: .4rem 0; }

/* ─── Disclaimer ─────────────────────────────────────────────────────────────── */
.disclaimer { background: #fffbeb; border: 1px solid #f6e05e; border-radius: 10px; padding: 1rem; font-size: .85rem; }
.disclaimer h3 { color: #744210; margin-bottom: .4rem; font-size: .9rem; }

/* ─── Thinking Animation ─────────────────────────────────────────────────────── */
.thinking-dots { display: inline-flex; gap: 6px; margin: 1rem 0; }
.thinking-dots span { width: 10px; height: 10px; background: #1a3d8a; border-radius: 50%; animation: bounce 1.4s infinite; }
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,80%,100%{transform:scale(0)} 40%{transform:scale(1)} }
.loading-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; margin-right: .4rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.id-input-group { display: flex; gap: .5rem; margin-top: .6rem; }
.id-input-group input { flex: 1; padding: .5rem; border: 1px solid #d1d9e0; border-radius: 6px; font-family: inherit; }
a { color: #1a3d8a; }
a:hover { color: #0f2557; }
