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

html, body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    background-color: rgb(8, 8, 8);
    color: #b9b9b9;
    font-family: "Roboto", Helvetica, "Trebuchet MS", Verdana, sans-serif;
    text-rendering: optimizelegibility;
    line-height: 1.5;
}

a { color: #6ea8fe; text-decoration: none; }
a:hover { color: #9ec5fe; }

ul { list-style: none; }

/* ── Spinner ── */
#spinner {
    display: none;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #333;
    border-top-color: #888;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Top bar ── */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    height: 48px;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topbar-title {
    font-size: 0.95em;
    color: #e0e0e0;
    font-weight: 600;
    white-space: nowrap;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.topbar-nav a, .topbar-back {
    color: #aaa;
    font-size: 0.9em;
    padding: 0.15rem 0.4rem;
    border: 1px solid #333;
    border-radius: 4px;
    white-space: nowrap;
}

.topbar-nav a:hover, .topbar-back:hover {
    color: #fff;
    border-color: #555;
}

.topbar-nav a.disabled {
    color: #444;
    border-color: #222;
    pointer-events: none;
    cursor: default;
}

.topbar-sep { flex: 1; }

#showing {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
}

#filterInput {
    padding: 0.2rem 0.5rem;
    font-size: 0.85em;
    color: #e0e0e0;
    background: #111;
    border: 1px solid #333;
    border-radius: 4px;
    outline: none;
    width: 140px;
}

#filterInput:focus {
    border-color: #6ea8fe;
    width: 200px;
    transition: width 0.2s;
}

#filterInput::placeholder {
    color: #555;
}

@media (max-width: 600px) {
    .topbar {
        height: auto;
        min-height: 48px;
        padding: 0.4rem 0.75rem;
    }
    .topbar-nav a.day-label { display: none; }
    #filterInput { width: 100px; }
}

/* ── Logs directory ── */
.logs-index {
    padding: 4rem 1.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.logs-index h1 {
    font-size: 1.4rem;
    color: #e0e0e0;
    margin-bottom: 0.25rem;
}

.logs-index .subtitle {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 2rem;
}

.month-group {
    margin-bottom: 2rem;
}

.month-label {
    font-size: 0.75em;
    color: #555;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #1e1e1e;
}

.date-grid {
    display: flex;
    flex-direction: column;
}

.date-card {
    display: block;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid #141414;
    font-size: 0.9em;
    color: #b9b9b9;
    transition: background 0.1s, color 0.1s;
}

.date-card:hover {
    background: #111;
    color: #e0e0e0;
}

/* ── Day view ── */
.list-div {
    display: none;
}

.messages {
    margin-top: 48px;
}

@media (max-width: 600px) {
    .messages { margin-top: 80px; }
    li.splitter { top: 80px; }
}

/* ── Message items ── */
.mention-item {
    position: relative;
    padding: 0.5rem 1rem;
    font-size: 18px;
    border-bottom: 1px solid #1a1a1a;
    background-color: #000;
    content-visibility: auto;
    contain-intrinsic-size: auto 42px;
}

.mention-item:hover {
    background-color: #0d0d0d;
}

.mention-item.highlighted {
    border-color: #3a4aff;
    border-left: 3px solid #3a4aff;
    background-color: #0d1133;
}

/* ── Share button ── */
.share-btn {
    display: none;
    position: absolute;
    right: 0.6em;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid #333;
    border-radius: 4px;
    color: #777;
    font-size: 0.75em;
    padding: 0.15em 0.4em;
    cursor: pointer;
    line-height: 1.4;
    transition: color 0.15s, border-color 0.15s;
}

.share-btn:hover {
    color: #ccc;
    border-color: #666;
}

.mention-item:hover .share-btn {
    display: inline-block;
}

/* ── Date splitters ── */
li.splitter {
    background-color: rgb(8, 8, 8);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.6em 1em;
    font-size: 0.8em;
    color: #555;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: sticky;
    top: 48px;
    z-index: 10;
}

li.splitter::before,
li.splitter::after {
    content: '';
    flex: 1;
    border-top: 1px solid #2a2a2a;
}

li.splitter .message { color: #555; }

/* ── Message parts ── */
.timestamp {
    color: #686868;
    padding-right: 0.3em;
    cursor: default;
}

.nick {
    color: #fff;
    padding-left: 0.3em;
}

.message {
    color: #b9b9b9;
}

.dgg-badge {
    margin-left: 0.2em;
}
