/* nere.nu — Clean status checker theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --blue: #2980b9;
    --blue-dark: #1a5276;
    --green: #27ae60;
    --green-dark: #1e8449;
    --red: #e74c3c;
    --red-dark: #c0392b;
    --orange: #e67e22;
    --bg: #f0f2f5;
    --white: #fff;
    --text: #333;
    --text-muted: #666;
    --text-dim: #999;
    --border: #ddd;
    --border-light: #eee;
    --radius: 6px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* ── Header ── */
.header {
    background: var(--white);
    border-bottom: 3px solid var(--blue);
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    position: relative;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-dark);
}
.header h1 span { color: var(--red); }
.header p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.auth-section {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.auth-btn {
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.15s;
}
.auth-btn:hover { background: var(--blue-dark); }

/* ── Section headers (colored bars) ── */
.section-header {
    background: var(--blue);
    color: var(--white);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.section-header.green { background: var(--green); }
.section-header.red { background: var(--red); }
.section-header.orange { background: var(--orange); }

/* ── Card ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}
.card-body { padding: 0.75rem; }

/* ── Breadcrumbs ── */
.breadcrumbs {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--text-dim); }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

/* ── Stats bar ── */
.stats-bar {
    display: none;
    margin-bottom: 1rem;
}
.stats-grid {
    display: flex;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.stat-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-right: 1px solid var(--border-light);
}
.stat-item:last-child { border-right: none; }
.stat-number { font-size: 1.1rem; font-weight: 700; color: var(--blue); display: block; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }

/* ── Main grid ── */
.main-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) {
    .main-grid { grid-template-columns: 2fr 1fr; }
}

/* ── Checker ── */
.checker { padding: 1rem; }

.input-group { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }

#urlInput {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}
#urlInput:focus { border-color: var(--blue); }

#checkBtn {
    padding: 0.6rem 1.5rem;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: background 0.15s;
}
#checkBtn:hover { background: var(--green-dark); }
#checkBtn:disabled { opacity: 0.5; cursor: not-allowed; }

.checker-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* ── Result ── */
.result {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
    display: none;
}
.result.success { background: #d5f5e3; border: 1px solid #a9dfbf; color: #1e8449; }
.result.error   { background: #fadbd8; border: 1px solid #f5b7b1; color: #c0392b; }
.result.loading { background: #fef9e7; border: 1px solid #f9e79f; color: #b7950b; }

.watch-btn {
    display: inline-block;
    background: var(--green);
    color: var(--white);
    border: none;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius);
    margin-top: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    font-family: inherit;
}
.watch-btn:hover { background: var(--green-dark); }

/* ── History chart ── */
.history-section { margin-top: 0.75rem; display: none; }
.history-section canvas { width: 100%; height: 120px; border-radius: var(--radius); border: 1px solid var(--border-light); }
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}
.history-header h4 { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.history-stats { display: flex; gap: 0.75rem; font-size: 0.72rem; color: var(--text-muted); }
.history-stats span { font-weight: 600; color: var(--text); }

/* ── Comments ── */
.comments-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
    display: none;
}
.comments-section h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }

.comment {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
}
.comment:last-child { border-bottom: none; }
.comment-meta { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 0.2rem; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-author.verified::after { content: ' \2713'; color: var(--green); font-weight: bold; }
.comment-text { color: var(--text-muted); word-break: break-word; }

.comment-form {
    background: #f9f9f9;
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.82rem;
    margin-bottom: 0.4rem;
}
.comment-form button {
    padding: 0.4rem 1rem;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    font-family: inherit;
}

/* ── Incidents (sidebar) ── */
.incidents-section { margin-bottom: 1rem; }
.incident-item {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}
.incident-item:last-child { border-bottom: none; }
.incident-item.down .incident-site { color: var(--red); }
.incident-item.recovery .incident-site { color: var(--green); }
.incident-time { color: var(--text-dim); font-size: 0.7rem; }

/* ── Watchlist ── */
.watchlist-panel {
    display: none;
    margin-bottom: 1rem;
}
.watchlist-panel h2 { display: none; }

.watchlist-item {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}
.watchlist-item:last-child { border-bottom: none; }
.watchlist-item button {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    font-family: inherit;
}
.watchlist-add {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.3rem;
}
.watchlist-add input {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: inherit;
}
.watchlist-add button {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
}

/* ── Status indicators ── */
.status-dot {
    width: 10px; height: 10px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 0.3rem;
    vertical-align: middle;
}
.status-dot.up      { background: var(--green); }
.status-dot.down    { background: var(--red); }
.status-dot.unknown { background: var(--text-dim); }

/* ── Popular sites (Top Websites) ── */
.popular-sites { margin-bottom: 1rem; }
.popular-sites h2 { display: none; }

.sites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.category-section {
    display: contents;
}
.category-section > div:first-child {
    display: none !important;
}

.site-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.site-item:hover { background: #f5f7fa; }

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1000;
}
.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 380px;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--blue-dark); }

.modal-tabs { display: flex; margin-bottom: 1rem; }
.modal-tab {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    background: #f8f9fa;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
}
.modal-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.modal-tab:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.modal-tab.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

.modal-form input {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.modal-form input:focus { outline: none; border-color: var(--blue); }
.modal-form button {
    width: 100%;
    padding: 0.55rem;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
}
.modal-form button:hover { background: var(--blue-dark); }

/* ── Spinner ── */
.spinner {
    border: 2px solid var(--border);
    border-top: 2px solid var(--blue);
    border-radius: 50%;
    width: 24px; height: 24px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Language switcher ── */
.lang-switcher { position: relative; }
.lang-btn {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: border-color 0.15s;
}
.lang-btn:hover { border-color: var(--blue); }
.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.3rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 160px;
    z-index: 2000;
    max-height: 320px;
    overflow-y: auto;
}
.lang-menu.open { display: block; }
.lang-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.1s;
}
.lang-option:hover { background: #f5f7fa; text-decoration: none; }
.lang-option.active { background: #e8eef8; font-weight: 600; }
.lang-flag { font-size: 1.1rem; }

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 1rem 0;
    color: var(--text-dim);
    font-size: 0.72rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; text-align: center; gap: 0.5rem; }
    .auth-section { justify-content: center; }
    .sites-grid { grid-template-columns: 1fr; }
    .stat-item { padding: 0.4rem 0.25rem; }
    .stat-number { font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 0.5rem; }
    .input-group { flex-direction: column; }
    #checkBtn { padding: 0.7rem; font-size: 0.95rem; }
    #urlInput { padding: 0.7rem; }
}
