/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #3e2217;
    --primary-dark-color: #2a1810;
    --text-light-color: #ffffff;
    --text-dark-color: #333;
    --background-light-color: #f9f9f9;
    --background-color: #f4f4f4;
    --border-color: #ddd;
    --success-color: #4CAF50;
    --danger-color: #f44336;
    --info-color: #2196F3;
    --font-family: 'Poppins', sans-serif;
}

*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
}

a{
    color: var(--primary-color);
    text-decoration: none;
}

/* General Main Content Styles */
main{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Auth Page Specific Styles */
.auth-container {
    width: 400px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 2rem auto;
}

.auth-tabs {
    background-color: var(--primary-color);
    display: flex;
    border-bottom: 3px solid var(--primary-dark-color);
}

.auth-tabs-wrapper {
    display: flex;
    width: 100%;
}

.auth-tabs .tab-button {
    flex: 1;
    padding: 1rem;
    background-color: var(--primary-color);
    border: none;
    color: var(--text-light-color);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 3px solid transparent;
}

.auth-tabs .tab-button:hover {
    background-color: rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.auth-tabs .tab-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

.auth-tabs .tab-button.active {
    background-color: white;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
}

.auth-forms {
    padding: 2rem;
}

.auth-form {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.auth-form.active {
    display: flex;
}

.form-title {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.password-input-container {
    position: relative;
    width: 100%;
}

.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #777;
}

.form-input {
    width: 100%;
    height: 45px;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--background-light-color);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(62, 34, 23, 0.3);
}

.form-button {
    width: 100%;
    height: 45px;
    background-color: var(--primary-color);
    color: var(--text-light-color);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.form-button:hover {
    background-color: var(--primary-dark-color);
    transform: translateY(-2px);
}

.form-footer {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: underline;
}

.form-footer a:hover {
    color: var(--primary-dark-color);
}

.google-button img {
    width: 191px; /* Standard width for this button */
    height: 46px; /* Standard height */
    border-radius: 4px; /* Optional: match other button styles */
}

/* Separator for 'or' text */
.form-separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    width: 100%;
    margin: 0.5rem 0; /* Adjust spacing */
}

.form-separator::before,
.form-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.form-separator span {
    padding: 0 10px;
}

/* Remember Me & Forgot Password section */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.9rem;
}

.remember-me {
    display: flex;
    align-items: center;
}
/* General Body Styles */
body {
    background-color: var(--background-color);
    color: var(--text-dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container Styles */
.container {
    flex: 1;
    padding: 2rem; /* Add padding for content */
}

/* Flashed Messages Container */
.flash-messages {
    padding: 1rem;
    list-style: none;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

/* Alert Styles */
.alert {
    padding: 15px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #fff;
}
.alert-danger { background-color: var(--danger-color); } /* Red */
.alert-success { background-color: var(--success-color); } /* Green */
.alert-info { background-color: var(--info-color); } /* Blue */

/* Navbar Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    padding: 1rem 2rem;
    color: var(--text-light-color);
    position: relative;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    height: 40px;
    width: auto;
}

/* Group brand + socials so icons can sit beside the title on mobile */
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-socials {
    display: flex; /* show on desktop next to brand */
    gap: 0.5rem;
    margin-left: 0; /* sit immediately after brand on desktop */
}

.nav-socials a {
    color: white;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
}

/* Default desktop navigation styles */
.nav-links {
    display: flex;
    gap: 1rem;
}

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

/* Overlay for sidebar */
/* Sidebar overlay is no longer needed */

/* Blog Page Styles */
.blog-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.blog-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.blog-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.create-post-section, .posts-section {
    margin-bottom: 2rem;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-form .form-input {
    width: 100%;
}

.post-item {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Header layout: title + views badge aligned horizontally */
.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.post-title {
    flex: 1 1 auto;
    min-width: 0; /* allow truncation inside flex */
    margin: 0;
}

.post-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary-dark-color);
}

.post-views {
    flex: 0 0 auto;
    background-color: rgba(0,0,0,0.05);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #555;
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.post-meta {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
}

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

/* Base button styling for links and buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    display: inline-block; /* Important for <a> tags */
    transition: background-color 0.3s;
}

.edit-btn {
    background-color: var(--success-color);
    color: var(--text-light-color);
}

.edit-btn:hover {
    background-color: #45a049;
}

.delete-btn {
    background-color: var(--danger-color);
    color: var(--text-light-color);
}

.delete-btn:hover {
    background-color: #da190b;
}

.comment-btn {
    background-color: var(--primary-color);
    color: var(--text-light-color);
}

.comment-btn:hover {
    background-color: #2a1810;
}

.add-comment-btn {
    background-color: var(--info-color);
    color: var(--text-light-color);
    margin-top: 1rem;
}

.add-comment-btn:hover {
    background-color: #1e88e5;
}

.admin-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.post-interaction {
    margin-top: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.comment-form-container {
    margin-bottom: 1.5rem;
}

.comment-form-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.comment-stance {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-stance label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.comment-form-container button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--text-light-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.comment-form-container button:hover {
    background-color: var(--primary-dark-color);
}

.debate-container {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.debate-side {
    flex: 1;
    padding: 1rem;
    border-radius: 6px;
    background-color: var(--text-light-color);
    border: 1px solid var(--border-color);
}

.agree-side {
    border-left: 4px solid var(--success-color);
}

.disagree-side {
    border-left: 4px solid var(--danger-color);
}

.debate-side h4 {
    margin-bottom: 1rem;
    color: var(--text-dark-color);
}

.comment {
    background-color: var(--background-color);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--border-color);
}

.comment p {
    margin-bottom: 0.25rem;
}

.comment small {
    color: #777;
    font-size: 0.8rem;
}

.no-comments {
    color: #999;
    font-style: italic;
}

.pagination-nav {
    margin-top: 2rem;
    text-align: center;
}

.pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    gap: 0.5rem;
}

.page-link {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--text-light-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.page-link:hover {
    background-color: var(--primary-dark-color);
}

.page-item.disabled .page-link {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Ensure pagination link text is always readable (white on primary color),
   and use a darker text for disabled state for contrast */
.pagination .page-link,
.pagination .page-link * {
    color: var(--text-light-color) !important;
}

.page-item.disabled .page-link {
    background-color: #ccc;
    cursor: not-allowed;
    color: #555; /* darker text for disabled state */
}

.page-item.disabled .page-link:hover {
    background-color: #ccc;
}

/* --- Image Styling for Blog Posts --- */

.post-image-container {
    width: 100%;
    margin: 1rem 0; /* Adds some space above and below the image */
    overflow: hidden; /* Ensures any strange image overflow is clipped */
    border-radius: 8px; /* Gives the image container soft, rounded corners */
}

.post-image {
    width: 100%; /* Makes the image fill its container horizontally */
    height: auto; /* Maintains the image's aspect ratio */
    max-height: 500px; /* Prevents very tall images from taking up too much space */
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary, without distortion */
    display: block; /* Removes any extra space below the image */
    border: 1px solid #eee; /* Adds a subtle border */
}

.post-image-container.processing {
    position: relative;
    background-color: #f0f0f0; /* Light grey background */
}

.post-image-container.processing::after {
    content: 'Image is processing...';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-style: italic;
}

/* Gallery styles for multiple images */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

.post-gallery-item {
    overflow: hidden;
    border-radius: 8px;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.gallery-thumb:hover { transform: scale(1.03); }

/* Lightbox modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
    z-index: 1200;
}

.lightbox-modal img {
    max-width: 95%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 1.6rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2.2rem;
    background: rgba(0,0,0,0.3);
    border: none;
    width: 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-prev:hover, .lightbox-next:hover, .lightbox-close:hover { background: rgba(0,0,0,0.5); }

.edit-post-image-preview {
    max-width: 250px;
    height: auto;
    display: block;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.nsfw-placeholder {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    border-radius: 8px;
    font-style: italic;
}

.post-content-full {
    display: none; /* Hidden by default */
    white-space: pre-wrap; /* Respects newlines in the post content */
}

/* Read More Link Styling */
.read-more-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s;
}

/* Community Stats Section */
.community-stats {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-top: 4px solid var(--primary-color);
    text-align: center;
}

.stat-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.stat-subtext {
    font-size: 0.9rem;
    color: #777;
}

.trending-card {
    text-align: left;
    grid-column: 1 / -1; /* Make this card span the full width */
}

.trending-list {
    list-style: none;
    padding: 0;
}

.trending-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}
.trending-list li:last-child {
    border-bottom: none;
}

/* Social Media Section on About Page */
.social-media-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.social-media-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-dark-color);
}

.social-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.8rem; /* Increase size for icons */
    color: var(--primary-dark-color);
    text-decoration: none; /* Remove underline */
    transition: color 0.3s, transform 0.3s;
}

/* Footer Styles */
.footer {
    background-color: var(--primary-color);
    color: var(--text-light-color);
    text-align: center;
    padding: 1rem 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a:hover {
    text-decoration: none; /* Remove underline on hover */
    opacity: 0.8;
}

.social-links a:hover {
    text-decoration: none;
    color: var(--primary-color);
    transform: scale(1.1);
}

.about-content {
    /* Styles for the content inside the about page container */
    line-height: 1.7;
}

/* --- New Profile Page Styles --- */
.profile-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1100px;
    margin: 2rem auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.profile-sidebar {
    text-align: center;
    border-right: 1px solid var(--border-color);
    padding-right: 2rem;
}

.profile-picture {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
}

.profile-username {
    font-size: 1.8rem;
    color: var(--primary-dark-color);
    margin-bottom: 0.5rem;
}

.profile-bio {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1.5rem;
}

.profile-meta {
    text-align: left;
    font-size: 0.9rem;
    color: #777;
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.profile-meta-item i {
    color: var(--primary-color);
}

.profile-main-content .section-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}


/* Profile Page Styles */
.profile-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-header h1 {
    color: var(--primary-color);
}

.profile-meta {
    font-size: 0.9rem;
    color: #777;
}

.profile-details {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.profile-detail-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.detail-value {
    color: #555;
}

.post-item-simple {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.post-item-simple:last-child {
    border-bottom: none;
}

/* Responsive adjustments for new profile page */
@media (max-width: 768px) {
    .profile-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    .profile-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }
}


/* --- Video Styling for Blog Posts --- */

.post-video,
.edit-post-video-preview {
    width: 100%; /* Makes the video fill its container horizontally */
    max-height: 500px; /* Limits the maximum height of the video */
    height: auto; /* Maintains aspect ratio */
    object-fit: contain; /* Ensures the whole video is visible, letterboxing if necessary */
    display: block; /* Removes any extra space below the video */
    background-color: #000; /* Adds a black background for any letterboxing */
    border-radius: 8px; /* Matches the style of the image container */
    border: 1px solid #eee; /* Adds a subtle border */
}
/* Contact Form on About Page */
.contact-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

/* Responsive Styles */

/* Tablet Styles (max-width: 768px) */
@media (max-width: 768px) {
    /* Login Form Responsive Styles */
    .auth-container {
        width: 90vw;
    }

    .auth-forms {
        padding: 1.5rem;
    }

    .navbar {
        flex-direction: column;
        padding: 1rem;
        align-items: flex-start;
        gap: 1rem;
    }

    /* Display nav links directly in the navbar on mobile */
    .nav-links {
        display: flex;
        flex-direction: row;
        gap: 1rem;

        white-space: nowrap;     /* Prevent wrapping */
        flex-wrap: nowrap;       /* Force all items to stay on one line */
        overflow-x: auto;        /* Allow horizontal scroll if links exceed screen width */
        scrollbar-width: none;   /* Hide scrollbar (Firefox) */
    }

    .nav-links::-webkit-scrollbar {
        display: none;           /* Hide scrollbar (Chrome) */
    }

    .container {
        padding: 1.5rem; /* Reduce padding for tablets */
    }

    /* Add padding to the main content area of the search results page */
    .search-results-page-container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Add padding to the main content area of the admin dashboard */
    .admin-dashboard-page-container {
        padding-left: 15px;
        padding-right: 15px;
    }
    .blog-container {
        width: 100%;
        padding: 0.5rem;
        margin: 0.5rem 0;
    }

    .blog-header h1 {
        font-size: 1.8rem;
    }

    .post-item {
        padding: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .debate-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .debate-side {
        padding: 0.75rem;
    }

    .action-cards {
        flex-direction: column;
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .form-input {
        width: 100%;
    }

    .form-button {
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* --- Tabbed Interface for Blog --- */
.tab-container {
    width: 100%;
    margin-top: 2rem;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-buttons .tab-button {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    background-color: transparent;
    border: none;
    font-size: 1.1rem;
    color: #777;
    position: relative;
    top: 2px; /* Aligns bottom border with container's border */
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.tab-buttons .tab-button:hover {
    color: var(--primary-dark-color);
}

.tab-buttons .tab-button.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none; /* Hide all tab content by default */
}

.tab-content.active {
    display: block; /* Show only the active tab's content */
}

/* Mobile Styles (max-width: 480px) */
@media (max-width: 480px) {
    body {
        background-attachment: scroll;
    }

    .auth-container {
        width: 95vw;
        margin: 1rem auto;
    }

    .navbar {
        padding: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
    }

    .nav-brand {
        font-size: 1.2rem;
    }

    /* Show social icons next to brand on small screens */
    .nav-left {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    /* push socials to the right edge of the screen */
    .nav-socials {
        display: flex;
        gap: 0.6rem;
        align-items: center;
        margin-left: auto;
        padding-right: 0.5rem; /* start slightly from the right edge */
    }

    .nav-socials a {
        font-size: 1.05rem;
        color: white;
    }

    .container {
        padding: 0.5rem; /* Consistent padding */
        min-height: 80vh; /* Ensure container stretches to cover better part of the screen on mobile */
    }

    .blog-container {
        width: 100%;
        padding: 0.5rem;
        margin: 0.25rem 0;
    }

    .blog-header h1 {
        font-size: 1.5rem;
    }

    .blog-header h4 {
        font-size: 0.9rem;
    }

    .post-item {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
        border-radius: 4px; /* slightly reduced radius for edge alignment */
        border-left-width: 3px; /* keep accent but slightly smaller */
    }

    .post-meta {
        font-size: 0.8rem;
    }

    .post-actions {
        flex-direction: row; /* Keep buttons horizontal */
        flex-wrap: wrap;     /* Allow buttons to wrap if space is limited */
        align-items: center; /* Vertically align items if they wrap */
    }
    
    /* Adjust admin buttons on blog posts for smaller screens */
    .admin-actions .btn {
        padding: 0.25rem 0.5rem; /* Make padding smaller */
        font-size: 0.8rem;      /* Make font smaller */
    }

    .social-links {
        justify-content: center; /* Center the social icons on mobile */
        gap: 2rem; /* Add more space between icons */
    }

    .debate-side {
        padding: 0.5rem;
    }

    .comment {
        padding: 0.45rem;
    }

    .action-cards {
        gap: 0.5rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .card p {
        font-size: 0.9rem;
    }

    .form-input {
        height: 35px;
        padding: 8px 15px;
    }

    .form-button {
        height: 35px;
        font-size: 0.9rem;
    }

    /* Allow textareas to have a flexible height on mobile */
    textarea.form-input {
        height: auto;
    }

    .stat-number {
        font-size: 2rem; /* Reduce font size for mobile */
    }

    .footer {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .footer-content {
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
    }

    .flash-messages {
        padding: 0.5rem;
        top: 5px;
        right: 5px;
    }

    .alert {
        padding: 10px;
        font-size: 0.9rem;
    }
}

/* Compact comment action buttons to match post button colors and conserve space */
.comment-actions button,
.comment-form-container button,
.reply-form button,
.edit-form button,
.comment-actions .action-link { /* Also target action links for consistency */
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer; 
}

.comment-actions .reply-btn {
    background-color: var(--primary-color);
    color: var(--text-light-color);
}
.comment-actions .reply-btn:hover { background-color: var(--primary-dark-color); }

.comment-actions .edit-btn {
    background-color: var(--success-color);
    color: var(--text-light-color);
}
.comment-actions .edit-btn:hover { background-color: #45a049; }

.comment-actions .delete-comment {
    background-color: var(--danger-color);
    color: var(--text-light-color);
}
.comment-actions .delete-comment:hover { background-color: #da190b; }

/* Ensure comment action buttons are small on very small screens */
@media (max-width: 480px) {
    .comment-actions button { padding: 3px 6px; font-size: 0.72rem; }
}

/* --- Related Posts Section --- */
.related-posts-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-posts-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-dark-color);
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border-left: 3px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
