:root {
    --primary-color: #0E2A3E;
    --secondary-color: #242424;
    --bg-white: #fff;
    --text-color: #242424;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --accent-color: #0d6efd;
    --sidebar-width: 280px;
    --header-height: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

a {
    text-decoration: unset;
}


/* --- Utility Classes --- */

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.cursor-pointer {
    cursor: pointer;
}


/* --- Sidebar --- */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar-logo {
    padding: 25px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo a {
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 15px;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 10px;
    transition: all 0.3s;
    font-weight: 500;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-menu i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 15px;
}


/* --- Main Content Layout --- */

.dashboard-wrapper {
    display: flex;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* --- Header / Top Navbar --- */

.top-navbar {
    background: #fff;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 999;
}

.search-bar {
    width: 400px;
}

.search-bar .input-group {
    background: var(--light-gray);
    border-radius: 10px;
    padding: 2px 15px;
}

.search-bar .form-control {
    background: transparent;
}


/* --- Nav Dropdowns --- */

.nav-item-dropdown {
    position: relative;
    cursor: pointer;
}

.dropdown-menu-custom {
    position: absolute;
    right: 0;
    top: 55px;
    background: #fff;
    min-width: 240px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 1050;
    border: 1px solid var(--border-color);
    padding: 10px 0;
}

.dropdown-menu-custom.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item-custom {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.dropdown-item-custom:hover {
    background: var(--light-gray);
    color: var(--primary-color);
}

.dropdown-item-custom i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}


/* --- Page Body --- */

.content-body {
    padding: 40px;
    flex: 1;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2,
.page-header h4 {
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}


/* --- Cards --- */

.card-custom {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 30px;
    border: none;
    transition: transform 0.3s;
}

.card-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15rem;
}


/* --- Stats Cards --- */

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--border-color);
    transform: translateY(-5px);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-right: 20px;
}

.bg-primary-light {
    background: rgba(14, 42, 62, 0.08);
    color: var(--primary-color);
}

.bg-success-light {
    background: rgba(40, 167, 69, 0.08);
    color: #28a745;
}

.bg-info-light {
    background: rgba(23, 162, 184, 0.08);
    color: #17a2b8;
}

.bg-warning-light {
    background: rgba(255, 193, 7, 0.08);
    color: #ffc107;
}

.stat-info h5 {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

.stat-info h2 {
    margin: 5px 0 0;
    font-weight: 800;
    color: var(--primary-color);
}


/* --- Forum List --- */

.forum-header {
    background: var(--light-gray);
    padding: 15px 25px;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-item {
    display: flex;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s;
}

.forum-item:last-child {
    border-bottom: none;
}

.forum-item:hover {
    background: #fcfcfc;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.forum-info {
    flex: 2;
}

.forum-info h6 a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.2s;
}

.forum-info h6 a:hover {
    color: var(--primary-color);
}

.forum-stats {
    flex: 0.8;
    text-align: center;
}

.forum-last-post {
    flex: 1.2;
    text-align: right;
}


/* --- Forum Detail --- */

.post-card {
    display: flex;
    gap: 30px;
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.post-card:last-child {
    border-bottom: none;
}

.post-author {
    width: 160px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    padding-right: 30px;
}

.post-author img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.post-author h5 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.author-role {
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
    font-weight: 600;
    text-transform: uppercase;
}

.post-content {
    flex: 1;
}

.post-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
    font-weight: 500;
}

.post-image {
    max-width: 100%;
    height: 400px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}


/* --- Buttons --- */

.btn-primary-custom {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary-custom:hover {
    background-color: var(--secondary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}


/* --- Forms --- */

.form-group {
    margin-bottom: 15px;
    position: relative;
}

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

.form-control {
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 10px;
    transition: all 0.3s;
    font-size: 0.95rem;
    appearance: auto;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 42, 62, 0.05);
}

.password-toggle {
    position: absolute;
    right: 18px;
    top: 50px;
    cursor: pointer;
    color: #adb5bd;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary-color);
}


/* --- Auth Pages --- */

.logo-container {
    padding: 30px 0;
}

.auth-wrapper {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
}

header.logo-container a {
    text-align: center;
    display: block;
    font-size: 30px;
    color: #000;
    font-weight: 700;
}

.auth-box h3 {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 35px;
    text-align: center;
}


/* --- Toast Notifications --- */

#toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
}

.toast-custom {
    background: #fff;
    color: var(--text-color);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid var(--primary-color);
}

.toast-custom.show {
    transform: translateX(0);
}

.toast-custom.success {
    border-left-color: #28a745;
}

.toast-custom.error {
    border-left-color: #dc3545;
}


/* --- Mobile Sidebar Toggle --- */

.sidebar-mobile-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: 0 5px 20px rgba(14, 42, 62, 0.3);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s;
}


/* --- Responsive Adjustments --- */

@media (max-width: 991.98px) {
    .sidebar {
        left: -var(--sidebar-width);
    }
    .sidebar.active {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .top-navbar {
        padding: 0 15px;
    }
    .search-bar {
        width: 100%;
        max-width: 250px;
    }
    .content-body {
        padding: 20px;
    }
    .post-card {
        flex-direction: column;
        gap: 15px;
    }
    .post-author {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 20px;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 20px;
    }
    .post-author img {
        width: 60px;
        height: 60px;
        margin-bottom: 0;
    }
}

.profile-upload {
    position: relative;
    width: 140px;
    margin: 0 auto 40px;
}

.profile-img-preview {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--accent-color);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid #fff;
    transition: all 0.2s;
}

.upload-btn:hover {
    transform: scale(1.1);
    background: var(--primary-color);
}


/* --- Pagination --- */

.pagination .page-link {
    border-radius: 8px;
    margin: 0 5px;
    border: none;
    color: var(--secondary-color);
    font-weight: 600;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}


/* --- Misc --- */

.breadcrumb-nav {
    margin-bottom: 25px;
}

.breadcrumb-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

.badge-role {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
}

.forgot-btns {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.forgot-btns .btn-primary-custom {
    margin: 0 !important;
}