/* ================================================================
   ChatPDR – Stylesheet
   Simple, clean, mobile-friendly
   ================================================================ */

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

/* ---- Base ---- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #edf2f7;
    color: #2d3748;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.6;
}

/* ---- Header ---- */
header {
    background: #2b6cb0;
    color: #fff;
    text-align: center;
    padding: 1.75rem 1rem 1.5rem;
}
header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}
header h1 a { color: inherit; text-decoration: none; }
header p {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ---- Main container ---- */
main {
    flex: 1;
    width: 100%;
    max-width: 680px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ---- Card ---- */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 1.6rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 0.5rem;
}
.card > p {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1rem;
}
.card-success {
    border-top: 4px solid #48bb78;
    text-align: center;
}

/* ---- Forms ---- */
label.field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.35rem;
}
textarea,
input[type="text"],
input[type="password"] {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #cbd5e0;
    border-radius: 7px;
    font-size: 1rem;
    font-family: inherit;
    color: #2d3748;
    background: #f7fafc;
    margin-bottom: 0.85rem;
    transition: border-color 0.2s, background 0.2s;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #2b6cb0;
    background: #fff;
}
textarea { resize: vertical; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s;
    white-space: nowrap;
}
.btn:hover  { background: #2c5282; }
.btn-secondary          { background: #718096; }
.btn-secondary:hover    { background: #4a5568; }
.btn-danger             { background: #e53e3e; }
.btn-danger:hover       { background: #c53030; }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* ---- Tracking code display ---- */
.code-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 10px;
    color: #2b6cb0;
    background: #ebf8ff;
    border: 2px dashed #63b3ed;
    border-radius: 10px;
    padding: 1rem 0.5rem;
    margin: 1.1rem auto;
    max-width: 340px;
    text-align: center;
}

/* ---- Content boxes ---- */
.question-box {
    background: #f7fafc;
    border-left: 4px solid #63b3ed;
    padding: 0.8rem 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.97rem;
}
.answer-box {
    background: #f0fff4;
    border-left: 4px solid #48bb78;
    padding: 0.8rem 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.97rem;
}
.pending-box {
    background: #fffaf0;
    border-left: 4px solid #ed8936;
    padding: 0.8rem 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1rem;
    color: #7b341e;
    font-size: 0.95rem;
}
.result-code {
    font-size: 0.82rem;
    color: #a0aec0;
    margin-bottom: 1rem;
}

/* ---- Hint / small text ---- */
.hint {
    font-size: 0.82rem;
    color: #718096;
    margin-top: 0.4rem;
    margin-bottom: 0.9rem;
    line-height: 1.5;
}

/* ---- Error / flash messages ---- */
.error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 0.65rem 0.9rem;
    border-radius: 7px;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
}
.flash {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #22543d;
    padding: 0.65rem 0.9rem;
    border-radius: 7px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ---- Admin bar ---- */
.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.admin-stats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.stat {
    font-size: 0.82rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #4a5568;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}
.stat-pending  { background: #feebc8; color: #7b341e; }
.stat-answered { background: #c6f6d5; color: #22543d; }

/* ---- Question cards (admin) ---- */
.question-card { border-left: 5px solid #e2e8f0; }
.question-card.is-answered { border-left-color: #48bb78; }
.question-card.is-pending  { border-left-color: #ed8936; }

.question-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.tracking-badge {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 700;
    background: #ebf8ff;
    color: #2b6cb0;
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
}
.q-date {
    font-size: 0.78rem;
    color: #a0aec0;
}
.status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-answered { background: #c6f6d5; color: #22543d; }
.badge-pending  { background: #feebc8; color: #7b341e; }

.form-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.btn-delete { margin-top: 0.4rem; }

/* ---- Footer ---- */
footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.82rem;
    color: #a0aec0;
}
footer a { color: #718096; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ---- Mobile ---- */
@media (max-width: 500px) {
    header h1    { font-size: 1.7rem; letter-spacing: 2px; }
    .code-display { font-size: 1.9rem; letter-spacing: 6px; }
    .card        { padding: 1.2rem; }
    main         { margin: 1.2rem auto; }
}
