/* --- Global Styles & Fonts --- */
:root {
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --color-background: #f0f2f5;
    --color-surface: #ffffff;
    --color-dark-text: #333333;
    --color-light-text: #6c7a89;
    --color-accent: #8e44ad;
    --color-accent-dark: #7b2c9e;
    --color-border: #e8e8e8;
    --color-admin: #9b59b6;
    --color-moderator: #3498db;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--color-dark-text);
    background-color: var(--color-background);
    margin: 0;
    padding: 0;
}

/* --- Layout --- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr; gap: 25px; }
.container-no-sidebar { grid-template-columns: 1fr; }

main { grid-column: 1 / -1; min-width: 0; }
aside { display: none; } /* Default: Hide sidebar on mobile */

@media (min-width: 992px) { 
    .container { 
        grid-template-columns: minmax(0, 1fr) 320px; 
    }
    main { 
        grid-column: 1 / 2; 
    }
    aside {
        display: flex; /* Override: Show sidebar on desktop */
        flex-direction: column;
        gap: 25px;
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }
}


/* --- Components --- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--color-accent-dark); }
.button { display: inline-block; padding: 10px 20px; background-color: var(--color-accent); color: white; border-radius: 5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border: none; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; text-align: center; }
.button:hover { background-color: var(--color-accent-dark); transform: translateY(-2px); }

/* --- Header --- */
.top-bar { background-color: var(--color-accent); color: white; padding: 8px 20px; font-size: 0.8em; text-align: center; }
#main-header { position: sticky; top: 0; z-index: 1000; background-color: var(--color-surface); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); }
.main-nav { max-width: 1200px; margin: 0 auto; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-size: 1.6em; font-weight: 700; color: var(--color-dark-text); }
.desktop-nav { list-style: none; margin: 0; padding: 0; display: none; align-items: center; gap: 25px; }
@media (min-width: 768px) { .desktop-nav { display: flex; } }
.desktop-nav a, .logout-button { color: var(--color-dark-text); font-weight: 600; padding-bottom: 5px; border-bottom: 2px solid transparent; }
.desktop-nav a:hover, .logout-button:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.logout-button { background: none; border: none; cursor: pointer; font-family: var(--font-body); font-size: 1em; }
.hamburger { display: block; cursor: pointer; }
@media (min-width: 768px) { .hamburger { display: none; } }

/* --- Sidebar Widgets --- */
.widget { background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: 5px; }
.widget-header { background-color: #f9f9f9; padding: 12px 15px; border-bottom: 1px solid var(--color-border); border-radius: 5px 5px 0 0; }
.widget-header h3 { margin: 0; font-size: 1.1em; }
.widget-body { padding: 15px; }
.widget-footer { padding: 10px 15px; background-color: #f9f9f9; border-top: 1px solid var(--color-border); border-radius: 0 0 5px 5px; font-size: 0.9em; text-align: center; }
.widget-footer a { color: var(--color-light-text); margin: 0 10px; }
.widget-footer a:hover { color: var(--color-accent); }
.members-list li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.9em; list-style-type: none; padding: 0; }
.member-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.staff-info .role { font-size: 0.8em; text-transform: capitalize; }
.role-admin { color: var(--color-admin); }
.role-moderator { color: var(--color-moderator); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9em; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--color-border); border-radius: 4px; box-sizing: border-box; }

/* --- Homepage Post Card (New Style) --- */
.post-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    margin-bottom: 25px;
    overflow: hidden;
}
.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
}
.post-card-info {
    flex-grow: 1;
}
.post-card-title {
    font-size: 1.6em;
    margin: 0 0 10px 0;
}
.post-card-title a {
    color: var(--color-dark-text);
}
.post-card-meta {
    font-size: 0.85em;
    color: var(--color-light-text);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}
.post-card-meta a {
    color: var(--color-light-text);
    font-weight: 600;
}
.post-card-meta a:hover {
    color: var(--color-accent);
}
.post-card-date {
    flex-shrink: 0;
    margin-left: 20px;
    background-color: #f9f9f9;
    border: 1px solid var(--color-border);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    min-width: 50px;
}
.post-card-date .day {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--color-accent);
    display: block;
    line-height: 1;
}
.post-card-date .month {
    font-size: 0.8em;
    text-transform: uppercase;
    color: var(--color-light-text);
    display: block;
}
.post-card-image-link {
    display: block;
    line-height: 0; /* Remove space below image */
}
.post-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}
.post-card-snippet {
    padding: 25px;
    font-size: 1em;
    line-height: 1.7;
    color: var(--color-dark-text);
    border-top: 1px solid var(--color-border);
}
.read-more-link {
    display: inline-block;
    margin-top: 15px;
    font-weight: 600;
}


/* --- Full Post Page Styling --- */
.post-full-card { background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: 5px; overflow: hidden; }
.post-full-card .post-meta { display: flex; align-items: center; gap: 10px; font-size: 0.9em; color: var(--color-light-text); }
.post-full-card .post-main-content { padding: 25px; }
.post-full-card .post-cover-image { width: 100%; max-height: 450px; object-fit: cover; border-radius: 5px; margin-bottom: 25px; }
.post-full-card .post-title { font-size: 2.2em; margin: 0 0 20px 0; }
.post-full-card .post-body { line-height: 1.8; font-size: 1.05em; }
.post-full-card .post-body > *:first-child { margin-top: 0; }
.post-full-card .post-body p { margin-bottom: 1.2em; }
.post-full-card .post-body h1, .post-full-card .post-body h2, .post-full-card .post-body h3 { margin: 1.5em 0 0.8em; }
.post-full-card .post-body blockquote { border-left: 3px solid var(--color-accent); margin: 1.5em 0; padding: 0.5em 1.5em; color: var(--color-light-text); font-style: italic; background-color: #f9f9f9; }
.post-full-card .post-body pre { background-color: #2d2d2d; color: #f8f8f2; padding: 20px; border-radius: 5px; margin: 1.5em 0; overflow-x: auto; font-family: monospace; }
.post-full-card .post-body ul, .post-full-card .post-body ol { margin-bottom: 1.2em; padding-left: 2em; }
.post-full-card .post-body img { max-width: 100%; height: auto; border-radius: 5px; margin: 1.5em 0; display: block; }
.post-full-card .post-footer { padding: 15px; border-top: 1px solid var(--color-border); text-align: right; }
.delete-button { background-color: #e74c3c; color: white;}
.delete-button:hover { background-color: #c0392b; }

/* --- Comments Section --- */
.comments-section { margin-top: 20px; }
.comment-item { display: flex; gap: 15px; padding: 15px 0; border-top: 1px solid var(--color-border); }
.comment-avatar { width: 45px; height: 45px; border-radius: 50%; }
.comment-author { font-weight: 700; }
.author-badge { font-size: 0.7em; background: var(--color-accent); color: white; padding: 2px 6px; border-radius: 4px; margin-left: 8px; }

/* --- Profile Page --- */
.profile-card { padding: 0; }
.profile-header { background: linear-gradient(45deg, var(--color-accent), var(--color-accent-dark)); height: 150px; border-radius: 5px 5px 0 0; }
.profile-avatar-wrapper { text-align: center; margin-top: -75px; }
.profile-avatar { width: 150px; height: 150px; border-radius: 50%; border: 5px solid var(--color-surface); object-fit: cover; }
.profile-info { text-align: center; padding: 20px; }
.profile-info h1 { margin: 0; }
.profile-rank { font-weight: 600; color: var(--color-accent); text-transform: capitalize; }
.profile-bio { margin-top: 15px; color: var(--color-light-text); }

/* --- Profile Picture Uploader --- */
.pfp-drop-zone { border: 2px dashed var(--color-border); border-radius: 5px; padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.3s, background-color 0.3s; }
.pfp-drop-zone.active { border-color: var(--color-accent); background-color: #fafafa; }
.pfp-prompt-small { font-size: 0.9em; color: var(--color-light-text); margin-top: 5px; }
.pfp-preview-container { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.pfp-preview { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pfp-actions { position: absolute; bottom: 0; left: 0; width: 100%; display: flex; justify-content: center; gap: 10px; padding-bottom: 10px; }
.pfp-action-btn { background: rgba(0, 0, 0, 0.6); color: white; border: none; border-radius: 4px; padding: 5px 10px; font-size: 0.8em; cursor: pointer; }
.pfp-action-btn.remove { background: #e74c3c; }
.form-upload-note { font-size: 0.8em; color: var(--color-light-text); text-align: center; margin-top: 10px; }

