/* ========================================
   Layout - Containers, Grid, Sidebar
   ======================================== */

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

.container-wide {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 16px 16px;
}

.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 24px;
    align-items: start;
}

.main-content {
    min-width: 0;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 80px;
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.sidebar-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.sidebar-box + .sidebar-box {
    margin-top: 16px;
}

.sidebar-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-content {
    padding: 12px 16px;
}

.sidebar-boards {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-boards li {
    border-bottom: 1px solid var(--border-light);
}

.sidebar-boards li:last-child {
    border-bottom: none;
}

.sidebar-boards a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    transition: background 0.15s ease;
}

.sidebar-boards a:hover {
    background: var(--border-light);
    color: var(--primary);
}

.sidebar-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.sidebar-rules {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-rules li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.sidebar-rules li:last-child {
    border-bottom: none;
}

.sidebar-rules .rule-expandable {
    cursor: pointer;
}

.sidebar-rules .rule-expandable summary {
    list-style: none;
}

.sidebar-rules .rule-expandable summary::-webkit-details-marker {
    display: none;
}

.sidebar-rules .rule-name {
    font-weight: 600;
    color: var(--text);
    transition: color 0.15s ease;
}

.sidebar-rules .rule-expandable:hover .rule-name {
    color: var(--primary);
}

.sidebar-rules .rule-desc {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
}

.sidebar-footer a {
    color: var(--primary);
}

/* Sidebar Tags */
.sidebar-tags {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--border-light);
    border-radius: 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-tag:hover {
    background: var(--primary);
    color: #fff;
}

/* Sidebar Admins */
.sidebar-admins {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-admins li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sidebar-admins li:last-child {
    border-bottom: none;
}

.admin-badge {
    background: var(--border-light);
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid var(--border);
}

.admin-stats {
    font-size: 11px;
    color: var(--text-light);
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 10px;
    cursor: help;
}

.report-link {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-light);
}

.report-link:hover {
    color: var(--danger);
}

/* Admin Management */
.edit-sections {
    display: grid;
    gap: 32px;
}

.edit-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 24px;
}

.edit-section h2 {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.admin-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.admin-item:last-child {
    margin-bottom: 0;
}

.admin-name {
    flex: 1;
    font-weight: 500;
}

.add-admin-form {
    margin-top: 16px;
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-inline input {
    flex: 1;
}

.warning {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-top: 8px;
}

/* Sidebar toggle button (mobile only) */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--primary);
    transition: all 0.15s ease;
    margin-left: auto;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.sidebar-toggle svg {
    pointer-events: none;
}

.sidebar-toggle:hover {
    background: var(--primary);
    color: #fff;
}

/* Sidebar close button (mobile only) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    z-index: 10;
    appearance: none;
    -webkit-appearance: none;
}

.sidebar-close:hover {
    background: var(--border-light);
    color: var(--text);
}

/* Sidebar overlay (mobile only) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
}

/* New Post Button */
.new-post-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius);
    color: #fff;
    transition: all 0.15s ease;
    margin-left: auto;
}

.new-post-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.new-post-btn svg {
    width: 16px;
    height: 16px;
}

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

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}
