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

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

.container { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* Header */
header { background: #2d6a4f; color: #fff; padding: 1rem 0; text-align: center; }
header h1 { font-size: 1.25rem; }
header a { color: #fff; text-decoration: none; }

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0 1rem;
    font-size: 0.8rem;
    color: #999;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
}

/* Card */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 16px 20px;
    margin-bottom: 16px;
}

/* Buttons — shared base */
button, .btn {
    display: inline-block;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Primary green button */
.btn-primary { background: #2d6a4f; color: #fff; width: 100%; }
.btn-primary:hover { background: #245a42; }
.btn-primary:active { background: #1b4332; }

/* Danger / red button */
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #b71c1c; }
.btn-danger:active { background: #8e0000; }

/* Secondary / outline button — used for less-important actions */
.btn-secondary {
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
    font-weight: 500;
    font-size: 0.875rem;
    min-height: 44px;
    padding: 0.5rem 1rem;
    width: auto;
}
.btn-secondary:hover { background: #f5f5f5; border-color: #aaa; }
.btn-secondary:active { background: #eee; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px; /* prevents iOS zoom */
    margin-bottom: 0.75rem;
    font-family: inherit;
}
input:focus, textarea:focus {
    outline: none;
    border-color: #2d6a4f;
    box-shadow: 0 0 0 2px rgba(45,106,79,0.2);
}

/* Progress bar */
.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    height: 20px;
    margin-top: 0.5rem;
}
.progress-fill {
    background: #2d6a4f;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

/* ------------------------------------------------------------------ */
/*  Admin — Stat cards                                                 */
/* ------------------------------------------------------------------ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.stat-card { text-align: center; }
.stat-card .stat-number { font-size: 2rem; font-weight: 700; color: #2d6a4f; }
.stat-card .stat-label { font-size: 0.85rem; color: #777; }

@media (max-width: 420px) {
    .stat-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
    }
    .stat-card .stat-number {
        font-size: 1.5rem;
        order: 2;
    }
    .stat-card .stat-label {
        font-size: 0.9rem;
        order: 1;
    }
}

/* ------------------------------------------------------------------ */
/*  Admin — Dashboard header bar                                       */
/* ------------------------------------------------------------------ */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.admin-header h2 { margin-bottom: 0; }
.admin-logout {
    font-size: 0.9rem;
    color: #c62828;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 6px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.admin-logout:hover { background: #fce4ec; }

/* ------------------------------------------------------------------ */
/*  Admin — Action bar (QR codes + exports)                            */
/* ------------------------------------------------------------------ */
.admin-actions {
    margin-bottom: 1.5rem;
}
.admin-actions-primary {
    margin-bottom: 0.75rem;
}
.admin-actions-primary .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.export-group-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.export-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.export-group .btn-secondary {
    flex: 1;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* ------------------------------------------------------------------ */
/*  Admin — Moderation queue                                           */
/* ------------------------------------------------------------------ */
.queue-heading {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.queue-heading h3 { margin-bottom: 0; }
.queue-count {
    background: #f9a825;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 1.5rem;
    text-align: center;
}
.queue-count-zero {
    background: #2d6a4f;
}

/* Entry card */
.mod-card {
    margin-bottom: 0.75rem;
}

.mod-entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.35rem;
}
.mod-entry-author {
    font-weight: 700;
}
.mod-entry-location {
    font-size: 0.85rem;
    color: #777;
}
.mod-entry-location-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: #e0f2f1;
    color: #00695c;
    line-height: 1.4;
    white-space: nowrap;
}
.mod-entry-message {
    margin: 0.5rem 0;
    line-height: 1.5;
}
.mod-entry-meta {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.75rem;
}

/* Status badges — human-readable labels */
.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    vertical-align: middle;
    text-transform: none;
    line-height: 1;
}
.status-badge-pending {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}
.status-badge-reported {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Toxicity indicator */
.toxicity-indicator {
    font-weight: 600;
}
.toxicity-low    { color: #2e7d32; }
.toxicity-medium { color: #f57f17; }
.toxicity-high   { color: #c62828; }

/* Approve / Reject action row */
.mod-actions {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
}
.mod-actions form {
    flex: 1;
}
.mod-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
}
.btn-approve {
    background: #2d6a4f;
    color: #fff;
}
.btn-approve:hover { background: #245a42; }
.btn-approve:active { background: #1b4332; }

.btn-reject {
    background: #fff;
    color: #c62828;
    border: 2px solid #c62828;
}
.btn-reject:hover { background: #fce4ec; }
.btn-reject:active { background: #f8bbd0; }

/* Empty queue */
.queue-empty {
    text-align: center;
    color: #2e7d32;
    padding: 2rem 1rem;
}
.queue-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ------------------------------------------------------------------ */
/*  Admin — Login page                                                 */
/* ------------------------------------------------------------------ */
.login-card {
    max-width: 380px;
    margin: 2rem auto;
}
.login-title {
    margin-bottom: 0.25rem;
    text-align: center;
}
.login-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1.25rem;
}
.login-error {
    color: #c62828;
    background: #fce4ec;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------------ */
/*  Success / Error messages                                           */
/* ------------------------------------------------------------------ */
.success-message {
    background: #e8f5e9;
    color: #1b5e20;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}
.error-message {
    background: #fce4ec;
    color: #c62828;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Privacy notice */
.privacy-notice { font-size: 0.75rem; color: #999; margin-top: 0.5rem; }

/* Guestbook entry */
.guestbook-entry { border-bottom: 1px solid #eee; padding: 0.75rem 0; }
.guestbook-entry:last-child { border-bottom: none; }
.guestbook-meta { font-size: 0.8rem; color: #999; }

/* Admin revoke button on checkpoint page */
.btn-revoke {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    min-height: auto;
    border: 1px solid #c62828;
    border-radius: 6px;
    background: #fff;
    color: #c62828;
    cursor: pointer;
    line-height: 1.3;
}
.btn-revoke:hover { background: #fce4ec; }
.btn-revoke:active { background: #f8bbd0; }

/* Status colours (for guestbook entries shown on public pages) */
.status-approved { color: #2d6a4f; }
.status-pending  { color: #f9a825; }
.status-rejected { color: #c62828; }
.status-reported { color: #c62828; font-style: italic; }

/* Typography */
h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

/* ------------------------------------------------------------------ */
/*  Completion card                                                    */
/* ------------------------------------------------------------------ */
.completion-card {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 2px solid #f9a825;
    text-align: center;
    padding: 1.5rem 1.25rem;
}
.completion-icon {
    font-size: 2.5rem;
    color: #f9a825;
    margin-bottom: 0.5rem;
}
.completion-title {
    color: #b8860b;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}
.completion-subtitle {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.25rem;
}
.completion-code {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 0.2em;
    color: #b8860b;
    background: #fff;
    border: 2px dashed #f9a825;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: inline-block;
    margin: 0.5rem 0;
}
.completion-instructions {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.75rem;
}

/* ------------------------------------------------------------------ */
/*  Admin — Verify completion                                          */
/* ------------------------------------------------------------------ */
.verify-result {
    text-align: center;
    padding: 1.25rem;
}
.verify-result-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.verify-result-success {
    border-left: 4px solid #2e7d32;
}
.verify-result-success .verify-result-icon {
    color: #2e7d32;
}
.verify-result-invalid {
    border-left: 4px solid #c62828;
}
.verify-result-invalid .verify-result-icon {
    color: #c62828;
}
.verify-details {
    text-align: left;
    margin-top: 1rem;
}
.verify-details p {
    margin-bottom: 0.35rem;
}
.verify-status {
    margin-top: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}
.verify-status-complete {
    color: #1b5e20;
    background: #e8f5e9;
}
.verify-status-incomplete {
    color: #c62828;
    background: #fce4ec;
}

/* ------------------------------------------------------------------ */
/*  Checkpoint map                                                     */
/* ------------------------------------------------------------------ */
#checkpoint-map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    margin-top: 0.5rem;
}
.map-pin { background: transparent !important; border: none !important; }

/* ------------------------------------------------------------------ */
/*  Stamp card                                                         */
/* ------------------------------------------------------------------ */
.stamp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.6rem;
}
.stamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.6rem 0.25rem;
    border-radius: 10px;
    transition: transform 0.15s;
}
.stamp-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}
.stamp-name {
    font-size: 0.7rem;
    line-height: 1.2;
    word-break: break-word;
    max-width: 90px;
}
.stamp-visited {
    background: #e8f5e9;
}
.stamp-visited .stamp-icon {
    background: #2d6a4f;
    color: #fff;
    box-shadow: 0 2px 6px rgba(45,106,79,0.3);
}
.stamp-visited .stamp-name {
    color: #2d6a4f;
    font-weight: 600;
}
.stamp-missing {
    background: #f5f5f5;
}
.stamp-missing .stamp-icon {
    background: #e0e0e0;
    color: #bbb;
    border: 2px dashed #ccc;
}
.stamp-missing .stamp-name {
    color: #aaa;
}

/* Utility */
main { padding: 1rem 0; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1.5rem; }
