/* ============================================================
   NodeSpace Help Center - Custom Theme Styles
   Bootstrap 4 overlay for the nodespace-kb HESK theme
   ============================================================ */

/* --- Layout ------------------------------------------------- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex-grow: 1;
}

/* --- Brand colour ------------------------------------------- */
.custom-bg {
    background-color: #1D2F49;
}

/* --- Navigation -------------------------------------------- */
.navbar {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.navbar-brand img {
    height: 36px;
    width: auto;
}

.navbar-dark .navbar-nav .nav-link {
    font-size: 0.9rem;
    opacity: 0.85;
    transition: opacity 0.15s ease;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
    opacity: 1;
}

/* --- Search section ---------------------------------------- */
.custom-bg .form-group {
    display: flex;
    align-items: center;
    max-width: 680px;
    margin: 0 auto;
    margin-bottom: 0;
}

.custom-bg .form-control {
    border-radius: 4px 0 0 4px;
    border: none;
    padding: 0.65rem 1rem;
    font-size: 0.975rem;
    height: auto;
    box-shadow: none;
    flex: 1 1 auto;
}

.custom-bg .form-control:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
    outline: none;
}

.custom-bg #search-button {
    flex: 0 0 auto;
    border-radius: 0 4px 4px 0;
    background-color: #2980b9;
    color: #fff;
    border: none;
    padding: 0.65rem 1.5rem;
    font-size: 0.975rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.custom-bg #search-button:hover {
    background-color: #2272a3;
}

/* --- Breadcrumbs ------------------------------------------- */
.breadcrumb {
    background-color: transparent;
    padding-left: 0;
    margin-bottom: 0;
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: #2980b9;
}

.breadcrumb-item a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* --- Cards -------------------------------------------------- */
.card {
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.card-title a {
    color: #1D2F49;
    font-weight: 600;
    text-decoration: none;
}

.card-title a:hover {
    color: #2980b9;
}

/* --- Topic list inside category cards ---------------------- */
.topics__list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

.topics__list li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f0f0;
}

.topics__list li:last-child {
    border-bottom: none;
}

.topics__list a {
    color: #2980b9;
}

.topics__list a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

/* --- Article content --------------------------------------- */
.article img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

.article a {
    color: #2980b9;
}

.article a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

.article h1, .article h2, .article h3,
.article h4, .article h5 {
    color: #1D2F49;
    margin-top: 1.4rem;
    margin-bottom: 0.6rem;
}

/* --- Section headings -------------------------------------- */
.h-3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1D2F49;
    margin-bottom: 1rem;
}

/* --- Tables ------------------------------------------------ */
.table thead th {
    background-color: #f4f6f9;
    border-top: none;
    border-bottom: 2px solid #dee2e6;
    color: #1D2F49;
    font-size: 0.825rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table td a {
    color: #2980b9;
    font-weight: 500;
}

.table td a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

.navlink__descr {
    color: #6c757d;
    font-size: 0.825rem;
    margin: 0.2rem 0 0;
}

/* --- Star rating ------------------------------------------- */
.star-rate {
    position: relative;
    width: 84px;
    height: 15px;
}

.star-rate .icon-star-stroke {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 84px;
    height: 15px;
}

.star-rate .star-filled {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 15px;
    overflow: hidden;
    line-height: 0;
    fill: #EEB707;
}

.star-rate .star-filled .icon-star-filled {
    width: 84px;
    height: 15px;
}

.star-rate.rate-05 .star-filled,
.star-rate.rate-5  .star-filled  { z-index: 2; width: 10%; }
.star-rate.rate-10 .star-filled  { z-index: 2; width: 20%; }
.star-rate.rate-15 .star-filled  { z-index: 2; width: 30%; }
.star-rate.rate-20 .star-filled  { z-index: 2; width: 40%; }
.star-rate.rate-25 .star-filled  { z-index: 2; width: 50%; }
.star-rate.rate-30 .star-filled  { z-index: 2; width: 60%; }
.star-rate.rate-35 .star-filled  { z-index: 2; width: 70%; }
.star-rate.rate-40 .star-filled  { z-index: 2; width: 80%; }
.star-rate.rate-45 .star-filled  { z-index: 2; width: 90%; }
.star-rate.rate-50 .star-filled  { z-index: 2; width: 100%; }

/* --- Rating inline display --------------------------------- */
.rate {
    display: -ms-inline-flexbox;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    font-size: 12px;
    letter-spacing: 0.1px;
}

/* --- Footer ------------------------------------------------ */
.ns-footer {
    background-color: #152337;
    color: rgba(255, 255, 255, 0.75);
    padding: 1.25rem 0;
    margin-top: 3rem;
}

.ns-footer p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* --- Error / Notification ---------------------------------- */
.notification.red {
    background-color: #fff5f5;
    border-left: 4px solid #dc3545;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    color: #721c24;
    margin-bottom: 1rem;
}

/* --- Subcategory section (folder list above articles) ------ */
.topics__list--subcats li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.subcat-folder-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.5;
}

.subcat-divider {
    margin: 0.4rem 0 0.5rem;
    border-color: #edf0f3;
}

/* --- KB Article -------------------------------------------- */
.kb-article__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1D2F49;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.kb-article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1rem;
    font-size: 0.825rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.kb-article__meta-item {
    display: inline-flex;
    align-items: center;
}

.kb-article__meta-item a {
    color: #2980b9;
}

.kb-article__meta-item a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

.kb-article__body {
    font-size: 0.975rem;
    line-height: 1.7;
    color: #212529;
}

.kb-article__body img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 0.5rem 0;
}

.kb-article__body a {
    color: #2980b9;
}

.kb-article__body a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

.kb-article__body h1,
.kb-article__body h2,
.kb-article__body h3,
.kb-article__body h4,
.kb-article__body h5 {
    color: #1D2F49;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.kb-article__body h1 { font-size: 1.5rem; }
.kb-article__body h2 { font-size: 1.3rem; }
.kb-article__body h3 { font-size: 1.15rem; }
.kb-article__body h4 { font-size: 1rem; }
.kb-article__body h5 { font-size: 0.9rem; }

.kb-article__body pre {
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
}

.kb-article__body blockquote {
    border-left: 3px solid #2980b9;
    padding-left: 1rem;
    margin-left: 0;
    color: #495057;
    font-style: italic;
}

/* --- Helpful / Rating -------------------------------------- */
.kb-article__helpful {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.kb-article__helpful-label {
    margin: 0;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.btn-helpful {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
}

.btn-helpful--yes {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
}

.btn-helpful--yes:hover {
    background-color: #218838;
    color: #fff;
    text-decoration: none;
}

.btn-helpful--no {
    background-color: #fff;
    color: #6c757d;
    border-color: #ced4da;
}

.btn-helpful--no:hover {
    background-color: #e9ecef;
    color: #495057;
    text-decoration: none;
}

/* --- KB Sidebar -------------------------------------------- */
.kb-sidebar {
    position: sticky;
    top: 1rem;
}

.kb-sidebar__section {
    margin-bottom: 1.5rem;
}

.kb-sidebar__heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.kb-sidebar__feedback-btn {
    display: block;
    text-align: center;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border: 1px solid #2980b9;
    border-radius: 4px;
    color: #2980b9;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.kb-sidebar__feedback-btn:hover {
    background-color: #2980b9;
    color: #fff;
    text-decoration: none;
}

/* --- Popular / Latest Articles tabs ------------------------ */
.kb-popular {
    margin-top: 2rem;
    border-top: 2px solid #e9ecef;
    padding-top: 1rem;
}

.kb-popular__nav {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 0;
    gap: 0.25rem;
}

.kb-popular__nav .nav-link {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.5rem 1rem;
    border-radius: 0;
}

.kb-popular__nav .nav-link.active {
    color: #2980b9;
    border-bottom-color: #2980b9;
    background: none;
}

.kb-popular__nav .nav-link:hover:not(.active) {
    color: #495057;
    border-bottom-color: #adb5bd;
    background: none;
}

.kb-popular__content {
    padding-top: 0.5rem;
}

.kb-popular__item {
    display: block;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    border-radius: 4px;
    transition: background-color 0.12s ease;
}

.kb-popular__item:last-child {
    border-bottom: none;
}

.kb-popular__item:hover {
    background-color: #f8fbfe;
    text-decoration: none;
    color: inherit;
}

.kb-popular__item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #2980b9;
}

.kb-popular__item:hover .kb-popular__item-title {
    color: #1a6fa0;
    text-decoration: underline;
}

.kb-popular__item-preview {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Attachments section ----------------------------------- */
.kb-sidebar__section--attachments {
    background-color: #f0f7ff;
    border: 1px solid #c8e0f4;
    border-left: 3px solid #2980b9;
    border-radius: 4px;
    padding: 0.75rem 1rem;
}

.kb-sidebar__section--attachments .kb-sidebar__heading {
    color: #2980b9;
}

.kb-sidebar__attachments-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

.kb-sidebar__attachments-list li {
    padding: 0.3rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #d8ecf8;
}

.kb-sidebar__attachments-list li:last-child {
    border-bottom: none;
}

.kb-sidebar__attachments-list a {
    color: #2980b9;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.kb-sidebar__attachments-list a:hover {
    color: #1a6fa0;
    text-decoration: underline;
}

.kb-sidebar__attachments-list .attachment-icon {
    flex-shrink: 0;
    opacity: 0.75;
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 767.98px) {
    .custom-bg .form-group {
        flex-wrap: nowrap;
    }

    .custom-bg .form-control {
        /* prevent iOS auto-zoom on focus */
        font-size: 16px;
    }
}
