/*
 * Aniwave skin: color overrides for rules in style.css (minified) that
 * hard-code the purple accent or dark surface shades.
 *
 * Enqueued right after `anikototv-style`, repeating the original selectors.
 * Every value is a CSS variable whose fallback is the original color, so the
 * default look is unchanged. The variables are only defined (by
 * skins/aniwave/functions.php, derived from --ak-accent / --ak-bg / --ak-bg-2
 * printed by inc/hook.php) when the admin customises a color.
 *
 * Only selectors that no later style.css rule of equal specificity can also
 * match are repeated here (checked with a cascade script). Generic single-class
 * rules (.btn-link, .form-control, .page-link, .dropdown-menu, .modal-header)
 * and a:hover are printed inline by functions.php only when a color is
 * customised; .btn is never overridden because it would beat .btn-primary.
 *
 *   --aw-accent-link   #8c5ece  links, accent text
 *   --aw-accent-hover  #a885da  hover text  (#b699e0 active controls)
 *   --aw-accent-soft   rgba(90,46,152,.5)  focus rings
 *   --aw-accent-faint  rgba(90,46,152,.25)
 *   --aw-accent-tint   #281e35  hovered rows
 *   --aw-surface-deep  #141414 / #121212  search box, alt rows
 *   --aw-surface-low   #171717 / #181818  popups, panels, episode chips
 *   --aw-surface-high  #212121 / #202020  controls
 *   --aw-surface-line  #242424  poster meta, tooltips, hovered cards
 */

/* Accent: links and accent text */
a,
.user-notification .body-box .items .item .highlight,
.room-chat .body .messages .message .msg-body .user,
#w-player #w-servers .tip b,
.tooltipster-sidetip .tooltipster-content .title,
footer .inline-links ul li a:hover,
.watchlist.items .item .info .name a:hover {
    color: var(--aw-accent-link, #8c5ece);
}

/* Accent: hover / active text */
.shorting .toggle:hover,
.dropdown-menu .active > label,
.dropdown-menu .active > label:focus,
.dropdown-menu .active > label:hover,
.dropdown-menu li > input:checked ~ label,
.dropdown-menu li > input:checked ~ label:focus,
.dropdown-menu li > input:checked ~ label:hover,
.dropdown-menu li > label:hover,
.dropdown-menu .combine-mode,
.scaff.items .item:hover .info .name,
.ani.items .item .info .name:hover,
header .main-menu:hover,
header .main-menu:hover .icon,
header .main-menu:hover i,
section.top-table .head a.title:hover,
section.top-table .body .items .item:hover .info .name,
section#schedule .body .items a.item:hover .title,
section#top-anime .side.items .item:hover .info .name,
#w-info .binfo .info .meta > div > span a,
#i-wrapper ul#i-menu li a:hover {
    color: var(--aw-accent-hover, #a885da);
}

.dropdown-item.active,
.dropdown-item:active {
    color: var(--aw-accent-hover, #a885da);
}

.custom-control-input:not(:disabled):active ~ .custom-control-label::before {
    background-color: var(--aw-accent-hover, #b699e0);
    border-color: var(--aw-accent-hover, #b699e0);
}

.custom-range::-webkit-slider-thumb:active {
    background-color: var(--aw-accent-hover, #b699e0);
}

.custom-range::-moz-range-thumb:active {
    background-color: var(--aw-accent-hover, #b699e0);
}

/* Accent: focus rings and disabled checked controls */
.btn-outline-primary.focus,
.btn-outline-primary:focus,
.btn-outline-primary:not(:disabled):not(.disabled).active:focus,
.btn-outline-primary:not(:disabled):not(.disabled):active:focus,
.show > .btn-outline-primary.dropdown-toggle:focus {
    box-shadow: 0 0 0 0 var(--aw-accent-soft, rgba(90, 46, 152, 0.5));
}

a.badge-primary.focus,
a.badge-primary:focus {
    box-shadow: 0 0 0 .2rem var(--aw-accent-soft, rgba(90, 46, 152, 0.5));
}

.custom-select:focus {
    box-shadow: 0 0 0 .2rem var(--aw-accent-faint, rgba(90, 46, 152, 0.25));
}

.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before,
.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before,
.custom-switch .custom-control-input:disabled:checked ~ .custom-control-label::before {
    background-color: var(--aw-accent-soft, rgba(90, 46, 152, 0.5));
}

/* Accent: tinted hover rows */
#search .search-popup .body .items .item.active,
#search .search-popup .body .items .item:focus,
#search .search-popup .body .items .item:focus-within,
#search .search-popup .body .items .item:hover {
    background: var(--aw-accent-tint, #281e35);
}

section#schedule .body .items a.item:hover {
    background: var(--aw-accent-tint, #281e35) !important;
}

/* Surfaces: deepest (#141414 / #121212) */
header #search form {
    background-color: var(--aw-surface-deep, #141414);
}

header #menu > ul > li:hover > a,
.user.dropdown .dropdown-menu .logout,
#avatar-browser ul.nav {
    background: var(--aw-surface-deep, #141414);
}

section#schedule .body .items a.item:nth-child(2n+1) {
    background: var(--aw-surface-deep, #121212);
}

/* Surfaces: low (#171717 / #181818) */
#search .search-popup,
section#schedule .body,
.user-actions,
header .settings .dropdown-menu {
    background: var(--aw-surface-low, #171717);
}

#w-player #w-servers .servers .type ul li {
    background: var(--aw-surface-low, #171717);
}

#w-episodes .body .episodes.number ul li a,
#w-episodes .body .episodes.name ul li a {
    background: var(--aw-surface-low, #171717);
}

#w-episodes .body .episodes.number ul li a {
    border-color: var(--aw-surface-low, #171717);
}

section#schedule .body .more {
    background: var(--aw-surface-low, #181818);
}

/* Surfaces: controls (#212121 / #202020) */
.switch-btn > div,
section#schedule .body .items a.item .ep,
#w-player #controls .dropdown-menu.skiptime li .input .form-control {
    background: var(--aw-surface-high, #212121);
}

#search .search-popup .foot {
    background: var(--aw-surface-high, #202020);
}

/* Surfaces: raised (#242424) */
.ani.items .item .poster .meta,
.top-profile .notify .user-notification,
.tooltipster-sidetip .tooltipster-box {
    background-color: var(--aw-surface-line, #242424);
}

section.top-table .body .items .item:hover,
.side.items .item:hover .inner {
    background: var(--aw-surface-line, #242424);
}

.dropdown-menu.bullet:after {
    border-bottom-color: var(--aw-surface-line, #242424);
}
