/* 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;
}

main{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.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 {
    display: flex;
    background-color: var(--primary-color);
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-light-color);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab-button.active, .tab-button:hover {
    background-color: var(--primary-dark-color);
}

.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);
}

/* 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);
    background-image: url('logo2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    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;
}

/* 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;
}

.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;
}

.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;
}

.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;
}

/* 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;
}
/* 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;
        flex-wrap: wrap;
        gap: 1rem;
    }

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

    .blog-container {
        max-width: 90vw;
        padding: 1rem;
        margin: 1rem auto;
    }

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

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

    .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;
    }
}

/* 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;
    }

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

    .blog-container {
        max-width: 95vw;
        padding: 0.5rem;
        margin: 0.5rem auto;
    }

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

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

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

    .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 */
    }

    .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.5rem;
    }

    .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;
    }
}
