:root {
    --primary-color: #3b5998; /* Facebook blue */
    --secondary-color: #f0f2f5;
    --accent-color: #1877f2;
}

body {
    background-color: var(--secondary-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding-top: 56px; /* Adjust based on navbar height */
}

.navbar {
    background-color: var(--primary-color);
    flex-wrap: nowrap;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand, .nav-link {
    color: white !important;
}

/* Fix for possible Bootstrap 5 navbar display issues */
.collapse.navbar-collapse {
    display: flex !important;
}

.navbar-nav.ms-auto {
    display: flex !important;
    margin-left: auto !important;
}

.navbar-nav .nav-item {
    display: block !important;
}

.nav-link {
    display: block !important;
    padding: 0.5rem 1rem !important;
}

/* Ensure navbar-toggler is visible and styled properly */
.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.25rem;
    color: white;
    margin-right: 1rem;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Fix dropdown menu styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.25rem;
}

.dropdown-menu.show {
    display: block;
}

/* Responsive navbar adjustments */
@media (max-width: 992px) {
    .navbar-collapse {
        display: none !important;
    }

    .navbar-collapse.show {
        display: block !important;
    }

    .navbar-nav {
        flex-direction: column !important;
    }

    .navbar-nav.ms-auto {
        margin-left: 0 !important;
        margin-top: 1rem !important;
    }
}

.navbar-brand img {
    max-height: 30px; /* Adjust height as needed */
    width: auto;
    margin-right: 8px; /* Add some space between logo and text */
}

.content-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.post-form {
    padding: 16px;
    border-bottom: 1px solid #e4e6eb;
}

.post {
    padding: 16px;
}

.post .post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.post .post-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 8px;
}

.post .post-header .post-meta {
    flex-grow: 1;
}

.post .post-header .post-meta .post-author {
    font-weight: bold;
    color: #050505;
}

.post .post-header .post-meta .post-time {
    color: #65676b;
    font-size: 12px;
}

.post .post-content {
    margin-bottom: 16px;
}

.post .post-actions {
    display: flex;
    border-top: 1px solid #e4e6eb;
    padding-top: 8px;
}

.post .post-actions button {
    flex-grow: 1;
    background: none;
    border: none;
    color: #65676b;
    font-weight: 600;
    padding: 8px;
    border-radius: 4px;
}

.post .post-actions button:hover {
    background-color: #f0f2f5;
}

.ai-score {
    background-color: #e6f3ff;
    border-left: 4px solid var(--accent-color);
    padding: 8px 12px;
    margin-top: 12px;
}

.user-score {
    background-color: #e6ffe6;
    border-left: 4px solid #28a745;
    padding: 8px 12px;
    margin-top: 12px;
}

.sidebar {
    position: sticky;
    top: 70px; /* Adjust based on navbar height */
}

/* Login form styles */
.login-container {
    max-width: 400px;
    margin: 80px auto;
}

.login-card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    background-color: white;
    padding: 20px;
}

/* Form control overrides */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #2d4373;
    border-color: #2d4373;
}

/* Extra CSS block placeholder */
/* Add styles here that might have been in {% block extra_css %} */

/* Mobile and Tablet Responsive Navigation */
@media (max-width: 991px) {
    /* Fix external login links that may be outside the normal navbar structure */
    .auth-links {
        display: none !important;
    }

    /* Ensure all navbar items are in the collapsed menu */
    .navbar > .container {
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    /* Make navbar collapse full width and clearly defined */
    .navbar-collapse {
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 1rem !important;
        z-index: 1030 !important;
        background-color: var(--primary-color) !important; /* Ensure background color */
        box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important; /* Add shadow for depth */
    }

    /* Fix transitions */
    .navbar-collapse {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    /* Force display styles for mobile */
    .navbar-collapse:not(.show) {
        display: none !important;
    }

    .navbar-collapse.show {
        display: block !important;
    }

    /* Hide standard menu items by default */
    .navbar-nav {
        flex-direction: column;
    }

    .navbar-nav .nav-item {
        margin-bottom: 8px;
    }

    /* Fix dropdown menu in mobile view */
    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 8px;
        background-color: rgba(255,255,255,0.1);
        border: none;
    }

    .dropdown-menu a {
        color: white !important;
    }

    .navbar-brand {
        max-width: 80%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ensure toggle button is visible */
    .navbar-toggler {
        display: block;
        padding: 0.25rem 0.75rem;
        font-size: 1.25rem;
        line-height: 1;
        background-color: transparent;
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 0.25rem;
        color: white;
    }

    .navbar-toggler-icon {
        display: inline-block;
        width: 1.5em;
        height: 1.5em;
        vertical-align: middle;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 100%;
    }
}

/* Fix for very small screens */
@media (max-width: 576px) {
    .navbar-brand {
        max-width: 70%;
        font-size: 0.9rem;
    }

    .navbar-brand img {
        max-height: 25px;
    }
}

/* Clickable Card Styles */
.clickable-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.clickable-card .tag-badge,
.clickable-card .btn,
.clickable-card button,
.clickable-card a,
.clickable-card form {
    position: relative;
    z-index: 10;
}

/* Force Google OAuth buttons to be visible */
.btn-danger[href*="google/login"] {
    display: block !important;
}

/* Additional safety for social login buttons */
a[href*="/accounts/google/login/"] {
    display: block !important;
}
