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

body {
    font-family: 'Martel Sans', Arial, Helvetica, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

a {
    color: #941c31;
}

a:hover {
    text-decoration: underline;
}

a img {
    border: none;
}

.header {
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), 
                url('/img/title3-44edf9fc9ce42986f7c491d66b5846ec.jpg');
    background-size: cover;
    background-position: center;
    padding: 20px;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.header p {
    font-size: 0.9em;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

nav {
    background-color: #800000;
    position: relative;
}

.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    background-color: #800000;
    color: white;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1.2em;
    user-select: none;
}

.nav-toggle-label:hover {
    background-color: #990000;
}

.nav-menu {
    display: flex;
    gap: 2px;
    padding: 0;
    list-style: none;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    background-color: #800000;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
    display: block;
}

.nav-menu a:hover {
    background-color: #990000;
}

@media (max-width: 768px) {
    .nav-toggle-label {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-menu a {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-toggle:checked ~ .nav-menu {
        display: flex;
    }
}

#topad {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 0 20px;
}

.main-content {
    background: white;
    border: 1px solid #ddd;
}

.content-header {
    background-color: #800000;
    color: white;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
}

.content-body {
    padding: 20px;
}

.article {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.article:last-child {
    border-bottom: none;
}

.article h2 {
    color: #800000;
    font-size: 1.3em;
    margin-bottom: 8px;
}

.article h2 a {
    color: #800000;
    text-decoration: none;
}

.article h2 a:hover {
    text-decoration: underline;
}

.article-meta {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
}

.article p {
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.article p:last-child {
    margin-bottom: 0;
}

.article-footer {
    margin-top: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9em;
    justify-content: flex-end;
}

.article-footer a {
    color: #800000;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-footer a:hover {
    text-decoration: underline;
}

.article-footer .comment-icon::before {
    content: "💬";
}

.article-footer .article-icon-link::before {
    content: "📄";
}

.article-icon {
    width: 60px;
    height: 60px;
    float: left;
    margin-right: 15px;
    background: #800000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8em;
    text-align: center;
    padding: 5px;
}

.more-news-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #800000;
}

.more-news-header {
    color: #800000;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.news-by-date {
    margin-bottom: 25px;
}

.news-date {
    color: #800000;
    font-size: 0.95em;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 5px 0;
    border-bottom: 1px dotted #ddd;
}

.news-list {
    list-style: none;
    padding-left: 0;
}

.news-list li {
    padding: 8px 0 8px 15px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.news-list li:hover {
    border-left-color: #800000;
    background-color: #f9f9f9;
}

.news-list a {
    color: #333;
    text-decoration: none;
    font-size: 0.95em;
    display: block;
}

.news-list a:hover {
    color: #800000;
    text-decoration: underline;
}

.thread-list {
    list-style: none;
}

.thread-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thread-item:hover {
    background-color: #f9f9f9;
}

.thread-title {
    flex: 1;
}

.thread-title a {
    color: #800000;
    text-decoration: none;
    font-weight: 500;
}

.thread-title a:hover {
    text-decoration: underline;
}

.thread-meta {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.thread-stats {
    text-align: right;
    font-size: 0.85em;
    color: #666;
    min-width: 150px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section,
.block {
    background: white;
    border: 1px solid #ddd;
}

.sidebar-header,
.block h2 {
    background-color: #800000;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    margin: 0;
    font-size: 1em;
}

.sidebar-content,
.block-contents {
    padding: 15px;
}

.sidebar-content ul,
.block-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-content li,
.block-contents li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-content li:last-child,
.block-contents li:last-child {
    border-bottom: none;
}

.sidebar-content a,
.block-contents a {
    color: #333;
    text-decoration: none;
    display: block;
}

.sidebar-content a:hover,
.block-contents a:hover {
    color: #800000;
}

.block-contents .main-links li,
.block-contents .sitemap-links li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.block-contents .forum-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.block-contents .forum-item {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.block-contents .forum-item:last-child {
    border-bottom: none;
}

.block-contents .forum-item a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    text-decoration: none;
}

.block-contents .forum-icon {
    font-size: 1.2em;
    flex-shrink: 0;
    margin-top: 2px;
}

.block-contents .forum-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.block-contents .forum-name {
    color: #800000;
    font-weight: 600;
    font-size: 0.95em;
    display: block;
}

.block-contents .forum-item a:hover .forum-name {
    text-decoration: underline;
}

.block-contents .forum-description {
    color: #999;
    font-size: 0.85em;
    line-height: 1.3;
    display: block;
}

.block-contents p {
    margin: 0;
    font-size: 0.9em;
}

.block-contents em {
    color: #666;
}

.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.search-box {
    display: flex;
    gap: 5px;
}

.search-box input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 0.9em;
}

.search-box button {
    padding: 8px 15px;
    background-color: #800000;
    color: white;
    border: none;
    cursor: pointer;
}

.search-box button:hover {
    background-color: #990000;
}

.live-score {
    background: #fff3cd;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    margin-top: 10px;
}

.live-score strong {
    color: #800000;
}

/* BBCode quote styling */
p.bbquote {
    margin: 10px 5px 5px 5px;
    padding: 8px 10px;
    background-color: #f5f5f5;
    border-left: 4px solid #ccc;
    font-weight: bold;
    font-size: 0.9em;
    color: #666;
}

div.bbquote {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-left: 4px solid #ccc;
    border-radius: 3px;
    padding: 12px 15px;
    margin: 10px 5px 15px 5px;
    font-style: italic;
    color: #555;
    position: relative;
}

/* Add subtle quote icon */
div.bbquote::before {
    content: '\201C';
    font-size: 2.5em;
    color: #ddd;
    position: absolute;
    top: -5px;
    left: 10px;
    font-family: Georgia, serif;
}

/* Forum-specific styles */
#side {width: 340px;}
#content { margin-right: 340px; }

/* Reactions component */
.post-reactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; margin-bottom: 12px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: #f0f0f0; border: 1px solid #ddd; border-radius: 12px; font-size: 0.9em; cursor: pointer; transition: all 0.2s; }
.reaction:hover { background: #e0e0e0; border-color: #ccc; }
.reaction.user-reacted { background: #800000; color: #fff; border-color: #800000; }
.reaction.user-reacted:hover { background: #990000; border-color: #990000; }
.reaction-emoji { font-size: 1.1em; }
.reaction-count { font-weight: 600; font-size: 0.85em; }
.add-reaction { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #f0f0f0; border: 1px dashed #ccc; border-radius: 12px; font-size: 1em; cursor: pointer; transition: all 0.2s; }
.add-reaction:hover { background: #e0e0e0; border-color: #800000; }
/* Picker visibility: hidden by default, flex when not hidden */
.reaction-picker { display: none; gap:6px; flex-wrap:wrap; margin-left:6px; }
.reaction-picker[hidden] { display: none !important; }
.reaction-picker:not([hidden]) { display: flex; }

@media (max-width: 968px) {
    .container {
        grid-template-columns: 1fr;
    }

    .article-icon {
        width: 50px;
        height: 50px;
        font-size: 0.7em;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .thread-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .thread-stats {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.4em;
    }

    .header p {
        font-size: 0.8em;
    }

    .container {
        padding: 0 10px;
        margin: 10px auto;
        gap: 10px;
    }

    .content-body {
        padding: 15px;
    }

    .article-icon {
        float: none;
        margin: 0 0 10px 0;
    }
}

footer {
    background-color: #800000;
    color: white;
    padding: 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85em;
    line-height: 1.6;
}

footer a {
    color: #ffcccc;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    footer {
        padding: 15px;
        font-size: 0.8em;
    }
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: #ddd;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

.post {
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.post-header {
    background: #800000;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-body {
    padding: 15px;
    background: white;
}

.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #800000;
}

.pagination a:hover {
    background: #800000;
    color: white;
}

.message-badge {
    background-color: #941c31;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    min-width: 18px;
    text-align: center;
    display: inline-block;
    line-height: 1.2;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-toast {
    background: white;
    border: 1px solid #ddd;
    border-left: 4px solid #941c31;
    border-radius: 6px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease-out;
    max-width: 100%;
}

.notification-toast:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.toast-title {
    color: #941c31;
    font-size: 0.9rem;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.toast-close:hover {
    background-color: #f0f0f0;
    color: #666;
}

.toast-body {
    padding: 8px 15px 12px;
    color: #333;
    font-size: 0.85rem;
    line-height: 1.4;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification-toast {
        max-width: 100%;
    }

    .toast-header {
        padding: 10px 12px 6px;
    }

    .toast-body {
        padding: 6px 12px 10px;
    }

    .toast-title {
        font-size: 0.85rem;
    }

    .toast-body {
        font-size: 0.8rem;
    }
}

.message-badge[style*="display: none"] {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.message-badge[style*="display: inline"] {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes messagesPulse {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(148, 28, 49, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

.messages-highlight {
    animation: messagesPulse 2s ease-in-out;
    border-radius: 4px;
}

/* Forum-specific styles */
.forum-content-header {
    background-color: #800000;
    color: white;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    margin: -20px -20px 20px -20px;
}

.forum-nav {
    font-size: 1.3em;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.forum-nav a {
    color: #800000;
    text-decoration: none;
}

.forum-nav a:hover {
    text-decoration: underline;
}

.forum-nav > :first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.forum-header h1 {
    color: #800000;
    font-size: 1.5em;
    margin: 0;
}

.forum-description {
    font-style: italic;
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.forum-nav .new-topic-btn,
.new-topic-btn {
    background-color: #800000;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.forum-nav .new-topic-btn:hover,
.new-topic-btn:hover {
    background-color: #990000;
    text-decoration: none;
}

/* Topics list */
.topics-list {
    border-top: 2px solid #800000;
}

.topic-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 5px 15px;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.topic-row:hover {
    background-color: #f9f9f9;
}

.topic-row.sticky {
    background-color: #fff9f0;
}

.topic-row.announce {
    background-color: #fff5f5;
}

.topic-icon {
    font-size: 1.5em;
    color: #666;
    grid-row: 1 / 3;
    align-self: center;
}

.topic-icon.sticky {
    color: #ff6b00;
}

.topic-icon.announce {
    color: #800000;
}

.topic-info {
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
}

.topic-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.topic-title a {
    color: #800000;
    text-decoration: none;
}

.topic-title a:hover {
    text-decoration: underline;
}

.topic-meta {
    font-size: 0.85em;
    color: #666;
    grid-column: 2;
    grid-row: 2;
}

.topic-pagination {
    display: inline-flex;
    gap: 3px;
    margin-left: 8px;
    font-size: 0.85em;
}

.topic-pagination a {
    color: #800000;
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.topic-pagination a:hover {
    background: #800000;
    color: white;
    border-color: #800000;
    text-decoration: none;
}

.topic-pagination .ellipsis {
    padding: 2px 4px;
    color: #999;
}

.topic-replies {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
    font-size: 0.9em;
    color: #800000;
    font-weight: 600;
    white-space: nowrap;
    align-self: start;
}

.topic-last {
    grid-column: 3;
    grid-row: 2;
    text-align: right;
    font-size: 0.85em;
    color: #666;
}

.topic-last::before {
    content: "last post: ";
    color: #999;
    font-size: 0.9em;
}

.topic-last-poster {
    color: #800000;
    font-weight: 500;
}

.topic-last-link {
    display: inline-block;
    margin-left: 6px;
    color: #800000;
    text-decoration: none;
    font-size: 1.1em;
    vertical-align: middle;
}

.topic-last-link:hover {
    color: #990000;
    text-decoration: none;
}

/* Forum Pagination - override general pagination for forums */
.forum-pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination-label {
    margin-right: 5px;
    color: #666;
}

.forum-pagination a,
.forum-pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #800000;
    min-width: 35px;
    text-align: center;
}

.forum-pagination a:hover {
    background: #800000;
    color: white;
    border-color: #800000;
    text-decoration: none;
}

.forum-pagination .current {
    background: #800000;
    color: white;
    border-color: #800000;
}

.forum-pagination .ellipsis {
    border: none;
    padding: 6px 8px;
    color: #999;
}

/* No topics message */
.no-topics {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Sponsored topic */
.topic-row.sponsored {
    background-color: #f9f9f9;
    border-left: 3px solid #ffc107;
}

.ad-label {
    font-size: 0.75em;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Forum responsive styles */
@media (max-width: 968px) {
    .topic-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto auto;
    }

    .topic-icon {
        display: none;
    }

    .topic-info {
        grid-column: 1;
        grid-row: 1;
    }

    .topic-replies {
        grid-column: 2;
        grid-row: 1;
    }

    .topic-meta {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    .topic-last {
        grid-column: 1 / 3;
        grid-row: 3;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .new-topic-btn {
        width: 100%;
        text-align: center;
    }
}

/* Static content pages (policies, about, etc.) */
.content-article {
    max-width: 820px;
    margin: 0 auto;
    line-height: 1.6;
}
.content-article header p { margin-top: 6px; color: #666; }
.content-article h1 { margin: 0 0 12px; }
.content-article h2 { margin: 24px 0 8px; color: #800000; font-size: 1.25em; }
.content-article h3 { margin: 18px 0 6px; font-size: 1.05em; }
.content-article p { margin: 0 0 16px; }
.content-article ul, .content-article ol { padding-left: 20px; margin: 0 0 12px; }
.content-article li { margin: 4px 0; }
.content-article a { color: #800000; }
.content-article section { margin-bottom: 20px; }
.content-article footer { margin-top: 20px; }

/* Lightweight table of contents */
.content-article nav.toc { 
    margin: 12px 0 20px; 
    padding: 10px 12px; 
    border: 1px solid #ddd; 
    background: #f9f9f9; 
    border-radius: 4px;
}
.content-article nav.toc ul { 
    margin: 0; 
    padding-left: 16px; 
    list-style: disc;
}
.content-article nav.toc li { 
    margin: 4px 0; 
}
.content-article nav.toc a {
    color: #800000;
    text-decoration: none;
}
.content-article nav.toc a:hover {
    text-decoration: underline;
}

/* Topic page styles */
.topic-content-header {
    background-color: #800000;
    color: white;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    margin: -20px -20px 20px -20px;
}

.topic-nav {
    font-size: 0.9em;
    margin-bottom: 15px;
    color: #666;
}

.topic-nav a {
    color: #800000;
    text-decoration: none;
}

.topic-nav a:hover {
    text-decoration: underline;
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.topic-header h1 {
    color: #800000;
    font-size: 1.5em;
    margin: 0;
}

.reply-topic-btn {
    background-color: #800000;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 0.95em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.reply-topic-btn:hover {
    background-color: #990000;
}

/* iOS-specific fixes for better touch support */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    button, 
    .reply-topic-btn,
    .post-action-btn,
    .btn-save-reply,
    .btn-cancel-reply,
    .reply-btn,
    .edit-btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        touch-action: manipulation;
    }
    
    /* Ensure Quill editor is touchable on iOS */
    .quill-editor,
    .ql-container,
    .ql-editor {
        -webkit-user-select: text !important;
        -webkit-touch-callout: default !important;
        touch-action: auto !important;
    }
    
    /* Fix for iOS keyboard not appearing */
    .ql-editor:focus {
        -webkit-user-select: text !important;
        user-select: text !important;
    }
}

/* Ensure all interactive buttons have proper cursor and touch targets */
.reply-topic-btn,
.post-action-btn,
.btn-save-reply,
.btn-cancel-reply {
    min-height: 44px; /* Apple's recommended minimum touch target */
    min-width: 44px;
    touch-action: manipulation; /* Prevent zoom on double-tap */
}

/* Posts list */
.posts-list {
    margin: 20px 0;
}

.post-container {
    background: white;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.post-container.sponsored {
    background-color: #f9f9f9;
    border-left: 3px solid #ffc107;
    padding: 15px;
}

.post-header {
    background-color: #800000;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-author {
    font-weight: 600;
    font-size: 1em;
}

.post-time {
    font-size: 0.9em;
    opacity: 0.9;
}

.post-body {
    display: flex;
    gap: 0;
}

.post-user-info {
    padding: 15px;
    width: 150px;
    flex-shrink: 0;
    text-align: center;
    border-right: 1px solid #e0e0e0;
}

.user-avatar-box {
    width: 80px;
    height: 80px;
    background-color: #FFC107;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
    font-size: 1.5em;
    color: #800000;
}

.user-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
    margin: 0 auto 10px;
    display: block;
}

.user-initials {
    text-transform: uppercase;
}

.user-stats {
    font-size: 0.8em;
    color: #666;
    line-height: 1.4;
}

.user-stat-line {
    margin: 3px 0;
}

.post-content {
    flex: 1;
    padding: 15px 20px;
    min-width: 0;
}

.post-content p {
    margin: 0 0 1em 0;
    line-height: 1.6;
}

.post-content p:last-child {
    margin-bottom: 0;
}


.reaction-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Post footer */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
}

.post-edit-note {
    font-size: 0.85em;
    color: #999;
    font-style: italic;
}

.post-actions {
    display: flex;
    gap: 10px;
}

.post-action-btn {
    background-color: #800000;
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.post-action-btn:hover {
    background-color: #990000;
}

.post-action-btn.edit-btn {
    background-color: transparent;
    color: #800000;
    border: 1px solid #800000;
}

.post-action-btn.edit-btn:hover {
    background-color: #800000;
    color: white;
}

/* Edit history */
.edit-history {
    margin-top: 10px;
}

.edit-history-btn {
    background: none;
    border: none;
    color: #800000;
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: underline;
}

.edit-history-btn:hover {
    color: #990000;
}

.editlist {
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}

.edit {
    margin: 5px 0;
    padding: 5px;
    background-color: white;
    border-left: 3px solid #ffc107;
    font-size: 0.85em;
}

/* Reply form */
.reply-form-container {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin: 20px 0;
}

.reply-form-container h3 {
    color: #800000;
    margin-bottom: 15px;
}

.reply-form-container textarea {
    width: 100%;
    min-height: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 0.95em;
    resize: vertical;
    box-sizing: border-box;
}

.reply-form-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.btn-save-reply,
.btn-cancel-reply {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s;
}

.btn-save-reply {
    background-color: #800000;
    color: white;
}

.btn-save-reply:hover {
    background-color: #600000;
}

.btn-cancel-reply {
    background-color: #6c757d;
    color: white;
}

.btn-cancel-reply:hover {
    background-color: #5a6268;
}

.edit-post-form {
    background: #f9f9f9;
    padding: 20px;
    border: 2px solid #800000;
    border-radius: 4px;
    margin: 10px 0;
}

.edit-post-form .form-group {
    margin-bottom: 15px;
}

.edit-post-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.edit-post-form textarea,
.edit-post-form input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95em;
    box-sizing: border-box;
}

.edit-post-form textarea {
    min-height: 200px;
    resize: vertical;
}

.edit-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-save-edit,
.btn-cancel-edit {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-save-edit {
    background-color: #800000;
    color: white;
}

.btn-save-edit:hover {
    background-color: #600000;
}

.btn-cancel-edit {
    background-color: #6c757d;
    color: white;
}

.btn-cancel-edit:hover {
    background-color: #5a6268;
}

.editing-mode {
    position: relative;
}

.post-actions[style*="display: none"] ~ * {
    pointer-events: none;
}

@media (max-width: 768px) {
    .edit-post-form {
        padding: 15px;
    }
    
    .edit-form-actions {
        flex-direction: column;
    }
    
    .btn-save-edit,
    .btn-cancel-edit {
        width: 100%;
        justify-content: center;
    }
}

/* Topic bottom */
.topic-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

/* Moderation panel styles */
.moderation-wrapper {
    margin: 1rem 0;
}

.moderation-toggle-btn {
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.moderation-toggle-btn:hover {
    background-color: #e8e8e8;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
}

.moderation-toggle-btn.expanded .toggle-icon {
    transform: rotate(90deg);
}

.moderation-container {
    margin-top: 1rem;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 2000px;
    opacity: 1;
}

.moderation-container.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.loading-moderation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    font-size: 0.9rem;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Topic page responsive styles */
@media (max-width: 768px) {
    .post-body {
        flex-direction: column;
    }

    .post-user-info {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 10px;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .user-avatar-box {
        width: 50px;
        height: 50px;
        font-size: 1.2em;
        margin: 0;
    }

    .user-avatar-img {
        width: 50px;
        height: 50px;
        margin: 0;
    }

    .user-stats {
        text-align: left;
    }

    .post-content {
        padding: 15px;
    }

    .topic-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reply-topic-btn {
        width: 100%;
        text-align: center;
    }

    .topic-bottom {
        flex-direction: column;
    }

    .moderation-wrapper {
        margin: 0.5rem 0;
    }

    .moderation-toggle-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .loading-moderation {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .loading-spinner {
        width: 16px;
        height: 16px;
    }
}

/* === Auth (login/register/reset) === */
.auth-wrap{max-width:560px;margin:24px auto}
.auth-card{background:#fff;border:1px solid #e0e0e0;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.06);overflow:hidden}
.auth-header{background:#800000;color:#fff;padding:14px 18px;font-weight:700;letter-spacing:.2px}
.auth-body{padding:22px}

/* alerts */
.auth-alert{padding:12px 14px;border-radius:6px;font-weight:600;margin-bottom:16px}
.auth-alert.error{background:#fde8ea;color:#7a1d26;border:1px solid #f1b6bd}
.auth-alert.success{background:#e7f6ec;color:#1c6d3a;border:1px solid #b9e2c7}

/* form */
.auth-field{margin-bottom:16px}
.auth-label{display:block;font-weight:600;margin:0 0 6px;color:#333}
.auth-input{width:100%;padding:12px 14px;border:1px solid #d7d7d7;border-radius:6px;font-size:1rem}
.auth-input:focus{outline:none;border-color:#800000;box-shadow:0 0 0 3px rgba(128,0,0,.12)}

.auth-remember{display:flex;align-items:center;gap:8px;color:#666;margin:4px 0 6px}

.auth-actions{margin-top:6px}
.auth-btn{width:100%;background:#800000;border:none;color:#fff;padding:12px 14px;border-radius:6px;font-weight:700;cursor:pointer}
.auth-btn:hover{background:#600000}

.auth-footer{margin-top:18px;padding-top:14px;border-top:1px solid #e0e0e0;color:#666;font-size:.95rem}
.auth-footer a{color:#800000;text-decoration:none}
.auth-footer a:hover{text-decoration:underline}

@media (max-width:480px){.auth-body{padding:16px}.auth-header{padding:12px 14px}}

/* Forums list page */
.forums-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

.forums-header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.4rem;
    font-weight: 600;
}

.forum-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.forum-section .forum-header {
    background: #8B0000;
    padding: 10px 15px;
    border-bottom: 2px solid #6B0000;
}

.forum-section .forum-header h2 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.forum-section .forum-header h2 a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.forum-section .forum-header h2 a:hover {
    opacity: 0.9;
    text-decoration: underline;
}

.forum-section .forum-description {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 0.85rem;
}

.recent-posts {
    padding: 10px 15px;
}

.recent-posts h3 {
    color: #800000;
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-section .topics-list {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.forum-section .topic-row {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.forum-section .topic-row:last-child {
    border-bottom: none;
}

.forum-section .topic-row:hover {
    background-color: #f8f9fa;
}

.forum-section .topic-info {
    padding: 6px 10px;
}

.forum-section .topic-title {
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.forum-section .topic-icon {
    font-size: 0.85rem;
    opacity: 0.7;
}

.forum-section .topic-title a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.3;
    flex: 1;
    transition: color 0.2s;
}

.forum-section .topic-title a:hover {
    color: #8B0000;
    text-decoration: underline;
}

.forum-section .topic-meta {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.forum-section .topic-meta .sep {
    opacity: 0.5;
}

.forum-section .topic-meta .stats {
    color: #666;
    font-weight: 500;
}

.forum-section .topic-meta .author {
    color: #555;
}

.view-all {
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.view-all-btn {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.view-all-btn:hover {
    color: #8B0000;
    text-decoration: underline;
}

.no-posts {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.start-discussion-btn {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    display: inline-block;
    margin-top: 15px;
    transition: background-color 0.2s;
}

.start-discussion-btn:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

.no-forums {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

@media (max-width: 768px) {
    .forums-container {
        padding: 15px;
    }
    
    .forum-section .forum-header, .recent-posts {
        padding: 12px 15px;
    }

    .forum-section .topic-info {
        padding: 8px 10px;
    }

    .forum-section .topic-meta {
        margin-top: 4px;
        font-size: 0.8rem;
    }
    
    .forum-section .forum-header h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .forums-container {
        padding: 10px;
    }
    
    .forum-section .forum-header, .recent-posts {
        padding: 10px 12px;
    }
}


/* Quill Editor Styles */
.quill-editor {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 200px;
}

.ql-toolbar {
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background-color: #f8f9fa;
}

.ql-container {
    font-family: 'Martel Sans', Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.ql-editor {
    min-height: 200px;
    padding: 12px 15px;
}

.ql-editor.ql-blank::before {
    color: #999;
    font-style: italic;
}

/* Ensure Quill editor is responsive */
@media (max-width: 767px) {
    .ql-editor {
        min-height: 150px;
    }
}


/* Blockquote styles for rendered post content */
.post-text-content blockquote,
.post-content blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    border-left: 4px solid #941c31;
    background-color: #f9f9f9;
    color: #555;
    font-style: italic;
}

.post-text-content blockquote p,
.post-content blockquote p {
    margin: 0.5em 0;
}

.post-text-content blockquote p:first-child,
.post-content blockquote p:first-child {
    margin-top: 0;
}

.post-text-content blockquote p:last-child,
.post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code block styles for rendered posts */
.post-text-content pre,
.post-content pre {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

.post-text-content code,
.post-content code {
    background-color: #f4f4f4;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.post-text-content pre code,
.post-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* List styles for rendered posts */
.post-text-content ul,
.post-content ul {
    margin: 1em 0;
    padding-left: 2em;
}

.post-text-content ol,
.post-content ol {
    margin: 1em 0;
    padding-left: 2em;
}

.post-text-content li,
.post-content li {
    margin: 0.25em 0;
}
