/*
 * # Graeme Murphy - 3405922
 * # 7/30
 * Shared responsive presentation for the public, user, and admin pages.
 */

/* Base document and navigation styles. */
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f4f6f8; color: #222; }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { background: #111827; color: white; padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { margin: 0; font-size: 26px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 16px; }
.topbar nav a { color: white; font-weight: bold; }
.single-column, .auth-page { max-width: 1100px; margin: 24px auto; padding: 0 20px; }

/* Reusable cards and problem-content presentation. */
.auth-card { max-width: 440px; margin: 40px auto; }
.card { background: white; border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.card h2 { margin-top: 0; }
.problem-meta, .muted { color: #64748b; }
.eyebrow { margin: 0; color: #2563eb; font-weight: bold; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
pre { background: #111827; color: #e5e7eb; padding: 14px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; }
code { background: #e2e8f0; border-radius: 4px; padding: 2px 5px; }

/* Forms and source-code editor controls. */
form { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: bold; }
input, textarea, select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; }
select { background: white; }
textarea { min-height: 120px; resize: vertical; }
.large-text { min-height: 240px; }
#source_code { min-height: 420px; font-family: Consolas, Monaco, monospace; font-size: 14px; }
button, .button-link, .tab-nav a { width: fit-content; padding: 10px 16px; border: 0; border-radius: 6px; background: #2563eb; color: white; font-weight: bold; cursor: pointer; }
button:hover { background: #1d4ed8; }
button:disabled { background: #94a3b8; cursor: not-allowed; }
.danger-button { background: #dc2626; }
.danger-button:hover { background: #b91c1c; }
.button-link.secondary, .tab-nav a { background: #475569; }
.tab-nav a.active { background: #2563eb; }
.button-link:hover, .tab-nav a:hover { text-decoration: none; filter: brightness(.92); }

/* Validation messages and judge-result status panels. */
.error-text { color: #b91c1c; font-weight: bold; }
.success-text { color: #15803d; font-weight: bold; }
.result-box { margin-top: 16px; white-space: pre-wrap; padding: 14px; border-radius: 8px; background: #f1f5f9; border-left: 5px solid #64748b; }
.result-box.accepted { background: #dcfce7; border-left-color: #16a34a; }
.result-box.wrong { background: #fef9c3; border-left-color: #ca8a04; }
.result-box.error { background: #fee2e2; border-left-color: #dc2626; }
.hidden { display: none; }

/* Tables, statistics, and dashboard action groups. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
.stats-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.stat-card { flex: 1 1 140px; background: white; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.stat-card strong { display: block; font-size: 30px; }
.stat-card span { color: #555; }
.dashboard-actions, .tab-nav, .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

/* Two- and three-column layouts used by forms and management screens. */
.two-column, .form-grid, .sample-grid, .management-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.management-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.management-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid #cbd5e1; border-radius: 8px; color: #111827; }
.management-card:hover { background: #f8fafc; text-decoration: none; }
.management-card span { color: #64748b; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.inline-form { display: inline-flex; }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: bold; }

/* Collapse all multi-column areas for tablets and smaller browser windows. */
@media (max-width: 800px) {
  .two-column, .form-grid, .sample-grid, .management-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .stats-grid { flex-direction: column; }
}
