/* -------------------- */
/* GENERAL STYLES      */
/* -------------------- */

body {
    margin: 20px;
    background-color: #181818;
}

code {
    font-size: 0.875em;
    color: #ea868f;
    word-wrap: break-word;
    background-color: hsl(225deg 8.87% 10.98%);
    padding: 0 0.294em;
}

.bg-dark {
    --bs-bg-opacity: 1;
    background-color: #181818 !important;
}

.form-control,
.form-select {
    background-color: hsl(225deg 8.87% 10.98%);
}

/* -------------------- */
/* HEADER STYLES        */
/* -------------------- */

.header-container {
    text-align: center;
    margin-bottom: 20px;
}

.header-image {
    max-width: 40%;
    height: auto;
}

/* Fixed header settings */
header.fixed-top {
    width: 100%;
    z-index: 1030;
    background-color: #181818;
    padding: 10px 0;
}

/* Ensure content is not hidden under the fixed header */
.content-wrapper {
    margin-top: 80px;
    /* Adjust based on header height */
}

.title.text-center {
    text-align: center !important;
    box-sizing: content-box;
}

/* -------------------- */
/* FOOTER STYLES        */
/* -------------------- */

.footer {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    background-color: #181818;
    margin-top: 20px;
    border-top: 1px solid #343a40;
}

.footer .donate-button {
    display: inline-block;
    padding: 8px 16px;
    font-size: 14px;
    color: #fff;
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.footer .donate-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.footer .donate-button i {
    margin-right: 4px;
}


/* -------------------- */
/* SPINNER STYLES       */
/* -------------------- */

.jump-spinner-container {
    position: relative;
}

#jump-spinner-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

/* Remove underline and make text faded when disabled */

#navbarDropdownMenuLink[disabled] {
    color: #a0a0a0 !important;
    text-decoration: none !important;
    opacity: 0.6;
    pointer-events: none;
}

#navbarDropdownMenuLink[disabled]::after {
    display: none !important;
}

#navbarDropdownMenuLink[disabled]:hover,
#navbarDropdownMenuLink[disabled]:focus {
    text-decoration: none !important;
}

/* -------------------- */
/* FORM STYLES          */
/* -------------------- */

form,
#final-form {
    max-width: 900px;
    margin: auto;
    padding: 20px;
    border: 1px solid #343a40;
    border-radius: 5px;
}

.form-container {
    display: flex;
    max-width: 800px;
    margin: auto;
}

#final-yaml {
    width: 100%;
    min-height: 400px;
    font-family: monospace;
}

label {
    display: block;
    margin-bottom: 10px;
    text-align: left;
}

.dropdown {
    display: flex;
    justify-content: center;
}

.dropdown .btn {
    min-width: 180px;
    text-align: center;
}

.dropdown-menu {
    min-width: 180px;
    left: 50%;
    text-align: left;
}

/* Hover color */
.dropdown-item:hover {
    background-color: #019c75 !important;
    color: white !important;
}

/* Active (selected) item color */
.dropdown-item.active,
.dropdown-item:active {
    background-color: #019c75 !important;
    color: white !important;
}

.text-info {
    color: rgb(0 152 183) !important;
}

/* -------------------- */
/* FORM COMPONENTS      */
/* -------------------- */

.form-divider {
    margin: 15px;
    border-bottom: 1px solid #3a3a3a;
}

.accordion-body,
.card-group {
    background-color: #343a40;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* -------------------- */
/* ACCORDION STYLES     */
/* -------------------- */

.accordion {
    --bs-accordion-bg: #191d20;
}

.accordion-body,
.card-group {
    background-color: #343a40;
    padding-top: 10px;
    padding-bottom: 10px;
}

.accordion-header.plex-pass-true {
    border-left: 4px solid #00bc8c !important;
    padding-left: 10px !important;
}

.accordion-header.plex-pass-false {
    border-left: 4px solid #ffc107 !important;
    padding-left: 10px !important;
}

.accordion-header.plex-pass-unknown {
    border-left: 4px solid #6c757d !important;
    padding-left: 10px !important;
}

/* Add a green left border when an accordion has selected items */
.accordion-header.selected {
    border-left: 4px solid #00bc8c !important;
    /* Bright green left border */
    padding-left: 10px !important;
    /* Space text from border */
}

/* Add a gray left border when an accordion has unknown items */
.accordion-header.unknown {
    border-left: 4px solid #6c757d !important;
    padding-left: 10px !important;
}

/* Add a red left border when an accordion has invalid items */
.accordion-header.invalid {
    border-left: 4px solid #dc3545 !important;
    /* Bootstrap red */
    padding-left: 10px !important;
    /* Same padding for symmetry */
}

/* Add a yellow left border when an accordion has selected items */
.accordion-header.warning {
    border-left: 4px solid #ffc107 !important;
    padding-left: 10px !important;
    /* Space text from border */
}

/* Ensure the accordion header has a transparent background */
.accordion-button:not(.collapsed) {
    background-color: transparent !important;
    color: white !important;
    border-color: #343a40 !important;
    /* Keep border subtle */
}

/* Ensure the expanded accordion body matches the surrounding theme */
.accordion-button:not(.collapsed)+.accordion-collapse .accordion-body {
    background-color: #343a40 !important;
    /* Explicitly set to match the header */
    color: white !important;
}

/* Ensure the expanded accordion section matches the header */
.accordion-collapse.show .accordion-body {
    background-color: transparent !important;
    /* Same as the header */
    color: white !important;
    border-top: 1px solid #343a40;
    /* Optional: subtle border for separation */
}

/* Prevent hover/focus from changing colors too much */
.accordion-button:not(.collapsed):hover,
.accordion-button:not(.collapsed):focus {
    background-color: transparent !important;
    color: white !important;
    border-color: #343a40 !important;
}

/* Keep expand/collapse arrow white when expanded */
.accordion-button:not(.collapsed)::after {
    color: white !important;
}

/* Keep expand/collapse arrow white when collapsed */
.accordion-button.collapsed::after {
    color: white !important;
}

.mb-3.small {
    margin-bottom: 0rem !important;
}

.form-check-input[type=checkbox] {
    margin-right: 10px;
}

.readonly-toggle {
    pointer-events: none;
    opacity: 0.6;
}


.btn.disabled,
.btn:disabled,
fieldset:disabled .btn {
    color: #6c757d;
    pointer-events: none;
    background-color: #181818;
    border-color: #495057;
    opacity: var(--bs-btn-disabled-opacity);
}

.template-toggle-group {
    background-color: #212529;
    color: #f8f9fa;
    border: 1px solid #444;
    margin-bottom: 5px;
    border-radius: 4px;
    padding: 10px 12px;
    transition: background-color 0.2s ease;
}

/* Only applies when JS toggles this class */
.template-toggle-group-bordered {
    background-color: #212529;
    color: #f8f9fa;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 5px;
    transition: background-color 0.2s ease;
}

/* -------------------- */
/* INPUT STYLES         */
/* -------------------- */

.status-message {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
}

.status-success {
    color: #75b798 !important;
}

.status-warning {
    color: #ffc107 !important;
}

.status-error {
    color: #ea868f !important;
}

/* -------------------- */
/* MESSAGE STYLES       */
/* -------------------- */

.messages {
    max-width: 600px;
    margin: 20px auto;
    background-color: #343a40;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #343a40;
}

.messages ul {
    padding: 0;
    list-style-type: none;
}

.messages li {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.messages .error {
    background-color: #dc3545;
    color: #ffffff;
    border: 1px solid #dc3545;
}

.messages .success {
    background-color: #28a745;
    color: #ffffff;
    border: 1px solid #28a745;
}

.me-md-2 {
    margin-right: 0rem !important;
}

/* ---------------------- */
/* SCROLLBAR STYLES       */
/* ---------------------- */

/* WebKit (Chrome/Edge/Safari) */
.dropdown-menu::-webkit-scrollbar {
  width: 10px;
}

.dropdown-menu::-webkit-scrollbar-track {
  background: #343a40;            /* track background */
  border-left: 1px solid #019c75; /* optional accent edge */
}

/* Default: gray thumb */
.dropdown-menu::-webkit-scrollbar-thumb {
  background-color: #495057;       /* neutral gray */
  border-radius: 4px;
  border: 1px solid #212529;
}

/* Change to green ONLY when hovering over the thumb */
.dropdown-menu::-webkit-scrollbar-thumb:hover {
  background-color: #019c75;       /* active green */
  border-color: #019c75;
}

/* Optional: even lighter green when actively dragging */
.dropdown-menu::-webkit-scrollbar-thumb:active {
  background-color: #00bc8c;
}

/* Firefox */
.dropdown-menu {
  scrollbar-width: thin;
  scrollbar-color: #495057 #343a40; /* gray thumb, dark track */
}

/* Firefox automatically changes color on thumb hover — no parent hover needed */

#run-command-box {
  position: relative;
}

/* -------------------- */
/* TOOLTIP STYLES       */
/* -------------------- */

.tooltip-inner {
    background-color: #fff;
    color: #000;
    padding: 3px;
    max-width: 600px;
}

.text-tooltip .tooltip-inner {
    background-color: #fff;
    max-width: 500px;
}

div#loading {
    width: 100px;
    height: 100px;
    display: none;
    text-align: center;
    cursor: wait;
}

.tooltip.show {
    opacity: 1.0 !important;
}

.mt-4 {
    margin-top: 0 !important;
}

.form-check-input:checked {
    background-color: #00bc8c;
    border-color: #0f5132;
}

.sponsor-btn,
.discord-btn {
    background-color: #24292e;
    color: white;
    border: none;
    transition: background-color 0.3s ease;
}

.sponsor-btn:hover {
    background-color: #d62b3a;
}

.discord-btn:hover {
    background-color: #5865F2;
}



.tooltip.show .tooltip-inner {
    opacity: 1;
    visibility: visible;
    transition: opacity 0s, visibility 0s;
}

.tooltip {
    transition-delay: 0.5s;
}

/* -------------------- */
/* IMAGE STYLES         */
/* -------------------- */


.img-fluid {
    max-height: 500px;
}


/* -------------------- */
/* NAVBAR STYLES        */
/* -------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1050;
}

.nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    border: 2px solid #019c75;
    background-color: #343a40 !important;
    color: white !important;
    border-color: #343a40 !important;
    transition: all 0.3s ease-in-out;
}

.nav-button:hover {
    background-color: #019c75 !important;
    border-color: #019c75 !important;
    color: white !important;
}

.btn.nav-button:disabled,
.btn.nav-button.disabled {
    background-color: #212529 !important;
    border: 2px solid #212529 !important;
    color: #adb5bd !important;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* Dropdown Styling */
.dropdown-menu {
    background-color: #343a40;
    border: 1px solid #019c75;
}

.dropdown-menu .dropdown-item {
    color: white;
    transition: background-color 0.3s ease-in-out;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #019c75;
}

.dropdown-menu .dropdown-item.active {
    background-color: #019c75 !important;
    color: white !important;
}

/* Center Dropdown on Narrow Screens. 767.98 ensures that 768 exactly is not a problem */
@media (max-width: 767.98px) {
    .container-fluid.d-flex {
        justify-content: center !important;
        /* Ensures dropdown stays centered */
    }

    .dropdown {
        display: flex;
        justify-content: center;
        width: auto;
    }

    .dropdown .btn {
        min-width: 180px;
        text-align: center;
    }

    .dropdown-menu {
        min-width: 180px;
        left: 50%;
        /* transform: translateX(-50%); */
        text-align: left;
    }
}

/* Progress Bar Styling Inside Dropdown */
.progress-container {
    padding: 8px 12px;
}

.progress {
    background-color: #555;
}

.progress-bar {
    background-color: #019c75;
}

/* Properly align icons inside navigation buttons */
.nav-button i {
    vertical-align: middle;
    line-height: 1;
    font-size: 1rem;
    /* Adjust size if needed */
}

.nav-button:hover {
    background-color: #019c75 !important;
    border-color: #019c75 !important;
    color: white !important;
}

/* Sortable Item Styling */
.sortable-item {
    cursor: move;
    background-color: #212529;
    color: #f8f9fa;
    border: 1px solid #444;
    margin-bottom: 5px;
    border-radius: 4px;
    padding: 10px 12px;
    transition: background-color 0.2s ease;
}

.sortable-item:hover {
    background-color: #019c75;
}

/* Drag Handle Icon */
.drag-handle {
    cursor: grab;
    color: #ccc;
}

.drag-handle:hover {
    color: #fff;
}

#run-command-box {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

#run-command-box.fade-in {
    opacity: 1;
    pointer-events: auto;
}

.rotate-icon {
    transition: transform 0.3s ease;
}
.rotate-icon.rotate {
    transform: rotate(180deg);
}

/* Desktop/tablet: keep badge top-right of the title block */
.page-title {
  position: relative;
}
.config-badge {
  position: absolute;
  top: .25rem;
  right: .75rem;
  font-size: .85rem;
  padding: .35rem .6rem;
}

/* Phones: let it stack under the title and center it */
@media (max-width: 576px) {
  .config-badge {
    position: static;          /* no absolute positioning */
    display: inline-block;
    margin-top: .5rem;         /* space below the title */
  }
  .page-title {
    display: flex;
    flex-direction: column;    /* title then badge */
    align-items: center;
    gap: .25rem;
  }
}
