/*
 * Kunena Extras (DrayTek) - forum styles.
 *
 * Section 1 is your old Aurelia custom.scss, compiled to CSS.
 * Section 2 holds the small edits you made to Aurelia's general/icons/user
 * SCSS, plus styles that used to be inline in template files.
 * Section 3 styles the plugin's own elements.
 */

/* ---- 1. From aurelia/assets/scss/custom.scss ---------------------------- */
.pb-3 {
  margin-left: 20px;
  margin-right: 20px;
}

#kunena.layout {
  padding: 25px;
}

.alert-dismissible .btn-close {
  padding: 10px;
}

#kunena.layout .kfrontend {
  margin-top: 20px !important;
  margin-bottom: 0px;
}

.input-group .btn {
  z-index: 2;
  position: relative;
  margin-top: 0px !important;
  height: 28px;
  padding-top: 2px;
}

#mod-search-searchword {
  font-size: 14px;
}

.category th a {
  border-bottom: unset;
}

.page-link {
  border-color: unset;
}

#kunena.layout .kmessagepadding {
  padding-bottom: 20px;
  margin-top: 20px !important;
}

.profilebox {
  background: unset;
  color: unset;
  border: unset;
  margin-top: 20px;
}

.row > * {
  padding: 0 0 0 0em !important;
}

.row {
  margin: 0;
}

.float-end span {
  margin-right: 20px;
}

#kunena.layout .topic-starter {
  border: unset !important;
  color: #666 !important;
}

#kunena.layout .kwho-user {
  color: #666 !important;
}

.message-published > div.btn-toolbar.btn-marging.kmessagepadding {
  padding-left: 20px;
}

#kunena.layout .dropdown-toggle {
  color: #fff !important;
}

.btn-check:checked + .btn, :not(.btn-check) + .btn:active, .btn:first-child:active, .btn.active, .btn.show {
  background-color: #fff;
  color: #666;
}

#kunena.layout .btn-check:checked + .btn, #kunena.layout :not(.btn-check) + .btn:active, #kunena.layout .btn:first-child:active, #kunena.layout .btn.active, #kunena.layout .btn.show {
  background-color: #fff;
  color: #666 !important;
}

#qrlocalstorage2 {
  text-decoration: none;
}

#home-tab {
  height: auto;
}

td, tr {
  border-bottom: unset !important;
}

#kunena.layout .badger-left:after {
  left: 14px !important;
}

.breadcrumb-item + .breadcrumb-item:before {
  content: "";
}

.mod-kunena-breadcrumbs {
  padding-left: 0;
}

#kunena.layout h1 {
  padding-left: 5px;
  padding-bottom: 15px;
}

#postform > div.shadow-lg.p-3.mb-5.rounded > div.form-group.row > label {
  width: 112px;
}

.nav-link {
  height: 40px;
  color: #d32d21;
}

.nav-link.active {
  color: #666;
}

.kcat-icon > a {
  border-bottom: unset !important;
}

nav {
  margin-top: 25px;
}

#kunena.layout .form-select {
  padding: 0;
  padding-left: 20px;
}

.fa-arrow-circle-up:before {
  content: "";
}

#kunena.layout .kmsg {
  font-family: inherit !important;
}

ul.nav-tabs {
  margin-bottom: 20px;
}

.checkbox input[type=checkbox], .radio input[type=radio] {
  float: left;
  margin-left: 0px;
  margin-right: 10px;
  margin-top: 6px;
}

#button-searchatdate {
  height: 30px !important;
}

.table > :not(caption) > * > * {
  color: #666;
}

.topictitle {
  font-weight: bold;
}

.started {
  font-size: 13px;
}

#kchecktask {
  height: 28px;
}

.list-group-item {
  border: unset !important;
}

#kcatcount {
  font-size: 14px;
  padding-left: 7px;
  vertical-align: middle;
}

.kcat-icon {
  text-align: center;
}

.btn-link {
  text-decoration: unset !important;
}

.page-link {
  height: auto !important;
  color: #d32d21;
}

.page-link:focus {
  box-shadow: none !important;
}

.content ul li a {
  border-bottom: transparent !important;
}

.center a {
  border-bottom: transparent !important;
}

.profile-edit td {
  padding-top: 10px;
  padding-left: 0px;
}

.profile-edit tr {
  background-color: transparent !important;
}

.profile-edit tr:first-child {
  color: #666 !important;
  font-weight: normal !important;
}

.cke_dialog_ui_vbox_child {
  padding: 0px !important;
}

table.cke_dialog, .cke_dialog_contents_body, .cke_dialog_ui_hbox_first, .cke_dialog_ui_hbox_last {
  padding: 0px !important;
}

.cke_dialog_ui_hbox_first, .cke_dialog_ui_hbox_last {
  display: table-cell !important;
}

.cke_dialog_ui_vbox_child {
  background: #fff !important;
}

.tabpanel table tbody tr {
  background-color: transparent !important;
}

.cke_dialog_ui_vbox_child div table {
  padding: 0px !important;
}

.cke_dialog_ui_input_text, .cke_dialog_ui_input_select {
  margin-top: 3px !important;
  margin-bottom: 3px !important;
}

.cke_dialog_ui_hbox .cke_dialog_ui_hbox_first a {
  margin-right: 50px;
}

.cke_resizer {
  display: none !important;
}

.sideshare {
  display: none !important;
}

.kmessage-thankyou, .kmessage-agree, .kmessage-like {
  padding-left: 25px;
}

svg {
  vertical-align: top;
}

.form-select {
  border: 1px solid #000;
}

table tbody tr:nth-child(2n+2) {
  bacgkround-color: #F7F7F7 !important;
}

.kcatcount {
  font-size: 14px;
  padding-left: 7px;
  vertical-align: middle;
}

#catid {
  border: 1px solid #000;
}

@media (min-width: 999px) {
  .cke_dialog_contents {
    border: 5px solid #fff !important;
  }
}
@media (max-width: 999px) {
  #kunena.layout {
    padding: 0px;
    margin-top: 10px;
    overflow: hidden;
  }
  .mod-kunena-breadcrumbs {
    margin-bottom: 10px;
    margin-left: 0px;
  }
  .mod-kunena-breadcrumbs li {
    margin: 0px;
    padding-top: 10px;
    padding-left: 10px;
  }
  .mod-kunena-breadcrumbs .breadcrumb-item:after {
    padding-left: 0px;
    padding-right: 0px;
  }
  #kunena.layout nav {
    margin: 0px;
  }
  .pt-4 {
    padding-top: 0px !important;
  }
  #kunena.layout h1 {
    font-size: 20px !important;
    line-height: 23px;
    padding-left: 10px;
    padding-bottom: 0px;
    color: #666;
  }
  .navbar-toggler {
    height: 45px;
  }
  #content {
    margin-top: 70px;
  }
  #kunena.layout .kmessagepadding {
    padding-left: 10px;
  }
  #kunena.layout nav {
    margin-top: 0px !important;
  }
  #kunena.layout small.float-end {
    float: none !important;
    text-align: right !important;
    display: block;
    margin: 0px !important;
    padding: 10px !important;
  }
  .message .p-4 {
    padding-top: 0px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  small.float-end .text-muted {
    margin-right: 5px !important;
  }
  small.float-end {
    max-height: 70px !important;
  }
  .d-block {
    margin-right: 0px !important;
  }
  .report {
    display: none;
  }
  .btn-toolbar .btn-group {
    margin-bottom: 15px;
  }
  .col-3 {
    width: 100%;
    display: block;
    margin: 0 auto;
    text-align: center;
  }
  .d-md-table tr:first-child {
    display: none;
  }
  .d-md-table tr td {
    padding: 5px !important;
  }
  .d-md-table tr td .row {
    padding-left: 10px !important;
  }
  sup {
    top: 0px !important;
    padding-left: 10px;
  }
  .lastpostlink a {
    line-height: 30px;
  }
  #kunena.layout blockquote {
    margin: 0px !important;
    padding: 0px !important;
  }
  #kunena > div > div.float-start, #kunena > div.float-start {
    float: none !important;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #kunena > div > div.float-start nav ul.pagination li {
    margin-left: 0px;
  }
  #kunena > div > div.float-end {
    float: none !important;
    margin-top: 20px;
    width: 80%;
    margin: 0 auto;
  }
  .message div small {
    display: none;
  }
  form .mb-5 {
    margin-bottom: 0px !important;
  }
  form .p-3 {
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
  }
  #kunena.layout #form_submit_button, #kunena.layout #form_submit_button_draft, #kunena.layout #form_submit_button_loaddraft, #kunena.layout #editcancel {
    margin: auto !important;
    margin-bottom: 10px !important;
  }
  #history .kmessage {
    margin-top: 50px;
    padding: 0px;
  }
  #history .kmsg {
    padding: 0px;
  }
  .topic-actions-toolbar {
    margin: 0 auto;
    width: 80%;
    text-align: center;
    display: block;
  }
  #categoryactions .table tbody tr td:before {
    content: "";
  }
  #ktopicsform .table tbody tr td:before {
    content: "";
  }
  .card-header small {
    float: right !important;
  }
  .category td .float-start {
    float: none !important;
  }
  .page-item {
    margin-left: 0px;
  }
  h2.float-end {
    float: none !important;
  }
  .cat-topic-margin li {
    margin-top: 25px;
  }
  .cat-topic-margin li a {
    margin-right: 25px;
  }
  .category td a.topictitle {
    padding-bottom: 20px;
    border-bottom: transparent !important;
  }
  .ktopic-category a {
    border-bottom: transparent !important;
  }
  .category td .started {
    margin-top: 20px;
  }
  #categoryactions {
    margin-bottom: 10px;
  }
  .gotoeditor {
    margin-top: 22px !important;
  }
  .kreply-submit {
    margin-right: 25px;
  }
  #postform > div.form-group.row > div > button.btn.btn-outline-primary.btn-md {
    margin-top: -92px !important;
  }
  #kunena.layout #kcatcount {
    font-size: 14px;
    padding-left: 7px;
    vertical-align: middle;
    text-align: right;
    float: right;
  }
  .profile-edit {
    padding-left: 10px;
  }
  #kunena.layout .profile-edit td {
    display: table;
    width: 100%;
    margin-bottom: 20px;
  }
}
#btn_thankyou, #btn_like, #btn_agree, #btn_unthankyou, #btn_unlike, #btn_unagree {
  display: block !important;
  background-color: #fff !important;
  color: #212529 !important;
  border: unset !important;
  font-size: 1em !important;
  text-align: left !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border-radius: 0px !important;
  height: auto !important;
}

#btn_thankyou:hover, #btn_like:hover, #btn_agree:hover, #btn_unthankyou:hover, #btn_unlike:hover, #btn_unagree:hover {
  background-color: #f8f9fa !important;
}

#btn_thankyou:active, #btn_like:active, #btn_agree:active, #btn_unthankyou:active, #btn_unlike:active, #btn_unagree:active {
  background-color: #0d6efd !important;
  color: #fff !important;
}

.kmessage-agree svg, .kmessage-like svg, .kmessage-thankyou svg {
  vertical-align: middle !important;
  margin-right: 5px;
}

#subject {
  border: 1px solid #000;
}

.kbutton-thankyou, .kbutton-like, .kbutton-agree {
  display: block;
  width: 100%;
  padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
  clear: both;
  font-weight: 400;
  color: var(--bs-dropdown-link-color);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  border-radius: var(--bs-dropdown-item-border-radius, 0);
  background-color: unset !important;
  border-radius: unset !important;
  border-color: #fff !important;
}

.kbutton-thankyou:hover, .kbutton-like:hover, .kbutton-agree:hover {
  background-color: #f5f5f5 !important;
  border-color: #f5f5f5 !important;
}

/* ---- 2. Former Aurelia SCSS edits and inline <style> blocks -------------- */
#kunena.layout .bbcode_code_head { display: none; }
#kunena.layout .bbcode_code_body { color: #fff; background-color: #2f2f2f; padding: 10px; }
#kunena.layout .kcat-icon svg { width: 34px; height: 34px; }
#kunena.layout .katcount { font-size: 14px; padding-left: 7px; vertical-align: middle; }
#kunena.layout .kwho-admin { color: #D32D21; }

/* topic/edit: attachment area */
#kunena.layout #postform .badge { font-size: 1em; color: #555; font-weight: normal; background-color: transparent !important; display: inline-block; }
#kunena.layout #postform #files div { width: 260px; display: inline-block; text-align: center; }
#kunena.layout #postform #files div p { padding-bottom: 15px; text-align: center; }

/* topic/edit: stack buttons on small screens */
@media (max-width: 900px) {
    #kunena.layout #form_submit_button,
    #kunena.layout #form_submit_button_draft,
    #kunena.layout .kx-draft-buttons .btn,
    #kunena.layout #editcancel { margin: auto !important; margin-bottom: 10px !important; }
    #kunena.layout .col-md-10 button { margin-top: 0 !important; }
}

/* ---- 3. Plugin elements ---------------------------------------------- */
#kunena.layout .kx-draft-buttons { display: inline-block; margin-right: .25rem; }
#kunena.layout .kx-draft-picker { text-align: left; margin-top: 1rem; }
#kunena.layout .kx-draft-table td,
#kunena.layout .kx-reaction-table td { padding: 5px !important; vertical-align: top; }
#kunena.layout .kx-reaction-list { margin: .25rem 0; }
#kunena.layout .kx-reaction-list svg { vertical-align: -2px; margin-right: 2px; }
#kunena.layout .kx-remove { margin-left: 2px; }
#kunena.layout .kx-tab-heading { font-size: 1.15rem; margin-top: 1rem; }
#kunena.layout .kx-empty { color: #666; }
#kunena.layout .kx-markread-bar { text-align: right; margin: 10px 20px 0; }

/* ---- 4. Protect Kunena elements from site-wide theme CSS (user.css) ---- */
/*
 * The site's user.css styles every .btn (red pill buttons) and gives
 * .profilebox a background image. Inside the forum these rules put Kunena's
 * own look back. The #kunena.layout prefix keeps them out of the rest of the
 * site; !important is needed because user.css uses it too.
 */

/* Post author box: no background image, normal text colours. */
#kunena.layout .profilebox {
    background: none !important;
    background-image: none !important;
    border: 0 !important;
    color: inherit !important;
}

/* User menu (top right) and login menu: Bootstrap's own button styles. */
#kunena.layout .klogout .btn,
#kunena.layout .klogin .btn {
    width: auto !important;
    padding: .375rem .75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    border-radius: .375rem !important;
    box-shadow: none !important;
    text-transform: none !important;
    background-image: none !important;
}
#kunena.layout .klogout .btn-sm,
#kunena.layout .klogin .btn-sm {
    padding: .25rem .5rem !important;
    font-size: .875rem !important;
    border-radius: .25rem !important;
}
#kunena.layout .klogout .d-block,
#kunena.layout .klogin .d-block { width: auto !important; }

/* Toggle button */
#kunena.layout .klogout .btn-light,
#kunena.layout .klogin .btn-light {
    color: #000 !important;
    background-color: #f8f9fa !important;
    border: 1px solid #f8f9fa !important;
}
#kunena.layout .klogout .btn-light:hover,
#kunena.layout .klogout .btn-light:focus,
#kunena.layout .klogout .btn-light.show,
#kunena.layout .klogin .btn-light:hover,
#kunena.layout .klogin .btn-light:focus,
#kunena.layout .klogin .btn-light.show {
    background-color: #e2e6ea !important;
    border-color: #dae0e5 !important;
}

/* Online / Away / Busy / Invisible */
#kunena.layout .klogout .btn-outline-success   { color: #198754 !important; border: 1px solid #198754 !important; background-color: transparent !important; }
#kunena.layout .klogout .btn-outline-warning   { color: #997404 !important; border: 1px solid #ffc107 !important; background-color: transparent !important; }
#kunena.layout .klogout .btn-outline-danger    { color: #dc3545 !important; border: 1px solid #dc3545 !important; background-color: transparent !important; }
#kunena.layout .klogout .btn-outline-secondary { color: #6c757d !important; border: 1px solid #6c757d !important; background-color: transparent !important; }
#kunena.layout .klogout .btn-outline-success:hover   { color: #fff !important; background-color: #198754 !important; }
#kunena.layout .klogout .btn-outline-warning:hover   { color: #000 !important; background-color: #ffc107 !important; }
#kunena.layout .klogout .btn-outline-danger:hover    { color: #fff !important; background-color: #dc3545 !important; }
#kunena.layout .klogout .btn-outline-secondary:hover { color: #fff !important; background-color: #6c757d !important; }

/* Status text, Announcements, Preferences, Mark All Read, Logout: plain links */
#kunena.layout .klogout .btn-link,
#kunena.layout .klogin .btn-link {
    color: #000 !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    text-decoration: none !important;
}
#kunena.layout .klogout .btn-link:hover,
#kunena.layout .klogin .btn-link:hover {
    color: #000 !important;
    background-color: transparent !important;
    text-decoration: underline !important;
}

/* User menu header (name, avatar, status, last visit): centred. */
#kunena.layout .klogout .dropdown-menu .center,
#kunena.layout .klogout .dropdown-menu .center p {
    text-align: center !important;
}
#kunena.layout .klogout .dropdown-menu .center .badge,
#kunena.layout .klogout .dropdown-menu .center img {
    display: inline-block !important;
    margin-left: auto;
    margin-right: auto;
}

/* Search box (category and topic pages): box and button share one fixed
   height, so no site-wide .btn / .form-control rule can make them differ. */
#kunena.layout .kunena-search .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
}
#kunena.layout .kunena-search .input-group > .form-control,
#kunena.layout .kunena-search .input-group > .btn {
    box-sizing: border-box !important;
    height: 2.25rem !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    top: auto !important;
    line-height: 1.5 !important;
}
#kunena.layout .kunena-search .input-group > .form-control {
    padding: 0 .75rem !important;
}
#kunena.layout .kunena-search .input-group > .btn {
    width: auto !important;
    padding: 0 .9rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#kunena.layout .kunena-search .input-group > .btn svg {
    width: 1em;
    height: 1em;
}

/* Advanced search page */
#kunena.layout .kx-search-form legend {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
#kunena.layout .kx-search-form .kx-search-main .form-control,
#kunena.layout .kx-search-form .kx-search-main .form-select {
    box-sizing: border-box !important;
    height: 2.25rem !important;
    width: 100% !important;
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border: 1px solid #000 !important;
    border-radius: .375rem !important;
}
#kunena.layout .kx-search-form .kx-search-main .form-control {
    padding: 0 .75rem !important;
}
#kunena.layout .kx-search-form .kx-search-main .form-select {
    padding: 0 2.25rem 0 .75rem !important;
}
#kunena.layout .kx-search-form .kx-search-main .form-check {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-height: 2.25rem;
    padding-left: 0;
}
#kunena.layout .kx-search-form .kx-search-main .form-check-input {
    margin: 0;
    float: none;
}
/* Gaps (the site-wide ".row > * { padding: 0 !important }" removes Bootstrap's gutters). */
#kunena.layout .kx-search-form .kx-search-main {
    margin: 0 0 1rem 0 !important;
}
#kunena.layout .kx-search-form .kx-search-main > fieldset {
    padding-right: 1.5rem !important;
}
#kunena.layout .kx-search-form .kx-search-main .row > [class*="col-sm-"]:first-child {
    padding-right: .5rem !important;
}
#kunena.layout .kx-search-form .kx-search-main .row > [class*="col-sm-"]:last-child {
    padding-left: .5rem !important;
}
#kunena.layout .kx-search-form .kx-search-main .form-select {
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
}
#kunena.layout .kx-search-form #detail-searchoptions {
    margin-top: .5rem;
    margin-bottom: 1rem;
}
@media (max-width: 575.98px) {
    #kunena.layout .kx-search-form .kx-search-main .row > [class*="col-sm-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-bottom: .5rem;
    }
}
/* "Exact Name" tick box: fixed size so site-wide input rules can't squash it. */
#kunena.layout .kx-search-form .kx-search-main .form-check-input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    width: 1.1em !important;
    min-width: 1.1em !important;
    height: 1.1em !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    accent-color: #e30613;
    cursor: pointer;
}
#kunena.layout .kx-search-form .kx-search-main .form-check {
    align-items: center !important;
}
#kunena.layout .kx-search-form .kx-search-main .form-check-label {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.1em !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Profile and Edit Profile tabs: text centred vertically; the active (and
   hovered) tab is DrayTek red with white text. */
#kunena.layout .nav-tabs {
    align-items: stretch;
}
#kunena.layout .nav-tabs .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    height: 100% !important;
    min-height: 2.5rem;
    margin-top: 0 !important;
    padding: .5rem 1rem !important;
    line-height: 1.2 !important;
    vertical-align: middle;
}
#kunena.layout .nav-tabs .nav-link.active,
#kunena.layout .nav-tabs .nav-item.show .nav-link,
#kunena.layout .nav-tabs .nav-link:hover,
#kunena.layout .nav-tabs .nav-link:focus {
    color: #fff !important;
    background-color: #e30613 !important;
    border-color: #e30613 !important;
}
