/* Noticion - Modern News & Comments UI */

:root {
    --bg-primary: #f5f6f8;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-header: #1b1f2e;
    --bg-header-accent: #e63946;
    --bg-tag: #eef1f6;
    --bg-form: #f8f9fb;
    --bg-comment: #f8f9fb;
    --bg-you: #edf7ed;
    --bg-hover: #f0f2f5;

    --border: #e2e5ea;
    --border-light: #eceef2;
    --border-you: #8bc58b;

    --text-primary: #1a1d26;
    --text-secondary: #5c6270;
    --text-muted: #8a8f9d;
    --text-inverse: #ffffff;

    --accent: #2d5be3;
    --accent-hover: #1e45b8;
    --accent-light: #e8edfb;
    --link: #2d5be3;
    --link-hover: #c0392b;
    --green: #2a9d5c;
    --green-light: #e6f5ec;
    --red: #d9534f;
    --red-light: #fce8e8;
    --orange: #e8870e;
    --orange-light: #fef3e0;
    --name-color: #2a9d5c;
    --trip-color: #1a8a4a;
    --sage-color: #8a8f9d;
    --quote-color: #789922;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--link-hover);
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   Header
   ========================================= */
.site-header {
    background: var(--bg-header);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.site-title {
    font-size: 0;
}

.site-title a {
    color: var(--text-inverse);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-title a:hover {
    color: var(--text-inverse);
    opacity: 0.9;
}

.site-title .accent-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--bg-header-accent);
    border-radius: 50%;
}

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

.site-nav a {
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* =========================================
   Board Header (section title)
   ========================================= */
.board-header {
    text-align: center;
    padding: 32px 20px 24px;
}

.board-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.board-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.board-subtitle a {
    color: var(--text-secondary);
    font-weight: 500;
}

.board-subtitle a:hover {
    color: var(--accent);
}

/* =========================================
   Post List (Index Page)
   ========================================= */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.post-preview:hover {
    box-shadow: var(--shadow-md);
    border-color: #d0d4db;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.post-number {
    color: var(--text-secondary);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 11px;
}

.post-source {
    font-weight: 500;
    color: var(--text-secondary);
}

.post-category {
    display: inline-block;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.post-headline {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
}

.post-headline a {
    color: var(--text-primary);
}

.post-headline a:hover {
    color: var(--accent);
}

.post-summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-reply {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
}

.btn-reply:hover {
    color: var(--accent-hover);
}

/* =========================================
   Pagination
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 28px 0;
}

.btn-page {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-page:hover {
    background: var(--bg-hover);
    border-color: #d0d4db;
    color: var(--text-primary);
}

.page-info {
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 8px;
}

/* =========================================
   Thread OP (Single Post View)
   ========================================= */
.thread-op {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.post-header {
    margin-bottom: 14px;
}

.post-header .post-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-name {
    color: var(--name-color);
    font-weight: 600;
}

.post-date {
    color: var(--text-muted);
    font-size: 12px;
}

.post-subject {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    letter-spacing: -0.3px;
}

.post-content {
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 15px;
}

.post-link {
    margin-top: 18px;
}

.post-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.post-link a:hover {
    background: var(--accent);
    color: #fff;
}

.thread-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 24px 0;
}

/* =========================================
   Reply Form
   ========================================= */
.reply-form-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.reply-form-container h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 91, 227, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-hint {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 6px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sage-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.sage-label input[type="checkbox"] {
    accent-color: var(--accent);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-submit:hover {
    background: var(--accent-hover);
}

/* =========================================
   Comments Section
   ========================================= */
.comments-section {
    margin-top: 8px;
}

.comments-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.comment {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 10px;
    transition: box-shadow 0.15s;
}

.comment:target {
    box-shadow: 0 0 0 2px var(--accent);
}

.comment.reply {
    margin-top: 8px;
    border-left: 3px solid var(--border);
    border-radius: var(--radius-sm);
}

.comment.you {
    background: var(--bg-you);
    border-color: var(--border-you);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.comment-name {
    color: var(--name-color);
    font-weight: 700;
    font-size: 13px;
}

.comment-name .tripcode {
    color: var(--trip-color);
    font-family: var(--font-mono);
    font-size: 11px;
}

.comment-date {
    color: var(--text-muted);
}

.comment-number {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.you-tag {
    background: var(--green-light);
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sage-tag {
    background: var(--bg-tag);
    color: var(--sage-color);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.quote-link {
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

.quote-link:hover {
    color: var(--accent-hover);
}

.comment-content {
    line-height: 1.65;
    word-wrap: break-word;
    color: var(--text-primary);
    font-size: 14px;
}

.reply-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
}

.reply-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

/* =========================================
   Report Button & Modal
   ========================================= */
.report-btn {
    font-size: 11px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    font-family: var(--font-sans);
    border-radius: 3px;
    transition: all 0.15s;
}

.report-btn:hover {
    color: var(--red);
    background: var(--red-light);
}

.report-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
}

.report-modal-content {
    background: var(--bg-card);
    margin: 12% auto;
    padding: 28px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.report-modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.report-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.15s;
}

.report-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.report-modal-content > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.report-reasons {
    margin: 14px 0;
}

.report-reasons label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background 0.1s;
}

.report-reasons label:hover {
    background: var(--bg-hover);
}

.report-reasons input[type="radio"] {
    accent-color: var(--accent);
}

.report-submit-btn {
    width: 100%;
    padding: 10px 20px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

.report-submit-btn:hover {
    background: #c0392b;
}

.report-success {
    color: var(--green);
    font-weight: 600;
    padding: 12px;
    background: var(--green-light);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

.report-error {
    color: var(--red);
    padding: 12px;
    background: var(--red-light);
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}

/* =========================================
   Image Preview (comment form)
   ========================================= */
.image-preview-container {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-form);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.image-preview-container img {
    max-width: 180px;
    max-height: 180px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.image-preview-container .remove-image {
    color: var(--red);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.image-preview-container .remove-image:hover {
    text-decoration: underline;
}

.paste-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* =========================================
   Comment Images
   ========================================= */
.comment-image {
    margin: 10px 0;
}

.comment-image img {
    max-width: 250px;
    max-height: 250px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: max-width 0.3s, max-height 0.3s;
}

.comment-image img.expanded {
    max-width: 100%;
    max-height: none;
}

.comment-image .image-info {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: var(--font-mono);
}

/* =========================================
   Admin Panel
   ========================================= */
.admin-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-stats {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.admin-stats span {
    background: var(--bg-tag);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.admin-section {
    margin-bottom: 30px;
}

.admin-section h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.report-queue {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: box-shadow 0.15s;
}

.report-item:hover {
    box-shadow: var(--shadow-sm);
}

.report-item.resolved {
    opacity: 0.65;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.report-id {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.report-reason {
    display: inline-block;
    background: var(--red);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.report-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.report-target {
    background: var(--bg-form);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin: 12px 0;
    font-size: 14px;
}

.report-target-type {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.report-actions button {
    padding: 8px 18px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.report-actions button:hover {
    background: var(--bg-hover);
}

.report-actions .btn-dismiss {
    background: var(--bg-tag);
    color: var(--text-secondary);
}

.report-actions .btn-delete {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.report-actions .btn-delete:hover {
    background: #c0392b;
}

.report-actions .btn-ban {
    background: var(--orange);
    color: white;
    border-color: var(--orange);
}

.report-actions .btn-ban:hover {
    background: #d07d0d;
}

.resolution-note {
    margin-top: 12px;
}

.resolution-note input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
}

.resolution-note input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 91, 227, 0.1);
}

.no-reports {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.resolution-text {
    margin-top: 8px;
    padding: 10px 14px;
    background: var(--bg-tag);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

/* =========================================
   Admin Login
   ========================================= */
.admin-login {
    max-width: 400px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-md);
}

.admin-login h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    text-align: center;
}

.admin-login .error-msg {
    background: var(--red-light);
    color: var(--red);
    padding: 10px 14px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
}

.admin-login .form-group {
    margin-bottom: 20px;
}

.admin-login .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.admin-login .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
}

.admin-login .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 91, 227, 0.1);
}

.admin-login .btn-login {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.admin-login .btn-login:hover {
    background: var(--accent-hover);
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
    margin-top: 48px;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 13px;
}

.site-footer p + p {
    margin-top: 4px;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    .site-header .container {
        flex-direction: column;
        height: auto;
        padding: 12px 14px;
        gap: 8px;
    }

    .site-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .site-nav a {
        font-size: 12px;
        padding: 5px 10px;
        white-space: nowrap;
    }

    .board-header {
        padding: 24px 14px 18px;
    }

    .board-header h2 {
        font-size: 19px;
    }

    .post-preview {
        padding: 14px 16px;
    }

    .post-headline {
        font-size: 16px;
    }

    .thread-op {
        padding: 18px;
    }

    .post-subject {
        font-size: 19px;
    }

    .reply-form-container {
        padding: 18px;
    }

    .comment {
        padding: 14px 16px;
        margin-left: 0 !important;
    }

    .comment-header {
        gap: 6px;
    }

    .quote-link {
        margin-left: 0;
    }

    .report-modal-content {
        margin: 20% auto;
        padding: 20px;
    }

    .admin-stats {
        flex-direction: column;
        gap: 8px;
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions button {
        width: 100%;
        text-align: center;
    }

    .pagination {
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    .post-meta {
        gap: 6px;
    }

    .post-headline {
        font-size: 15px;
    }

    .admin-login {
        margin: 30px 14px;
        padding: 24px 20px;
    }
}
