.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Tabs */
.tab-controls {
    display: flex;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 12px;
}

.tab-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    font-family: 'Varela Round', sans-serif;
    font-weight: 600;
    color: #64748b;
    transition: 0.2s;
}

.tab-btn.active {
    background: white;
    color: var(--blue-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Thread Item Styling */
.thread-card {
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.thread-card h3 {
    margin: 0 0 10px 0;
    color: var(--blue-deep);
}

.meta-info {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 15px;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.user-mention {
    color: var(--blue-primary);
    font-weight: 700;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 30px;
}

.modal-content input, .modal-content textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* FORCE the container to move below the fixed navbar */
.container {
    margin-top: 120px !important; /* Push everything down */
    text-align: left !important;   /* Fix the centering from main style.css */
    display: block !important;
    padding: 0 20px;
}

/* Ensure the header takes up the full width and shows its items */
.forum-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 40px;
    background: transparent;
}

/* Make the button ultra-visible to verify it's there */
.create-btn {
    background: var(--blue-primary) !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    display: inline-block !important;
    cursor: pointer !important;
    border: none;
    z-index: 10;
}

/* Fix the grid so the 'No threads' message doesn't hide everything */
.features-grid {
    display: grid !important;
    grid-template-columns: 1fr; /* Default to one big column for the empty message */
    gap: 20px;
    width: 100%;
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed #e2e8f0;
    border-radius: 20px;
    color: #64748b;
    font-size: 1.1rem;
    margin: 20px 0;
}

.empty-msg a {
    color: var(--blue-primary);
    font-weight: 700;
    text-decoration: none;
}

/* Style for the Cancel Button */
.cancel-btn {
    background: #f1f5f9 !important; /* Soft grey */
    color: #64748b !important;      /* Muted slate */
    border: none;
    padding: 10px 22px;
    border-radius: 50px;
    font-family: 'Varela Round', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #e2e8f0 !important;
    color: #475569 !important;
    transform: scale(1.02);
}

/* Ensure the Post button (nav-btn) looks primary in the modal */
.modal-actions .nav-btn {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Input styling inside modal */
.modal-content input, 
.modal-content textarea {
    border: 1px solid #e2e8f0;
    background: #f8faff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content input:focus, 
.modal-content textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

/* Container: Inline-block stops it from hogging the whole row */
.search-container {
    position: relative;
    display: inline-block; 
    width: 220px; /* Shorter width to fit in the header row */
    margin: 0 10px;
    vertical-align: middle;
    z-index: 1000;
}

/* The Input: Bright Blue & Compact */
#forumSearch {
    width: 100%;
    padding: 8px 15px; /* Smaller padding */
    border-radius: 12px;
    border: 2px solid #60a5fa; /* Light blue border */
    background: #eff6ff; /* Very light blue background */
    color: #1e40af; /* Dark blue text for readability */
    font-family: 'Varela Round', sans-serif;
    font-size: 0.85rem; /* Smaller text */
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

#forumSearch::placeholder {
    color: #93c5fd; /* Soft blue placeholder */
}

#forumSearch:focus {
    background: #ffffff;
    border-color: #2563eb; /* Primary Pal Blue */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* The Dropdown: Matching Blue Theme */
.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: none;
    border-radius: 12px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: none;
}

.search-dropdown.active {
    display: block;
    border: 2px solid #bfdbfe;
}

/* Items in the dropdown */
.search-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #1e3a8a;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8rem;
    transition: background 0.1s;
}

.search-item:hover {
    background: #dbeafe; /* Light blue highlight on hover */
}

.search-title {
    display: block;
    font-weight: bold;
    color: #2563eb;
}

.user-search-wrapper { position: relative; margin: 10px 0; }

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.user-tag {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.remove-tag { cursor: pointer; color: #ef4444; }

.user-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 3000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.user-result {
    padding: 10px;
    cursor: pointer;
    font-family: 'Varela Round', sans-serif;
}

.user-result:hover { background: #f0f9ff; }