/*
 * Night theme — overrides :root color tokens defined in glitter.css.
 * Only structural/behavioural rules that can't be expressed as color tokens remain below.
 */
:root {
    --clr-page-bg:        black;
    --clr-surface:        #727272;
    --clr-surface-alt:    #444444;
    --clr-surface-hover:  #666666;
    --clr-border:         #808080;
    --clr-border-subtle:  #252525;
    --clr-text:           #EBEBEB;
    --clr-text-muted:     #D6D6D6;
    --clr-error:          #F95151;
    --clr-input-bg:       #555555;
    --clr-input-border:   #252525;
    --clr-dropdown-bg:    #727272;
    --clr-modal-bg:       #727272;
    --clr-table-bg:       #555555;
    --clr-table-row-alt:  #444444;
    --clr-progress-track: #DADADA;
    --clr-toggle-inactive: #666666;
}

/* Links and glyphicons inside links */
a, a:active,
a:hover,
a:focus,
.btn:not(.btn-danger):active,
.hover-button.glyphicon-play,
.hover-button.glyphicon-stop,
legend,
#modal-options legend label,
#modal-options legend a,
#modal-item-files .item-files-table .progress small,
.text-muted{
    color: var(--clr-text);
}

/* Navbar needs structural dark-mode overrides */
nav {
    background-color: #444444 !important;
    border: 0 !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

nav .btn {
    background-color: #E4E4E4;
    border-color: #5D5D5D !important;
}

nav .btn:active {
    /* Restore bootstrap default */
    color: #333 !important;
}

@media (max-width: 767px) {
    nav {
        background-color: black !important;
    }
}

/* Collapse dropdown loses border in dark mode */
.navbar-collapse.in .dropdown-menu {
    border: none;
}

/* Feedback slider needs explicit dark bg (not a card, not an input) */
#feedback-slider {
    background-color: var(--clr-input-bg);
    color: var(--clr-text);
}

/* Elements that must be white regardless of --clr-text */
.main-restarting,
.main-filedrop {
    color: white !important;
}

/* Tab controls — dark-mode specific colours */
.max-speed-input-clear,
.max-speed-input-clear:hover,
.fileControls a {
    color: black;
}

.nav-tabs>li.active>a,
.nav-tabs>li.active>a:focus,
.nav-tabs>li.active>a:hover,
.nav-tabs>li>a:hover,
.nav-tabs>li>a:focus {
    background-color: #ddd;
    color: #555 !important;
    box-shadow: 0px -1px 1px 1px rgba(0, 0, 0, 0.15);
}

/* Opacity */
.hover-button,
.fileControls a:hover {
    opacity: 0.7;
}

.form-control[disabled] {
    opacity: 0.65;
}

/* Focus ring uses white glow in dark mode */
.form-control:focus,
input[type="submit"]:focus,
button:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.3) !important;
    outline: initial;
}

/* Processing animation bars */
.processing-download > div {
    background-color: var(--clr-text);
}

/* Legend / divider borders (dark-specific value, not matching any token) */
legend,
hr {
    border-color: #C6C6C6 !important;
}

/* Slider handle */
.ui-slider .ui-slider-handle {
    background-color: #969696;
    border-color: #969696;
}

/* Compact layout progress shadow boost */
.container-compact .progress,
.container-compact .queue .progress-bar {
    box-shadow: inset 1px 0px 1px rgba(0, 0, 0, 1);
}

.modal-footer {
    border-top: 1px solid rgb(131 131 131);
}

/* Help table transparent bg override */
#modal-help table td,
#modal-help table {
    background-color: transparent;
}

/* File items table structural */
#modal-item-files .item-files-table td {
    border-bottom: none !important;
}

#modal-item-files .item-files-table {
    border-bottom: 1px solid black;
}

/* History/queue tab switcher */
.history-queue-swicher .nav-tabs>li>a,
.history-queue-swicher .nav-tabs>li.active>a {
    border-bottom: none;
    margin-bottom: 1px;
}
