/* Reset and Base Styles */
:root {
    --background-dark: #0a0a0f; /* Very dark blue/black */
    --text-light: #e0e0e0; /* Light grey */
    --text-medium: #a0a0a0; /* Medium grey */
    --accent-gold: #ffd34d; /* Gold accent */
    --accent-blue: #4286f4; /* Subtle blue */
    --font-primary: 'Inter', sans-serif; /* Clean sans-serif font */
}

/* Import Inter font (add this if not already globally available) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Enable smooth scrolling */
}

body {
    font-family: var(--font-primary);
    background-color: var(--background-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
    /* Optional: Add a subtle background gradient or image */
    /* background-image: linear-gradient(to bottom, #0a0a0f, #1a1a2f); */
}

/* Remove styles for elements no longer in index.html */
/* header, .stars, .black-hole, .features, .feature-card, .quote-section, etc. */
/* Keep only styles relevant to the new index.html structure */

/* Main Content Area */
#main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure footer is pushed down */
}

/* Hero Section (Spline Viewer) */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; /* Take up available space */
    padding: 2rem 1rem; /* Add some padding */
    min-height: 70vh; /* Ensure spline has enough space */
}

.hero-content {
    width: 100%;
    max-width: 1000px; /* Limit spline width */
    height: 60vh; /* Adjust height as needed */
    display: flex;
    justify-content: center;
    align-items: center;
}

.model-container {
    width: 100%;
    height: 100%;
}

spline-viewer {
    width: 100%;
    height: 100%;
    border-radius: 12px; /* Slightly rounded corners */
    /* Add a subtle border or shadow if desired */
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); */
}

/* Footer Styles */
.site-footer {
    background-color: rgba(10, 10, 15, 0.8); /* Slightly transparent dark background */
    padding: 3rem 1rem 2rem; /* More padding */
    margin-top: auto; /* Push to bottom */
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle top border */
    backdrop-filter: blur(5px); /* Frosted glass effect (optional) */
    -webkit-backdrop-filter: blur(5px); /* Safari */
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem; /* Increased gap */
}

/* Social Card Styles (Minimalist) */
.social-card-container { /* Renamed class to avoid conflict if .social-card is used elsewhere */
    display: flex;
    gap: 1.5rem; /* Space out icons */
    /* Removed background, shadow, padding */
}

.socialContainer {
    width: 44px; /* Slightly smaller */
    height: 44px;
    border-radius: 50%; /* Make circular */
    background-color: rgba(255, 255, 255, 0.08); /* Subtle background */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.socialSvg {
    width: 20px; /* Adjust icon size */
    height: 20px;
}

.socialSvg path {
    fill: var(--text-medium); /* Grey icons */
    transition: fill 0.3s ease;
}

.socialContainer:hover {
    background-color: rgba(255, 255, 255, 0.15); /* Lighten on hover */
    transform: translateY(-3px); /* Subtle lift */
}

/* Specific hover colors (optional, can keep them subtle grey) */
.containerOne:hover .socialSvg path { fill: #d62976; } /* Instagram */
.containerTwo:hover .socialSvg path { fill: #00acee; } /* Twitter */
.containerThree:hover .socialSvg path { fill: #0072b1; } /* LinkedIn */
.containerFour:hover .socialSvg path { fill: #ffffff; } /* GitHub */

/* Remove hover background color changes if only icon color change is desired */
/* .containerOne:hover { background-color: transparent; } */
/* ... etc ... */

/* Support Link (Buy Me a Coffee) */
.support-link a img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 5px;
}

.support-link a:hover img {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 221, 0, 0.2);
}

/* Footer Stats */
.footer-stats {
    display: flex;
    gap: 3rem;
    text-align: center;
}

.stat-item {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.2s; }
.stat-item:nth-child(2) { animation-delay: 0.4s; }

.stat-number {
    font-size: 2rem; /* Slightly smaller */
    font-weight: 500; /* Less bold */
    color: var(--text-light); /* White */
    margin-bottom: 0.3rem;
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Footer Links (Terms) */
.footer-links .terms-btn {
    background: transparent;
    color: var(--text-medium);
    border: 1px solid var(--text-medium);
    padding: 0.6rem 1.2rem;
    border-radius: 20px; /* Pill shape */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links .terms-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-color: var(--text-light);
    transform: translateY(-2px);
}

/* Copyright */
.copyright {
    color: var(--text-medium);
    font-size: 0.85rem;
}

.copyright-link {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Navbar Styles --- */
.main-navbar {
    background-color: rgba(10, 10, 15, 0.8); /* Match footer background */
    padding: 1rem 2rem;
    position: sticky; /* Make it stick to the top */
    top: 0;
    z-index: 100; /* Ensure it's above other content */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle bottom border */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: transform 0.3s ease-in-out, background-color 0.3s ease; /* Added transform transition */
}

.main-navbar.navbar-hidden {
    transform: translateY(-100%); /* Hide navbar by moving it up */
}

/* Optional: Change background slightly on scroll */
/* body.scrolled .main-navbar { background-color: rgba(10, 10, 15, 0.9); } */

.navbar-content {
    max-width: 1200px; /* Limit width */
    margin: 0 auto;
    display: flex; /* Ensure flex display */
    justify-content: space-between; /* Space out brand, links, auth */
    align-items: center; /* Vertically align items */
    position: relative;
}

.nav-brand {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.nav-brand:hover {
    color: var(--accent-gold);
}

/* Mobile menu toggle button */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    margin: 3px 0;
    transition: 0.3s;
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links li {
    padding: 0;
    margin: 0;
}

.nav-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-gold);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-light);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Adjust auth buttons position in navbar */
.auth-buttons-nav {
    display: flex; /* Ensure flex display */
    align-items: center; /* Vertically align items */
    gap: 0.5rem; /* Space between buttons */
}

.auth-buttons-nav button {
    background-color: var(--accent-gold);
    color: var(--background-dark);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin: 0; /* Explicitly remove any default/conflicting margins */
}

.auth-buttons-nav button:hover {
    background-color: #fff;
}

.auth-buttons-nav #logout-btn {
    background-color: transparent;
    color: var(--text-medium);
    border: 1px solid var(--text-medium);
}

.auth-buttons-nav #logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-color: var(--text-light);
}

.auth-buttons-nav .user-email {
    color: var(--text-medium);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* --- Community Page Layout --- */
.community-layout {
    display: flex;
    margin-top: 60px; /* Adjust based on navbar height */
    padding: 20px;
}

.sidebar-nav {
    width: 200px;
    flex-shrink: 0; /* Prevent the sidebar from shrinking */
    padding-right: 20px;
    border-right: 1px solid #ddd; /* Use a theme-appropriate color */
    /* Ensure consistent background if needed */
    /* background-color: rgba(10, 10, 15, 0.4); */
}

.sidebar-nav h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
    color: var(--text-light); /* Use theme color */
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav .sidebar-link {
    text-decoration: none;
    color: var(--text-medium); /* Use theme color */
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav .sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Theme hover */
    color: var(--text-light);
}

.sidebar-nav .sidebar-link.active {
    background-color: var(--accent-blue); /* Theme active color */
    color: white;
    font-weight: bold;
}

.community-content {
    flex-grow: 1;
    padding-left: 30px;
    min-width: 0; /* Prevent content from pushing sidebar if it's too wide */
}

/* --- TARS Logs Specific Styles --- */
.tars-log-controls button {
    margin-left: 10px;
    padding: 8px 15px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.tars-log-controls button:hover {
    background-color: #e2e6ea;
}

#clear-logs-btn {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

#clear-logs-btn:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.tars-log-output {
    height: 400px; /* Or max-height */
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 15px;
    background-color: #1a1a1a; /* Dark background */
    color: #0f0; /* Green text */
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    border-radius: 4px;
    white-space: pre-wrap; /* Preserve whitespace and wrap lines */
    word-wrap: break-word; /* Break long words */
}

.log-entry {
    margin-bottom: 5px;
}

/* Styles for the typing cursor (no animation) */
.log-cursor {
    display: inline-block;
    background-color: #0f0; /* Cursor color matches text */
    width: 8px; /* Adjust width as needed */
    height: 1em; /* Match line height */
    margin-left: 2px;
    vertical-align: text-bottom; /* Align cursor nicely */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .community-layout {
        flex-direction: column;
    }

    .sidebar-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding-right: 0;
        margin-bottom: 20px;
    }

    .community-content {
        padding-left: 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header h1 {
        margin-bottom: 10px;
    }

    .tars-log-controls {
        margin-top: 10px;
    }

    .tars-log-controls button {
        margin-left: 0;
        margin-right: 10px;
        margin-bottom: 5px; /* Stack buttons nicely */
    }
}

/* --- Community Content Area --- */
.community-content {
    flex-grow: 1; /* Take remaining space */
    min-width: 0; /* Prevent overflow issues */
}

.community-section {
    display: none; /* Hide sections by default */
    padding: 1.5rem;
    background-color: rgba(10, 10, 15, 0.6); /* Match footer/navbar */
    border-radius: 8px;
    margin-bottom: 2rem; /* Space between sections if multiple were shown */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.community-section.active-section {
    display: block; /* Show the active section */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header h1 {
    color: var(--text-light);
    font-size: 1.8rem;
}

/* Style the create post button within the section header */
.section-header .create-post-button {
    background-color: var(--accent-gold);
    color: var(--background-dark);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.section-header .create-post-button:hover {
    background-color: #fff;
}

/* --- Forum Specific Styles (Adjustments) --- */
/* Ensure category styles fit within the new layout */
.categories {
    display: grid; /* Or flex, depending on desired layout */
    gap: 1.5rem; /* Space between category boxes */
}

.category {
    background-color: rgba(26, 26, 47, 0.3); /* Slightly different background for categories */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1rem 1.5rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem; /* Space between header and posts */
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-header h2 {
    color: var(--text-light);
    font-size: 1.2rem; /* Slightly smaller category titles */
}

.category-header .see-more {
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.category-header .see-more:hover {
    color: var(--text-light);
}

.preview-posts,
.category-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Use gap for spacing between posts */
}

/* Add CSS rules to hide/show preview and full post lists based on the 'expanded' class on the category container */
.category .category-posts {
    display: none; /* Hide full post list by default */
    margin-top: 10px; /* Add some space */
}

.category.expanded .category-posts {
    display: block; /* Show full post list when expanded */
}

.category.expanded .preview-posts {
    display: none; /* Hide preview posts when expanded */
}

/* Ensure preview posts are visible by default (when not expanded) */
.category .preview-posts {
    display: block;
}

/* --- Post Styling for Separation --- */
.post {
    background-color: rgba(10, 10, 15, 0.4); /* Slightly darker background for posts */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    padding: 1rem 1.2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer; /* Indicate the whole post is clickable */
    margin-bottom: 1rem; /* Add space below each post */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Add a subtle bottom border */
}

/* Remove bottom margin and border from the last post in a container */
.preview-posts .post:last-child,
.category-posts .post:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.post:hover {
    background-color: rgba(26, 26, 47, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.post-main-content {
    margin-bottom: 0.8rem; /* Space between content and footer */
    color: var(--text-light);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-medium);
}

.post-meta {
    display: flex;
    align-items: center; /* Align upvote button with other meta info */
    gap: 0.8rem; /* Space between author, time, replies */
}

.post-author,
.post-time,
.reply-count {
    display: inline-flex; /* Align icon and text */
    align-items: center;
    gap: 0.3rem;
}

.reply-count svg {
    fill: currentColor; /* Use text color for icon */
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Button Styles within Post Footer --- */
.post-actions button {
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.post-actions button:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.1);
}

.post-actions button svg {
    width: 16px; /* Consistent icon size */
    height: 16px;
    fill: currentColor;
}

.post-actions .delete-btn:hover {
    color: #ff4d4d; /* Red hover for delete */
    background-color: rgba(255, 77, 77, 0.1);
}

.post-actions .reply-action-btn span {
    margin-left: 0.3rem;
    font-size: 0.8rem;
}

/* --- Action Buttons General Styling (Apply to upvote, reply, delete etc.) --- */
.reply-action-btn,
.post-actions button { /* Target buttons directly inside post-actions */
    display: inline-flex; /* Use flex for alignment */
    align-items: center; /* Vertically align icon and text */
    background: none;
    border: none;
    color: var(--text-secondary); /* Use secondary text color */
    cursor: pointer;
    padding: 0.3rem 0.6rem; /* Adjust padding */
    border-radius: 4px;
    font-size: 0.85rem; /* Slightly larger font */
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease; /* Smooth transitions */
    gap: 0.4rem; /* Space between icon and text */
}

.reply-action-btn:hover,
.post-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background on hover */
    color: var(--text-primary); /* Brighter text on hover */
}

/* --- Upvote Button Specific Styles --- */
.upvote-btn {
    display: inline-flex; /* Use inline-flex to keep it inline with other meta items */
    flex-direction: column; /* Stack arrow and count vertically */
    align-items: center; /* Center items horizontally */
    background-color: transparent; /* Make background transparent */
    border: none; /* Remove border */
    border-radius: 4px;
    padding: 2px 4px; /* Adjust padding */
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-right: 10px; /* Space between upvote and other elements */
    min-width: 30px; /* Ensure a minimum width */
    text-align: center;
}

.upvote-btn:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle background on hover */
}

.upvote-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid var(--text-medium); /* Use theme color */
    margin-bottom: 3px; /* Space between arrow and count */
    transition: border-bottom-color 0.2s ease;
}

.upvote-btn.upvoted .upvote-arrow {
    border-bottom-color: var(--accent-gold); /* Use theme accent color when upvoted */
}

.upvote-count {
    font-size: 0.8em; /* Slightly smaller count */
    color: var(--text-medium); /* Use theme color */
    font-weight: bold;
    line-height: 1; /* Ensure tight line height */
}

.upvote-btn.upvoted .upvote-count {
    color: var(--accent-gold); /* Match arrow color when upvoted */
}

/* --- Delete Button Specific Styles --- */
.delete-btn {
    /* Inherits general styles from .post-actions button */
    position: relative; /* Needed for positioning pseudo-elements if used */
    overflow: hidden; /* Hide overflowing parts during animation */
}

.delete-btn .svgIcon {
    width: 1em; /* Control size using font-size */
    height: 1em;
    transition: transform 0.3s ease-in-out; /* Smooth transition for icons */
}

/* Delete Hover Animation */
.delete-btn:hover {
    color: #ff4d4d; /* Red hover color */
    background-color: rgba(255, 77, 77, 0.1); /* Light red background */
}

/* Delete Active/Click Animation (Optional) */
.delete-btn:active {
    transform: scale(0.95); /* Slightly shrink button on click */
}

/* --- Post Details Section Styling --- */
#post-details {
    padding: 1.5rem;
    background-color: rgba(10, 10, 15, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#back-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#post-content .post {
    background: none; /* Remove card background inside details view */
    border: none;
    padding: 0;
    margin-bottom: 2rem;
    cursor: default; /* Not clickable here */
}

#post-content .post:hover {
    background: none;
    border: none;
}

#post-content .post-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#post-content .post-header h2 {
    font-size: 1.8rem;
    color: var(--text-light);
}

#post-content .post-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

#post-content .post-footer {
    font-size: 0.9rem;
    color: var(--text-medium);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* --- Replies Styling --- */
#replies {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.5rem;
}

#replies h3 {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.3rem;
}

.reply {
    background-color: rgba(26, 26, 47, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

.reply-content {
    margin-bottom: 0.8rem;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

.reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-medium);
}

.reply-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.reply-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reply-actions button {
    background: none;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.reply-actions button:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.1);
}

.reply-actions button svg {
    width: 14px; /* Slightly smaller icons for replies */
    height: 14px;
    fill: currentColor;
}

.reply-actions .delete-reply-btn:hover {
    color: #ff4d4d;
    background-color: rgba(255, 77, 77, 0.1);
}

/* --- Reply Editor Styling --- */
#reply-editor-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#reply-editor .ql-toolbar,
#new-post-editor .ql-toolbar {
    background-color: rgba(26, 26, 47, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

#reply-editor .ql-container,
#new-post-editor .ql-container {
    background-color: rgba(10, 10, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    color: var(--text-light);
    min-height: 100px;
}

#reply-editor .ql-editor,
#new-post-editor .ql-editor {
    color: var(--text-light);
}

#reply-btn,
#post-btn {
    background-color: var(--accent-gold);
    color: var(--background-dark);
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
    float: right; /* Align button to the right */
}

#reply-btn:hover,
#post-btn:hover {
    background-color: #fff;
}

/* Inline Login Prompt for Reply */
#reply-login-prompt {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(26, 26, 47, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    text-align: center;
}

.login-prompt-inline p {
    margin: 0;
    color: var(--text-medium);
    display: flex; /* Align icon and text */
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-prompt-inline svg {
    stroke: var(--accent-blue);
}

.inline-login-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
    font-weight: 500;
}

.inline-login-btn:hover {
    color: var(--text-light);
}

/* Adjust modal styles if needed for the new theme */
.auth-modal .card,
.modal-content {
    background-color: #1a1a2f; /* Ensure modals match theme */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Hall of Projects Card Styles --- */
#projects-display-container .project-card {
    background-color: #12121b; /* Slightly darker card background to match image */
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    /* For consistent card height - relies on grid's align-items: stretch and content structure */
}

#projects-display-container .project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.25);
}

.project-card-condensed,
.project-card-expanded {
    padding: 1rem; /* Consistent padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Carousel Styling */
.carousel-container {
    width: 100%;
    height: 180px; /* Fixed height for the image carousel area */
    position: relative;
    overflow: hidden;
    background-color: #0a0a0f; /* Dark background for image area */
    border-radius: 6px;
    margin-bottom: 1rem;
}

.carousel-images {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    visibility: hidden;
    border-radius: 6px; /* Match container's border radius */
}

.carousel-image.active {
    opacity: 1;
    visibility: visible;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(10, 10, 15, 0.6);
    color: var(--text-light);
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 32px; /* Slightly larger */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.carousel-control.prev {
    left: 0.5rem;
}

.carousel-control.next {
    right: 0.5rem;
}

.carousel-control:hover {
    background-color: rgba(10, 10, 15, 0.9);
}

/* Project Info Styling (Condensed) - Order matches image: Title, Author, Description */
.project-card-condensed .project-title {
    font-size: 1.25rem; /* Adjusted size */
    color: var(--text-light);
    margin-bottom: 0.3rem; /* Reduced margin */
    font-weight: 600; /* Slightly less bold */
    line-height: 1.3;
}

.project-card-condensed .project-creator {
    font-size: 0.85rem; /* Adjusted size */
    color: var(--accent-blue);
    margin-bottom: 0.6rem; /* Adjusted margin */
}

.project-card-condensed .project-description-condensed {
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-bottom: 1rem; /* Space before button */
    flex-grow: 1;
    line-height: 1.4;
    /* Clamp description to a few lines if desired, though substring is already used */
    /* display: -webkit-box; */
    /* -webkit-line-clamp: 2; */
    /* -webkit-box-orient: vertical; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
}

.view-project-btn {
    background-color: var(--accent-gold);
    color: var(--background-dark);
    border: none;
    padding: 0.6rem 1rem; /* Adjusted padding */
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: auto; /* Pushes button to the bottom */
    width: 100%; /* Make button full width of padding */
}

.view-project-btn:hover {
    background-color: #fff;
    color: #0a0a0f;
}

/* Expanded Card Styling */
.project-card-expanded .project-title-expanded {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 600;
}

.expanded-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Allow more images if available */
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.expanded-image {
    width: 100%;
    height: 100px; /* Fixed height for thumbs in expanded view */
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card-expanded .project-creator-expanded {
    font-size: 0.95rem;
    color: var(--accent-blue);
    margin-bottom: 0.75rem;
}

.project-card-expanded .project-description-full {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-card-expanded .project-link-btn {
    display: inline-block;
    background-color: var(--accent-blue);
    color: white;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.project-card-expanded .project-link-btn:hover {
    background-color: #3578e5;
}

.project-card-expanded .project-timestamp {
    font-size: 0.75rem;
    color: var(--text-medium);
    margin-bottom: 1rem;
    display: block;
}

.project-card-expanded .close-project-btn {
    background-color: #4a4a58; /* Darker grey */
    color: var(--text-light);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Pushes button to the bottom */
    width: 100%;
}

.project-card-expanded .close-project-btn:hover {
    background-color: #5a6268;
}

/* Ensure grid items stretch - targets the dynamically created grid */
#projects-display-container > div[style*="grid-template-columns"] {
    align-items: stretch !important; /* Important to override inline style if any conflict */
}

/* Placeholder for no images */
.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-medium);
    background-color: #10101a;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* --- Project Submission Form Styling --- */
#project-submission-form {
    background-color: rgba(26, 26, 47, 0.5); /* Dark, slightly transparent background */
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#project-submission-form h2 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.6rem;
}

#project-submission-form div {
    margin-bottom: 1.2rem;
}

#project-submission-form label {
    display: block;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

#project-submission-form input[type="text"],
#project-submission-form input[type="url"],
#project-submission-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(10, 10, 15, 0.7);
    color: var(--text-light);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

#project-submission-form input[type="text"]:focus,
#project-submission-form input[type="url"]:focus,
#project-submission-form textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    background-color: rgba(10, 10, 15, 0.9);
}

#project-submission-form input[type="file"] {
    color: var(--text-medium);
    background-color: rgba(10, 10, 15, 0.7);
    padding: 0.6rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#project-submission-form input[type="file"]::file-selector-button {
    background-color: var(--accent-blue);
    color: var(--text-light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

#project-submission-form input[type="file"]::file-selector-button:hover {
    background-color: #5296f4; /* Lighter blue */
}

#project-submission-form small {
    display: block;
    color: var(--text-medium);
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

#image-preview-container {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap; /* Allow wrapping if many images */
}

#image-preview-container img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#project-submission-form .form-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    border: none;
}

#submit-project-button {
    background-color: var(--accent-gold);
    color: var(--background-dark);
}

#submit-project-button:hover {
    background-color: #fff; /* Lighter gold or white */
    color: #0a0a0f;
    transform: translateY(-2px);
}

#cancel-project-submission {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    margin-left: 10px;
}

#cancel-project-submission:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* --- Downloads Page Specific Styles --- */

.downloads-section { /* Style for sections like Core Files, Optional Files */
    padding: 2rem 1.5rem;
    background-color: rgba(10, 10, 15, 0.6); /* Match other sections */
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.downloads-section h2 {
    color: var(--text-light);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 1.5rem; /* Space between items */
}

.download-item {
    background-color: rgba(26, 26, 47, 0.4); /* Slightly different background */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column; /* Stack content vertically */
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.download-item:hover {
    background-color: rgba(26, 26, 47, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px); /* Subtle lift effect */
}

.download-item h3 {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.download-item p {
    color: var(--text-medium);
    font-size: 0.95rem;
    margin-bottom: 1.5rem; /* Space before button */
    flex-grow: 1; /* Allow description to take available space */
}

.download-button {
    display: inline-block; /* Allow padding and margin */
    background-color: var(--accent-gold);
    color: var(--background-dark);
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: auto; /* Push button to the bottom */
}

.download-button:hover {
    background-color: #fff; /* Lighter gold/white on hover */
    transform: scale(1.03); /* Slightly enlarge button */
}

/* Minimalistic Download Page Styles - Dark Theme */
.downloads-header {
    text-align: center;
    padding: 40px 20px;
    background-color: rgba(10, 10, 15, 0.6); /* Dark background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Dark theme border */
    margin-bottom: 30px;
}

.downloads-header h1 {
    font-size: 2.5em;
    color: var(--text-light); /* Light text */
    margin-bottom: 10px;
}

.downloads-header p {
    font-size: 1.1em;
    color: var(--text-medium); /* Medium light text */
    max-width: 600px;
    margin: 0 auto;
}

.download-section-minimal {
    max-width: 960px;
    margin: 0 auto 32px;
    padding: 32px 24px;
    background: rgba(12, 12, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.download-section-minimal h2 {
    font-size: 1.9em;
    color: var(--text-light);
    margin-bottom: 12px;
}

.download-section-minimal > p {
    margin: 0 0 24px;
    color: var(--text-medium);
    font-size: 1.05em;
}

.resource-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.resource-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.resource-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.resource-text {
    flex: 1 1 60%;
}

.resource-title {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.resource-description {
    display: block;
    font-size: 0.95em;
    color: var(--text-medium);
}

.resource-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-light);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.resource-link:hover {
    background: var(--accent-gold);
    color: var(--background-dark);
    border-color: var(--accent-gold);
}

.component-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px 24px;
}

.component-list .resource-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px 20px;
    background: rgba(15, 15, 26, 0.45);
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.component-list .resource-item:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(18, 18, 30, 0.6);
}

.component-list .resource-link {
    margin-left: auto;
    margin-top: 0;
}

.component-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.video-section {
    text-align: center;
}

.video-section .video-button {
    margin-top: 12px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-light);
}

.video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.video-modal.open {
    display: flex;
}

.video-modal-content {
    position: relative;
    width: min(900px, 90vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-close:hover {
    background: var(--accent-gold);
    color: var(--background-dark);
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 600px) {
    .download-section-minimal {
        padding: 28px 18px;
    }

    .resource-item {
        padding-bottom: 16px;
    }

    .resource-text {
        flex-basis: 100%;
    }

    .resource-link {
        width: 100%;
        justify-content: center;
    }

    .component-list {
        grid-template-columns: 1fr;
    }

    .component-list .resource-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .component-list .resource-link {
        margin-left: 0;
        width: 100%;
    }

    .component-thumb {
        width: 80px;
        height: 80px;
    }
}

.support-section {
    text-align: center;
    padding: 32px 20px;
    margin-bottom: 32px;
    background: rgba(12, 12, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

/* Ensure main content is visible after load */

/* --- Responsive Adjustments (Example) --- */
@media (max-width: 768px) {
    .community-layout {
        flex-direction: column;
        padding: 0 1rem; /* Adjust padding */
    }

    .sidebar-nav {
        flex: 0 0 auto; /* Allow sidebar to take natural width */
        width: 100%; /* Full width on small screens */
        position: static; /* Remove sticky positioning */
        margin-bottom: 1.5rem;
    }

    .navbar-content {
        padding: 0 1rem; /* Adjust navbar padding */
    }

    .nav-links {
        /* Consider implementing a mobile menu toggle */
        display: none; /* Hide links by default on small screens */
    }

    .download-grid {
        grid-template-columns: 1fr; /* Stack items vertically */
    }
}

@media screen and (max-width: 768px) {
    /* Ensure better text readability on mobile */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Improve button touch targets */
    button, a, .nav-links a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .hero {
        padding: 1rem;
        min-height: 60vh;
    }
    
    .hero-content {
        height: 50vh;
    }
    
    /* Improve footer on mobile */
    .site-footer {
        padding: 2rem 1rem;
    }
    
    .social-card-container {
        gap: 1rem;
    }
    
    .socialContainer {
        width: 50px;
        height: 50px;
    }
}

/* Debug helper to verify mobile breakpoints are working */
@media screen and (max-width: 768px) {
    body::before {
        content: "Mobile view active";
        position: fixed;
        top: 0;
        left: 0;
        background: rgba(255, 0, 0, 0.8);
        color: white;
        padding: 5px 10px;
        font-size: 12px;
        z-index: 9999;
        display: none; /* Hide by default, uncomment for debugging */
    }
}

/* Additional mobile navigation improvements */
@media screen and (max-width: 768px) {
    .nav-toggle {
        display: flex; /* Show the toggle button */
    }

    .nav-links {
        display: none; /* Keep links hidden by default */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: rgba(10, 10, 15, 0.9);
        padding: 1rem;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; /* Show links when active */
    }

    .nav-links a {
        padding: 0.8rem 1.2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links a:last-child {
        border-bottom: none; /* Remove border from last link */
    }

    .auth-buttons-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }

    .auth-buttons-nav button {
        width: 100%;
        padding: 0.7rem;
    }
}

/* Ensure consistent spacing and alignment in mobile nav */
@media screen and (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .nav-brand {
        margin-bottom: 1rem;
    }

    .nav-toggle {
        margin-bottom: 1rem;
    }

    .nav-links {
        width: 100%;
    }

    .nav-links a {
        padding: 0.8rem 1.2rem;
        text-align: left;
    }

    .auth-buttons-nav {
        width: 100%;
        margin-top: 1rem;
    }
}

/* --- Miscellaneous Styles --- */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Smooth scroll for Safari */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
:focus {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Custom property for transition duration */
:root {
    --transition-duration: 0.3s;
}

/* Apply transition to all elements (or specific ones) */
* {
    transition: all var(--transition-duration) ease;
}

/* --- End of CSS Document --- */

