/* DarkWire — shared site styling. Same palette as the Android app:
   AccentTeal #3DDAC6, DarkBackground #0B0F12. Dark is the default theme. */

:root,
:root[data-theme="dark"] {
    --bg: #0B0F12;
    --surface: #131A1F;
    --surface-raised: #1B242B;
    --border: #263139;
    --text: #E9F2F1;
    --text-muted: #9BAAAE;
    --accent: #3DDAC6;
    --accent-text: #0B0F12;
    --danger: #E06C6C;
}

:root[data-theme="light"] {
    --bg: #F4F7F7;
    --surface: #FFFFFF;
    --surface-raised: #EAF3F2;
    --border: #D6E0DF;
    --text: #0B0F12;
    --text-muted: #4A5A5A;
    --accent: #1FA391;
    --accent-text: #FFFFFF;
    --danger: #B23A3A;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

p {
    font-size: 1.2rem;
}

/* Header */

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
}

.brand img {
    width: 32px;
    height: 32px;
    border-radius: 7px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-muted);
    font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--text);
    text-decoration: none;
}

.theme-toggle {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--accent);
}

/* Hero */

.hero {
    padding: 64px 0 48px;
    text-align: center;
}

.hero img.hero-logo {
    width: 84px;
    height: 84px;
    border-radius: 18px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 2.2rem;
    margin: 0 0 12px;
}

.hero p.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 520px;
    margin: 0 auto 28px;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 8px;
    font-weight: 600;
    background: var(--accent);
    color: var(--accent-text) !important;
    text-decoration: none !important;
}

.btn:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    background: transparent;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

/* Feature grid */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.feature h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.feature p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Page content */

main {
    padding: 40px 0 60px;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.page-lede {
    color: var(--text-muted);
    margin-top: 0;
    margin-bottom: 32px;
}

section + section {
    margin-top: 40px;
}

h1, h2 {
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    color: var(--accent) !important;
}

/* Info page: foldable topics, like the About screen in the app (see assets/js/info.js) */

.info-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
}

.chip {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text) !important;
    font-size: 0.9rem;
    text-decoration: none !important;
}

.chip:hover {
    border-color: var(--accent);
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.9rem;
}

.info-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 18px;
    scroll-margin-top: 16px;
}

.info-section + .info-section {
    margin-top: 12px;
}

.info-section summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    cursor: pointer;
    list-style: none;
}

.info-section summary::-webkit-details-marker {
    display: none;
}

.info-section summary h2 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 1.1rem;
}

/* The arrow, like the app's expand/collapse icon: points down when closed, up when open. */
.info-section summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.info-section[open] summary::after {
    transform: rotate(-135deg);
}

.info-section[open] summary {
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.info-section[open] {
    padding-bottom: 8px;
}

.donate-block {
    margin-top: 32px;
    text-align: center;
}

.donate-button {
    max-width: 300px;
    margin: 8px auto 0;
}

/* Download table */

.releases {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.releases th,
.releases td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.releases th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.releases td.version {
    white-space: nowrap;
    font-weight: 600;
}

.badge-latest {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
}

.releases ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
}

.releases ul li {
    margin-bottom: 4px;
}

.download-note {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 28px;
}

.download-note code {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Size + SHA-256 line at the bottom of a release block */
.release-meta {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.release-meta code {
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.site-footer .container {
    padding-top: 24px;
    padding-bottom: 24px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.site-footer a {
    color: var(--text-muted);
}

em {
    color: var(--accent) !important;
}

@media (max-width: 560px) {
    .hero h1 { font-size: 1.7rem; }
    .site-nav { gap: 12px; }
    .releases th:nth-child(2),
    .releases td:nth-child(2) { display: none; }
}

/* ---- /community and its admin page ---- */
.warning-note {
    border-left: 4px solid var(--danger);
}

.community-rules li {
    margin-bottom: 6px;
}

.flag {
    width: 20px;
    height: 15px;
    vertical-align: -2px;
    border-radius: 2px;
    margin-right: 4px;
}

.community-list td a {
    overflow-wrap: anywhere;
}

.community-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 520px;
    margin: 18px 0 32px;
}

.community-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
}

.community-form input,
.community-form select,
.community-form textarea,
.admin-edit input,
.admin-edit select {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 0;
}

.community-form button {
    align-self: flex-start;
}

/* The bot trap: out of sight for people, still in the form. */
.community-form .hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-error {
    color: var(--danger);
    font-weight: 600;
}

.proof-code {
    font-size: 1.05rem;
    user-select: all;
}

.admin-logout {
    margin-bottom: 18px;
}

.admin-entry ul {
    margin: 8px 0 12px;
}

.admin-edit,
.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.admin-edit input {
    flex: 1 1 260px;
}

@media (max-width: 560px) {
    /* The address matters most here: show it, hide the time instead. */
    .community-list th:nth-child(2),
    .community-list td:nth-child(2) { display: table-cell; }
    .community-list th:nth-child(4),
    .community-list td:nth-child(4) { display: none; }
}

/* ---- /report ---- */
/* The full width of the page (Tijn): more room to describe a problem. */
.report-form {
    max-width: none;
}

.community-form textarea {
    resize: vertical;
    line-height: 1.5;
}

/* Labels are flex boxes, which would win over the hidden attribute (report.js). */
.report-form [hidden] {
    display: none !important;
}

.report-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-hint {
    font-size: 0.88em;
    opacity: 0.85;
}

.community-form .form-check {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
}

.community-form .form-check input {
    margin-top: 4px;
    flex: none;
}

.admin-report {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 4px 0 10px;
}

.admin-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.admin-select {
    margin-right: 8px;
}

.admin-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.admin-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-muted);
}

.admin-fields input,
.admin-fields textarea {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 0;
}

.admin-fields textarea {
    resize: vertical;
    line-height: 1.5;
}

.admin-answers li {
    margin-bottom: 10px;
}

.admin-new summary {
    cursor: pointer;
}

/* ---- /thanks ---- */
.thanks-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}

.thanks-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.thanks-list p {
    margin: 4px 0 0;
}

.thanks-by,
.thanks-meta {
    color: var(--text-muted);
}

.thanks-meta {
    font-size: 0.9rem;
}
