/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Main content */
main {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Forum styles */
.forum-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category {
    margin-bottom: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.category-header {
    background-color: #34495e;
    color: white;
    padding: 1rem;
}

.category-header h2 {
    margin-bottom: 0.5rem;
}

.boards-list {
    padding: 0;
}

.board-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.board-item:last-child {
    border-bottom: none;
}

.board-info h3 {
    margin-bottom: 0.5rem;
}

.board-info h3 a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.board-info h3 a:hover {
    text-decoration: underline;
}

.board-stats {
    display: flex;
    gap: 1rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-weight: bold;
    font-size: 1.2rem;
    color: #2c3e50;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.board-last-post {
    text-align: right;
    font-size: 0.9rem;
}

.last-post-time {
    color: #7f8c8d;
}

/* Authentication forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: #7f8c8d;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

/* IMPROVED BOARD VIEW */
.board-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threads-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.threads-header {
    background-color: #34495e;
    color: white;
    padding: 1rem;
    display: grid;
    grid-template-columns: 2fr 120px 80px 80px 160px;
    gap: 1rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.thread-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: grid;
    grid-template-columns: 2fr 120px 80px 80px 160px;
    gap: 1rem;
    align-items: center;
    transition: background-color 0.2s;
}

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

.thread-item:last-child {
    border-bottom: none;
}

.thread-item.pinned {
    background-color: #fef9e7;
}

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

/* IMPROVED THREAD TITLE STYLING */
.thread-title {
    min-width: 0;
}

.thread-title a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    display: block;
}

.thread-title a:hover {
    color: #3498db;
    text-decoration: underline;
}

.pin-icon, .lock-icon {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* IMPROVED METADATA STYLING */
.thread-author {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-align: center;
}

.thread-stats {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.thread-last-post {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-align: right;
}

.thread-last-post strong {
    color: #2c3e50;
    font-weight: 500;
}

.last-post-time {
    color: #95a5a6;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* IMPROVED THREAD VIEW */
.thread-header {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.thread-header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.thread-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.posts-list {
    margin-bottom: 2rem;
}

/* BETTER BALANCED POST LAYOUT */
.post {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 160px 1fr; /* EVEN NARROWER SIDEBAR */
    overflow: hidden;
    min-height: 100px; /* REDUCED MINIMUM HEIGHT */
}

.post-sidebar {
    background-color: #f8f9fa;
    padding: 1rem 0.75rem; /* TIGHTER PADDING */
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-info {
    width: 100%;
}

.user-info h3 {
    margin-bottom: 0.5rem; /* REDUCED MARGIN */
    color: #2c3e50;
    font-size: 0.95rem; /* SLIGHTLY SMALLER */
    font-weight: 600;
}

.avatar, .avatar-placeholder {
    width: 50px; /* SMALLER AVATAR */
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 0.5rem; /* REDUCED MARGIN */
    display: block;
}

.avatar-placeholder {
    background-color: #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-stats {
    font-size: 0.75rem; /* SMALLER TEXT */
    color: #7f8c8d;
    line-height: 1.2;
}

.user-stats div {
    margin-bottom: 0.15rem;
}

/* IMPROVED POST CONTENT */
.post-content {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

/* MUCH BETTER POST HEADER */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
}

/* PROMINENT POST NUMBER */
.post-number {
    font-weight: 700; /* BOLDER */
    color: #3498db;
    font-size: 0.95rem; /* LARGER */
    padding: 0.2rem 0.5rem;
    background-color: #ecf0f1;
    border-radius: 3px;
    border: 1px solid #bdc3c7;
}

.post-date {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.quote-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #7f8c8d;
    transition: all 0.2s;
    font-weight: 500;
}

.quote-btn:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

/* MUCH IMPROVED QUOTE STYLING */
.quoted-post {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border: 1px solid #ddd;
    border-left: 4px solid #3498db;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* BETTER QUOTE HEADER */
.quoted-post strong {
    display: block;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 0.5rem 1rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid #2980b9;
}

/* BETTER QUOTE CONTENT */
.quoted-content {
    padding: 0.75rem 1rem;
    color: #5a6c7d;
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.4;
    background: rgba(255,255,255,0.5);
}

/* IMPROVED POST BODY */
.post-body {
    line-height: 1.7;
    color: #2c3e50;
    flex-grow: 1;
    font-size: 1rem;
}

.post-body p {
    margin-bottom: 1rem;
}

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

.signature {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

.edit-notice {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #95a5a6;
    font-style: italic;
}

.reply-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-prompt, .locked-notice {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

/* Form styles */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* IMPROVED PROFILE STYLES */
.profile-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.avatar-large, .avatar-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.avatar-placeholder-large {
    background-color: #bdc3c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.profile-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-stats .stat {
    display: flex;
    gap: 1rem;
}

.stat-label {
    font-weight: bold;
    min-width: 80px;
}

.profile-signature {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.recent-activity .thread-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    grid-template-columns: none;
}

.recent-activity .thread-item:last-child {
    border-bottom: none;
}

.thread-board {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.thread-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .board-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .board-stats {
        justify-content: space-around;
    }
    
    .board-last-post {
        text-align: center;
    }
    
    .threads-header,
    .thread-item {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
    }
    
    .thread-stats:nth-child(3),
    .thread-stats:nth-child(4) {
        display: none;
    }
    
    .post {
        grid-template-columns: 1fr;
    }
    
    .post-sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats .stat {
        justify-content: space-between;
    }
}

/* No content states */
.no-boards,
.no-threads,
.no-posts {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* IMPROVED BBCODE STYLES */
blockquote {
    background: linear-gradient(135deg, #f8f9fa 0%, #ecf0f1 100%);
    border: 1px solid #ddd;
    border-left: 4px solid #3498db;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #5a6c7d;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

blockquote strong {
    color: #2c3e50;
    font-style: normal;
}

/* Additional improvements */
a {
    transition: color 0.2s;
}

/* Better focus states */
input:focus,
textarea:focus,
button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Better typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

/* Improved spacing */
p + p {
    margin-top: 1rem;
}