/* Distinct backgrounds for admin sections */
.admin-section-bg-registration { background: #f7f7fa; }
.admin-section-bg-usercolors { background: #e5f4fa; }
.admin-section-bg-boards { background: #f9f5e7; }
.admin-section-bg-appearance { background: #f3e7fa; }
.admin-section-bg-groups { background: #e7fae7; }
.admin-section-bg-edit { background: #fae7e7; }
.admin-section-bg-log { background: #f7e7fa; }

.admin-options-title {
    font-size: 2em;
    font-weight: bold;
    color: #003399;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px #b6b7b8;
    padding: 12px 0 8px 0;
}
/* Admin panel section headers and spacing */
.admin-options-title {
    font-size: 2em;
    font-weight: bold;
    color: #003399;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.admin-options-section {
    margin-bottom: 38px;
    padding-bottom: 8px;
    border-bottom: 1px solid #b6b7b8;
}
body {
    background: #b6b7b8;
    color: #222;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}
.main-container {
    margin: 30px auto;
    width: 90%;
    max-width: 1100px;
    background: #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 2px 8px #888;
    padding-bottom: 30px;
    border: 1px solid #888;
}
.header {
    background: #6d6e71;
    padding: 16px 24px;
    font-size: 1.2em;
    border-radius: 6px 6px 0 0;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px #444;
}
.stats-bar {
    background: #d1d2d4;
    color: #222;
    padding: 10px 24px;
    font-size: 1em;
    border-bottom: 2px solid #b6b7b8;
}
.stats-bar .highlight {
    color: #003399;
    font-weight: bold;
    background: #f7f7fa;
    padding: 1px 4px;
    border-radius: 3px;
}
.category {
    margin: 24px 0 0 0;
    background: #c7c8ca;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px #bbb;
    border: 1px solid #b6b7b8;
}
.category-header {
    background: #a7a8aa;
    color: #222;
    font-size: 1.1em;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #b6b7b8;
    text-shadow: 1px 1px 2px #444;
}
.toggle-btn {
    margin-right: 10px;
    font-size: 1.2em;
    color: #222;
}
.category-title {
    font-weight: bold;
}
.boards-list {
    background: #e5e5e5;
    padding: 0 0 10px 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}
th, td {
    padding: 10px 12px;
    text-align: left;
}
th {
    background: #a7a8aa;
    color: #222;
    border-bottom: 2px solid #b6b7b8;
}
td {
    background: #e5e5e5;
    color: #222;
    border-bottom: 1px solid #b6b7b8;
}
.board-link {
    color: #003399;
    font-weight: bold;
    text-decoration: underline;
}
.board-link:hover {
    color: #ffe066;
}
.board-desc {
    color: #444;
    font-size: 0.95em;
    margin-left: 6px;
}
.last-post-link {
    color: #003399;
    text-decoration: underline;
}
.last-post-link:hover {
    color: #ffe066;
}
body.admin {
    background: #b6b7b8;
    color: #222;
}
.admin-container {
    margin: 30px auto;
    width: 90%;
    max-width: 900px;
    background: #e5e5e5;
    border-radius: 6px;
    box-shadow: 0 2px 8px #888;
    padding: 30px 30px 30px 30px;
    border: 1px solid #888;
}
.admin-header {
    background: #6d6e71;
    padding: 16px 24px;
    font-size: 1.2em;
    border-radius: 6px 6px 0 0;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px #444;
    margin-bottom: 20px;
}
.admin-section-title {
    color: #003399;
    font-size: 1.1em;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}
.admin-form input[type="text"], .admin-form button {
    font-size: 1em;
    padding: 5px 8px;
    margin-right: 5px;
    border-radius: 3px;
    border: 1px solid #b6b7b8;
}
.admin-form button {
    background: #a7a8aa;
    color: #222;
    font-weight: bold;
    cursor: pointer;
}
.admin-form button:hover {
    background: #003399;
    color: #fff;
}
.admin-list, .admin-list ul {
    list-style: none;
    padding-left: 0;
}
.admin-list > li {
    background: #c7c8ca;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #b6b7b8;
    padding: 10px;
}
.admin-list ul > li {
    background: #e5e5e5;
    margin: 5px 0;
    border-radius: 3px;
    border: 1px solid #b6b7b8;
    padding: 6px 10px;
}
.admin-list form {
    display: inline;
}
.thread-form-container {
    background: #f7f7fa;
    border: 1px solid #b6b7b8;
    border-radius: 6px;
    padding: 24px 32px 20px 32px;
    max-width: 520px;
    margin: 0 auto 30px auto;
    box-shadow: 0 2px 8px #bbb;
}
.thread-form-title {
    color: #003399;
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 1.2em;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.thread-form .form-group {
    margin-bottom: 18px;
}
.thread-form label {
    display: block;
    font-weight: bold;
    color: #222;
    margin-bottom: 6px;
}
.thread-form input[type="text"],
.thread-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #b6b7b8;
    border-radius: 4px;
    font-size: 1em;
    background: #fff;
    color: #222;
    box-sizing: border-box;
    transition: border 0.2s;
}
.thread-form input[type="text"]:focus,
.thread-form textarea:focus {
    border: 1.5px solid #003399;
    outline: none;
}
.thread-form .form-actions {
    text-align: right;
}
.thread-form button {
    background: #003399;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}
.thread-form button:hover {
    background: #001f66;
}
.form-error {
    color: #c00;
    background: #f7f7fa;
    border: 1px solid #b6b7b8;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 16px;
    font-weight: bold;
}
.thread-messages {
    margin-bottom: 30px;
}
.thread-message {
    background: #f7f7fa;
    border: 1px solid #b6b7b8;
    border-radius: 6px;
    margin-bottom: 18px;
    padding: 18px 24px 12px 24px;
    box-shadow: 0 1px 4px #bbb;
}
.thread-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.thread-message-user {
    color: #003399;
    font-weight: bold;
    font-size: 1.05em;
}
.thread-message-time {
    color: #888;
    font-size: 0.98em;
    margin-left: 16px;
}
.thread-message-edit form {
    display: inline;
}
.thread-message-edit input[type="text"] {
    width: 220px;
    padding: 4px 8px;
    border: 1px solid #b6b7b8;
    border-radius: 3px;
    font-size: 1em;
    margin-right: 6px;
}
.thread-message-edit button {
    background: #003399;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 3px;
    padding: 4px 12px;
    font-size: 0.98em;
    cursor: pointer;
    transition: background 0.2s;
}
.thread-message-edit button:hover {
    background: #001f66;
}
.thread-table-container {
    margin: 32px 0 0 0;
    padding: 0 24px;
}
.thread-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #e5e5e5;
    border: 1px solid #b6b7b8;
    box-shadow: 0 2px 8px #bbb;
    border-radius: 6px;
    overflow: hidden;
}
.thread-table th {
    background: #a7a8aa;
    color: #222;
    font-weight: bold;
    padding: 12px 10px;
    border-bottom: 2px solid #b6b7b8;
    text-align: left;
}
.thread-user-col {
    width: 180px;
}
.thread-message-col {
    width: auto;
}
.thread-row {
    border-bottom: 1px solid #b6b7b8;
}
.thread-user-cell {
    background: #c7c8ca;
    vertical-align: top;
    padding: 16px 12px 12px 16px;
    border-right: 1px solid #b6b7b8;
    min-width: 140px;
    max-width: 200px;
}
.thread-username {
    color: #003399;
    font-weight: bold;
    font-size: 1.08em;
    margin-bottom: 8px;
}
.thread-time {
    color: #888;
    font-size: 0.97em;
    margin-top: 6px;
}
.thread-message-cell {
    background: #e5e5e5;
    padding: 16px 18px 12px 18px;
    vertical-align: top;
    position: relative;
}
.thread-message-content {
    color: #222;
    font-size: 1.08em;
    white-space: pre-line;
    margin-bottom: 6px;
    margin-top: 0;
}
.thread-edit-btn-row-bottom {
    position: absolute;
    right: 18px;
    bottom: 12px;
    margin-top: 12px;
    text-align: right;
}
.thread-edit-btn-row-bottom button {
    background: #003399;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 3px;
    padding: 4px 12px;
    font-size: 0.98em;
    cursor: pointer;
    transition: background 0.2s;
}
.thread-edit-btn-row-bottom button:hover {
    background: #001f66;
}
.header a,
.stats-bar a,
.admin-header a,
.site-title a {
    color: #003399 !important;
    text-decoration: underline;
}
.header a:hover,
.stats-bar a:hover,
.admin-header a:hover,
.site-title a:hover {
    color: #001f66 !important;
}
.site-title a {
    color: #fff !important;
    text-decoration: none;
}
.site-title a:hover {
    color: #ffe066 !important;
    text-decoration: underline;
}

/* Private message reply styles */
.pm-reply-form .bb-toolbar {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin-bottom:8px;
}
.bb-btn {
    background:#fff;
    border:1px solid #b6b7b8;
    padding:6px 10px;
    border-radius:6px;
    cursor:pointer;
    font-weight:bold;
    color:#222;
}
.bb-btn:hover { background:#f3f6fa; }
.pm-reply-textarea {
    width:100%;
    min-height:120px;
    padding:10px 12px;
    border-radius:6px;
    border:1px solid #b6b7b8;
    box-shadow:inset 0 1px 3px #0001;
    resize:vertical;
    font-size:1em;
}
.pm-send-btn {
    background:#003399;
    color:#fff;
    border:none;
    border-radius:6px;
    padding:8px 16px;
    font-weight:bold;
    cursor:pointer;
}
.pm-send-btn:hover { background:#001f66; }

/* Align reply form with thread table and give it a distinct panel look */
.thread-table-container .pm-reply-form {
    background: #f7f9fc;
    border: 1px solid #d1d2d4;
    padding: 16px;
    border-radius: 8px;
    margin-top: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.thread-table-container .pm-reply-form .bb-toolbar { margin-bottom:10px; }
.thread-table-container .pm-reply-form .pm-reply-textarea { min-height:120px; }
.thread-table-container .pm-reply-form .pm-send-btn { margin-top:6px; }

/* PM panel (polished reply UI) */
.pm-panel {
    background: #fff;
    border: 1px solid #e0e4e8;
    border-radius: 10px;
    overflow: hidden;
}
.pm-panel-header {
    background: linear-gradient(180deg,#f3f7fb,#eef4fb);
    padding:12px 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid #e6eaed;
}
.pm-panel-title { font-weight:bold; color:#003366; }
.pm-panel-actions { color:#666; font-size:0.95em; }
.pm-panel-body { padding:14px 16px; }
.pm-panel-footer { background:#fafbfd; padding:10px 12px; display:flex; justify-content:space-between; align-items:center; border-top:1px solid #eef4fb; }
.pm-back-link { color:#666; text-decoration:none; }
.pm-back-link:hover { text-decoration:underline; }

/* toolbar tweaks */
.pm-panel .bb-toolbar { display:flex; gap:8px; flex-wrap:wrap; }
.pm-panel .bb-btn { background:#fff; border:1px solid #d1d2d4; padding:6px 10px; border-radius:6px; cursor:pointer; }
.pm-panel .bb-btn:hover { background:#f3f6fa; }
.pm-panel .pm-reply-textarea { width:100%; min-height:140px; border:1px solid #dfe6ea; border-radius:6px; padding:10px; box-sizing:border-box; resize:vertical; }
.pm-panel .pm-send-btn { background:#0070cc; color:#fff; border:none; padding:8px 14px; border-radius:6px; font-weight:bold; cursor:pointer; }
.pm-panel .pm-send-btn:hover { background:#005fa3; }

@media (max-width:720px) {
    .pm-panel-header, .pm-panel-body, .pm-panel-footer { padding-left:10px; padding-right:10px; }
}
