/* Main Forum Styles */

/* Container Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.main-content {
    flex: 1;
    min-width: 0;
    flex-basis: 70%;
}

.sidebar {
    flex: 0 0 25%;
    min-width: 250px;
}

/* Forum Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.category-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px;
    display: flex;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-icon {
    flex: 0 0 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #4e73df;
    font-size: 1.5rem;
}

.category-info {
    flex: 1;
}

.category-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.category-info p {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 0.9rem;
}

.category-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #777;
}

.category-header {
    background-color: #f7f9fc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.subcategories {
    margin-bottom: 30px;
}

/* Thread Listing */
.threads-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.section-header {
    padding: 15px 20px;
    background-color: #f7f9fc;
    border-bottom: 1px solid #eaedf2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.threads-list {
    width: 100%;
}

.thread-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    padding: 10px 15px;
    background-color: #f0f4f8;
    color: #555;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.thread-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    padding: 15px;
    border-bottom: 1px solid #eaedf2;
    align-items: center;
    transition: background-color 0.2s ease;
}

.thread-row:hover {
    background-color: #f7f9fc;
}

.thread-row.pinned {
    background-color: #fffdf0;
}

.thread-row.closed {
    background-color: #f7f7f7;
    color: #777;
}

.thread-info {
    display: flex;
}

.thread-icon {
    flex: 0 0 30px;
    color: #4e73df;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thread-icon i {
    font-size: 1.1rem;
}

.thread-title-container {
    padding-right: 15px;
}

.thread-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    color: #333;
    text-decoration: none;
}

.thread-title:hover {
    color: #4e73df;
}

.thread-meta {
    font-size: 0.8rem;
    color: #777;
}

.thread-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reply-count {
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}

.view-count {
    font-size: 0.8rem;
    color: #777;
}

.thread-last-post {
    font-size: 0.85rem;
    color: #555;
}

.last-reply-by {
    margin-bottom: 2px;
}

.last-reply-date {
    font-size: 0.8rem;
    color: #777;
}

.no-replies {
    color: #999;
    font-style: italic;
    font-size: 0.8rem;
}

/* Individual Thread View */
.thread-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.breadcrumbs {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #777;
}

.breadcrumbs a {
    color: #4e73df;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.thread-header {
    margin-bottom: 20px;
}

.thread-header h1 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    color: #333;
}

.thread-meta {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.thread-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.post {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.post-sidebar {
    flex: 0 0 180px;
    padding: 20px;
    background-color: #f7f9fc;
    border-right: 1px solid #eaedf2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background-color: #4e73df;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    text-align: center;
    width: 100%;
}

.username {
    font-weight: 600;
    margin-bottom: 5px;
}

.username a {
    color: #4e73df;
    text-decoration: none;
}

.user-title {
    color: #777;
    font-size: 0.8rem;
    text-transform: capitalize;
    margin-bottom: 10px;
}

.user-stats {
    font-size: 0.8rem;
    color: #777;
    margin-top: 10px;
    text-align: left;
}

.post-main {
    flex: 1;
    padding: 20px;
    position: relative;
}

.solution-badge {
    background-color: #ebfbee;
    color: #2e7d32;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.post-content {
    margin-bottom: 20px;
    line-height: 1.6;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eaedf2;
    font-size: 0.85rem;
}

.post-date {
    color: #777;
}

.post-number {
    font-weight: 600;
    margin-right: 5px;
}

.post-actions {
    display: flex;
    gap: 15px;
}

.button-link {
    background: none;
    border: none;
    color: #4e73df;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.button-link:hover {
    text-decoration: underline;
}

.edited-info {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
    margin-bottom: 10px;
}

.replies-container {
    margin: 30px 0;
}

.replies-container h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.reply {
    background-color: #fafafa;
}

.reply.solution {
    border-left: 4px solid #2e7d32;
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    padding: 5px;
    background-color: #f7f9fc;
    border: 1px solid #eaedf2;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.editor-toolbar button {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-toolbar button:hover {
    background-color: #eaedf2;
}

.reply-form-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    margin-top: 30px;
}

.thread-closed-message {
    background-color: #f7f7f7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 30px;
    color: #777;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-to-reply {
    background-color: #f7f9fc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    text-align: center;
}

.preview-container {
    background-color: #f7f9fc;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #eaedf2;
}

.preview-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
}

/* Widget Sidebar */
.widget {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 15px;
    margin-bottom: 20px;
}

.widget h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaedf2;
}

.stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stats-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-list li i {
    color: #4e73df;
    width: 20px;
    text-align: center;
}

.participants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: block;
}

.participant img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.online-users {
    font-size: 0.9rem;
}

.avatar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #4e73df;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.thread-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.thread-info-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-info-list li i {
    color: #4e73df;
    width: 20px;
    text-align: center;
}

/* Buttons and Forms */
.button {
    background-color: #f0f4f8;
    color: #555;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.button:hover {
    background-color: #eaedf2;
}

.button.primary {
    background-color: #4e73df;
    color: white;
}

.button.primary:hover {
    background-color: #3a5fc8;
}

.form-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 25px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.form-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 0.8rem;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group.checkbox input {
    margin: 0;
}

.form-group.checkbox label {
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.error-message {
    background-color: #fdecea;
    color: #c62828;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alternative-action {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
}

.separator {
    margin: 15px 0;
    display: flex;
    align-items: center;
    color: #999;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #eaedf2;
}

.separator::before {
    margin-right: 10px;
}

.separator::after {
    margin-left: 10px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

/* Responsive */
@media (max-width: 768px) {
    
    /* Fix search bar gap on mobile */
    .navbar form {
        display: flex;
        gap: 0;
        margin: 0;
    }
    
    .navbar form input[type="text"] {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: none;
        margin: 0;
    }
    
    .navbar form + button,
    .navbar button.icon-btn {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        margin: 0;
        margin-left: -5px;
    }
    
    /* Center search bar on mobile */
    .navbar form {
        width: 100%;
        padding: 10px 20px;
        display: flex;
        justify-content: center;
    }
    
    .navbar input[type="text"] {
    
        margin-left: 0;
    }
    /* Mobile navbar styles */
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        align-items: flex-start;
    }
    
    .navbar .icon {
        position: relative;
        right: 0;
        top: 0;
        display: block;
    }
    
    .navbar .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    .navbar.open .nav-links {
        display: flex;
    }
    
    .navbar .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        
    }

    .container {
        flex-direction: column;
    }
    
    .sidebar {
        flex-basis: 100%;
        order: 2;
    }
    
    .thread-header {
        grid-template-columns: 1fr;
    }
    
    .thread-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .thread-last-post {
        display: none;
    }
    
    .post {
        flex-direction: column;
    }
    
    .post-sidebar {
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid #eaedf2;
        padding: 15px;
        flex-direction: row;
        align-items: center;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .user-info {
        text-align: left;
    }
}
/* Fix search bar gap - additional styles */
@media (max-width: 768px) {
    .search-container.mobile-only {
        display: flex;
        align-items: center;
        gap: 0;
        padding: 10px 20px;
    }
    
    .search-container.mobile-only .search-bar {
        flex: 1;
        margin: 0;
    }
    
    .search-container.mobile-only .search-bar input {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: none;
        width: 100%;
    }
    
    .search-container.mobile-only .icon-btn {
        margin: 0;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

/* AGGRESSIVE fix for search bar gap */
@media (max-width: 768px) {
    .search-container.mobile-only {
        display: flex !important;
        align-items: stretch !important;
        gap: 0 !important;
        padding: 10px 20px;
        width: 100%;
    }
    
    .search-container.mobile-only .search-bar {
        flex: 1;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .search-container.mobile-only .search-bar input {
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        border-right: none !important;
        margin: 0 !important;
        width: 100%;
    }
    
    .search-container.mobile-only .icon-btn {
        margin: 0 !important;
        margin-left: -1px !important;
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
    
    .search-container.mobile-only form {
        margin: 0 !important;
        padding: 0 !important;
    }
}
