/**
 * BlueSilk theme
 * A premium, modern and soft aesthetic combining Indigo, Lavender and Pearl.
 *
 * @package RosarioSIS
 * @subpackage assets/themes
 */

@import url("../FlatSIS/stylesheet.css");
@import url("stylesheet.min.css");

/* DESIGN SYSTEM : SILKY SILK (CENTRALIZED) */

:root {
    /* Basics */
    --pearl-white: #fffcf5;
    --page-bg: #e6eaf5;
    --indigo-deep: #192a4d;
    --indigo-midnight: #162544;
    --indigo-clear: #253c6b;
    /* #080b2d; */
    --lavender-soft: #9fa8da;
    --text-lavender: #c5cae9;

    /* Identity / Actions */
    /* Softer action blue to reduce "electric" effect */
    --electric-blue: #2f63c8;
    --button-glow: rgba(20, 26, 77, 0.3);

    /* Surfaces */
    --indigo-silk: linear-gradient(135deg, #1d2f55 0%, #253c6b 40%, #3459a1 100%);
    --header-bg: #f5f6ff;
    --row-hover: #f1f3f9;
    --glass-effect: rgba(255, 255, 255, 0.7);
    --sidebar-glow: rgba(255, 255, 255, 0.15);

    /* States & Borders */
    --border-light: #f6f1e8;
    --silk-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Background Global - Pearl White */
body,
html,
#wrap,
.page-wrapper,
.page-container,
.main-content,
.page-container2,
.page-container3 {
    background: var(--page-bg) !important;
}

/* Sidebar & Menus - Silky Indigo Gradient */
#menu,
.adminmenu,
.wp-submenu,
.menu-sidebar,
.menu-sidebar__content,
.navbar-sidebar,
aside.mod {
    background: var(--indigo-silk) !important;
    box-shadow: var(--silk-shadow) !important;
}

.widefat tfoot tr th,
.widefat tfoot tr th:hover,
.widefat th,
.widefat th:hover {
    background: var(--indigo-clear) !important;
    /* Semi-transparent indigo */
    color: var(--pearl-white) !important;
}

/* Width Adjustment (Reduce by 10px: 280px -> 270px) */
#menu,
.menu-sidebar {
    width: 270px !important;
}

.wp-submenu {
    min-width: 270px !important;
    border-radius: 12px !important;
    backdrop-filter: blur(10px);
    background: #192a4d;
}

/* Utilisateur connecté (Sidebar) */
/* Utilisation de l'ID #menu-top pour forcer la priorité */
#menu-top .current-person {
    background: var(--pearl-white) !important;
    /* Fond contrasté pour le bleu électrique */
    border-radius: 20px !important;
    margin: 8px 10px !important;
    padding: 0 8px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

#menu-top .current-person a {
    color: var(--electric-blue) !important;
    /* Bleu électrique centralisé */
    padding: 6px 4px !important;
    display: inline-block !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    background: transparent !important;
    white-space: nowrap !important;
}

/* Le lien du nom doit prendre la place restante et gérer l'ellipse */
#menu-top .current-person a:last-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 12px !important;
}

/* Le lien de la croix */
#menu-top .current-person a:first-child {
    flex-shrink: 0;
    filter: brightness(0.5);
    /* Assombrit l'icône sur fond clair */
}

#menu-top .current-person a:first-child:hover {
    filter: brightness(0.3);
}

/* Flyout Submenu Positioning (Flyout only) */
.no-touch .menu-module:hover .wp-submenu:not(#selectedModuleLink + .wp-submenu),
.no-touch .menu-module:focus-within .wp-submenu:not(#selectedModuleLink + .wp-submenu) {
    left: 271px !important;
    position: absolute !important;
    border-radius: 12px !important;
}

/* Accordion Submenu (Active module) */
#selectedModuleLink+.wp-submenu {
    position: relative !important;
    left: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    border-radius: 0 0 12px 12px !important;
}

/* Top Area / Logo Area / Footer (Top bar) */
#menu-top,
.menu-sidebar .logo,
.header-desktop,
.header-desktop2,
.header-desktop3,
.header-desktop4,
#footer,
#footerwrap {
    background: var(--indigo-midnight) !important;
    color: var(--pearl-white) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
}

/* Animation de reflet pour le bandeau supérieur */
#footer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 251, 242, 0.3), transparent);
}

/* Sidebar Links - Base State */
.adminmenu a,
.menu-top,
.navbar-sidebar .navbar__list li a,
.wp-submenu a {
    color: var(--text-lavender) !important;
    background: transparent !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-left: 4px solid transparent !important;
}

/* Sidebar Links Hover & Active */
.adminmenu a:hover,
.menu-top:hover,
.menu-top:focus,
#selectedMenuLink,
#selectedModuleLink,
.wp-submenu a:focus,
.wp-submenu a:hover,
.navbar-sidebar .navbar__list li.active>a,
.navbar-sidebar .navbar__list li a:hover {
    background: var(--sidebar-glow) !important;
    font-weight: 600 !important;
    color: var(--pearl-white) !important;
    border-left: 4px solid var(--lavender-soft) !important;
}

#menu-top a,
#menu-top span,
.header-desktop a,
#footer a,
#footer span,
.BottomButton {
    color: var(--pearl-white) !important;
}

/* Menus déroulants du SIDEBAR uniquement - Style BlueSilk */
#menu-top select {
    background: var(--indigo-midnight, #162544) !important;
    color: var(--pearl-white, #fffcf5) !important;
    border: none !important;
    border-bottom: 2px solid var(--lavender-soft) !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
}

/* Options des menus du sidebar - Bleu un peu plus clair */
#menu-top select option {
    background: #1f3a5f !important;
    color: var(--pearl-white, #fffcf5) !important;
    padding: 6px 8px !important;
}

/* Sous-titres (optgroup) du sidebar - Bleu foncé */
#menu-top select optgroup {
    background: var(--indigo-deep, #192a4d) !important;
    color: var(--pearl-white, #fffcf5) !important;
    font-weight: 700 !important;
    font-style: normal !important;
}

#menu-top select:focus {
    outline: 2px solid var(--electric-blue, #0056b3) !important;
    outline-offset: 2px !important;
}

/* Bandeau Supérieur Icônes */
.BottomButton img {
    filter: invert(100%) brightness(150%) sepia(20%) !important;
    opacity: 0.9 !important;
}

#BottomButtonMenu svg {
    stroke: var(--pearl-white) !important;
}

/* Buttons */
a.button-primary,
button.button-primary,
input.button-primary,
.au-btn--blue,
.au-btn--submit {
    background: var(--indigo-silk) !important;
    color: white !important;
    border-radius: 20px !important;
    padding: 6px 18px !important;
    box-shadow: 0 4px 6px var(--button-glow) !important;
    border: none !important;
}

.button-primary:hover,
.au-btn--blue:hover,
.au-btn--submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--button-glow) !important;
}

/* Tables & Custom Elements */
.header2 {
    background: var(--header-bg) !important;
    border-bottom: 1px solid var(--border-light) !important;
    border-top: none !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 12px 24px !important;
}

/* Softer blue + bold for names and links in tables/lists */
.widefat td a {
    color: var(--electric-blue) !important;
    font-weight: 700 !important;
}

.widefat {
    border-radius: 12px !important;
    border: 1px solid var(--border-light) !important;
    overflow: hidden !important;
}

.widefat tr:hover {
    background: var(--row-hover) !important;
}

.list th{
    padding: 4px !important;
}

.widefat tr.highlight,
.list tr.highlight,
.highlight {
    position: relative;
    /* Indigo clear outline for active row (eg. MarkingPeriods tables) */
    box-shadow: inset 0 0 0 1px var(--electric-blue);
    border-radius: 12px; 
}

/* Module Postbox */
.postbox {
    border-radius: 16px !important;
    box-shadow: var(--silk-shadow) !important;
    border: none !important;
    overflow: hidden;
}

/**
* Cacher les éléments inutiles (themeSPX)
*/
.assignment-types .list a[href*="assignment_type_id=new"],
#body>form[action*="modname=Grades/Assignments.php&table=gradebook_assignment_types"]>table:nth-child(3)>tbody>tr>td.header2,
#body>form[action*="modname=Grades/Assignments.php&table=gradebook_assignment_types"]>table:nth-child(1)>tbody>tr>td.header2.align-right>input[type=button]:nth-child(1),
#body>form[action*="modname=Grades/Assignments.php&table=gradebook_assignment_types"]>table:nth-child(2)>tbody>tr>td,
#body>form[action*="modname=Report_Card_Template/Grades/Assignments.php&table=gradebook_assignment_types"]>table:nth-child(3)>tbody>tr>td.header2,
#body>form[action*="modname=Report_Card_Template/Grades/Assignments.php&table=gradebook_assignment_types"]>table:nth-child(1)>tbody>tr>td.header2.align-right>input[type=button]:nth-child(1),
#body>form[action*="modname=Report_Card_Template/Grades/Assignments.php&table=gradebook_assignment_types"]>table:nth-child(2)>tbody>tr>td,
#body>form[action*="Grades/Grades.php"]>div.list-outer.students>div>div>table>tbody>tr>td>label,
form[action*="Grades/Grades.php"]>div.list-outer.students>div>div>table>tbody>tr>td>label+span {
    display: none !important;
}

/* PADDING & ALIGNMENT */
#menu form,
.adminmenu a,
.menu-top,
.menu-inter {
    /* Hanging indent: first line stays aligned, wrapped lines indent +15px */
    padding-left: 33px !important;
    text-indent: -15px;
}

.adminmenu a {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

.menu-top {
    padding-top: 13px !important;
    padding-bottom: 13px !important;
}

.menu-inter,
.wp-submenu a {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

/* Submenu Offset */
.wp-submenu a,
.wp-submenu .menu-inter {
    padding-left: 38px !important;
}

#selectedModuleLink+.wp-submenu a,
#selectedModuleLink+.wp-submenu .menu-inter {
    padding-left: 52px !important;
}

/* Spinner "Horloge éternelle" */
.loading {
    background: url("spinning.svg") no-repeat center center !important;
    background-size: contain !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.4) !important;
    transform-origin: center center !important;
    margin-right: 10px !important;
}

.BottomButton.loading {
    margin-top: -2px !important;
}

:root.theme-dark {
    --pearl-white: #0c1935;
    --indigo-deep: #081022;
    --indigo-midnight: #081022;
    --indigo-clear: #0c1935;
    --indigo-silk: linear-gradient(135deg, #081022 0%, #0c1935 45%, #12284d 100%);
    --header-bg: #26385a;
    --row-hover: #15264a;
    --glass-effect: rgba(12, 25, 53, 0.86);
    --border-light: #818fb3;
    --silk-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
    --text-lavender: #d7dcff;
    --electric-blue: #6ea8ff;
    --page-bg: #26385a;
}

.theme-dark body,
.theme-dark html,
.theme-dark #wrap,
.theme-dark .page-wrapper,
.theme-dark .page-container,
.theme-dark .main-content,
.theme-dark .page-container2,
.theme-dark .page-container3 {
    color: #e6eaf5 !important;
}

.theme-dark .page-wrapper,
.theme-dark .page-container,
.theme-dark .page-container2,
.theme-dark .page-container3,
.theme-dark .main-content {
    background: var(--page-bg) !important;
}

.theme-dark a {
    color: var(--electric-blue) !important;
}

.theme-dark .header2 {
    color: #e6eaf5 !important;
}

.theme-dark #menu,
.theme-dark .adminmenu,
.theme-dark .wp-submenu,
.theme-dark .menu-sidebar,
.theme-dark .menu-sidebar__content,
.theme-dark .navbar-sidebar,
.theme-dark aside.mod {
    color: #e6eaf5 !important;
}

.theme-dark #menu,
.theme-dark .menu-sidebar,
.theme-dark .navbar-sidebar,
.theme-dark aside.mod {
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.75) !important;
}

.theme-dark #menu-top,
.theme-dark .menu-sidebar .logo,
.theme-dark .header-desktop,
.theme-dark .header-desktop2,
.theme-dark .header-desktop3,
.theme-dark .header-desktop4,
.theme-dark #footer,
.theme-dark #footerwrap {
    color: #e6eaf5 !important;
}

.theme-dark #menu-top a,
.theme-dark #menu-top span,
.theme-dark #menu-top div,
.theme-dark .header-desktop a,
.theme-dark .header-desktop span,
.theme-dark .header-desktop div,
.theme-dark #footer a,
.theme-dark #footer span,
.theme-dark .BottomButton {
    color: #e6eaf5 !important;
}

.theme-dark .header-desktop i,
.theme-dark .header-desktop svg,
.theme-dark .header-desktop img,
.theme-dark #menu-top i,
.theme-dark #menu-top svg,
.theme-dark #menu-top img,
.theme-dark .BottomButton img {
    filter: invert(100%) brightness(140%) !important;
    opacity: 0.95 !important;
}

.theme-dark img.logo,
.theme-dark #menu-top img.logo,
.theme-dark .header-desktop img.logo,
.theme-dark .menu-sidebar img.logo,
.theme-dark aside.mod img.logo {
    filter: none !important;
    opacity: 1 !important;
}

.theme-dark .header-desktop .noti__item i,
.theme-dark .header-desktop .noti__item svg {
    color: #e6eaf5 !important;
    fill: #e6eaf5 !important;
    stroke: #e6eaf5 !important;
}

.theme-dark .adminmenu a,
.theme-dark .menu-top,
.theme-dark .navbar-sidebar .navbar__list li a,
.theme-dark .wp-submenu a {
    color: #e6eaf5 !important;
}

.theme-dark .adminmenu a:hover,
.theme-dark .menu-top:hover,
.theme-dark .menu-top:focus,
.theme-dark #selectedMenuLink,
.theme-dark #selectedModuleLink,
.theme-dark .wp-submenu a:focus,
.theme-dark .wp-submenu a:hover,
.theme-dark .navbar-sidebar .navbar__list li.active>a,
.theme-dark .navbar-sidebar .navbar__list li a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-left-color: var(--lavender-soft) !important;
}

.theme-dark .adminmenu a img,
.theme-dark .adminmenu a svg,
.theme-dark .adminmenu a i,
.theme-dark .menu-top img,
.theme-dark .menu-top svg,
.theme-dark .menu-top i,
.theme-dark .wp-submenu a img,
.theme-dark .wp-submenu a svg,
.theme-dark .wp-submenu a i {
    color: #e6eaf5 !important;
    fill: #e6eaf5 !important;
    stroke: #e6eaf5 !important;
    opacity: 0.95 !important;
}

.theme-dark #menu-top select {
    background: #070e1d !important;
    color: #e6eaf5 !important;
    border-bottom-color: var(--lavender-soft) !important;
}

.theme-dark #menu-top select option,
.theme-dark #menu-top select optgroup {
    background: #070e1d !important;
    color: #e6eaf5 !important;
}

.theme-dark .header2 {
    background: var(--header-bg) !important;
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6,
.theme-dark .title-1,
.theme-dark .title-2,
.theme-dark .title-3,
.theme-dark .title-4,
.theme-dark .title-5,
.theme-dark .heading-title {
    color: #f0f3ff !important;
}

.theme-dark p,
.theme-dark span,
.theme-dark small,
.theme-dark div {
    color: inherit;
}

.theme-dark .widefat,
.theme-dark .postbox {
    background: #102042 !important;
    color: #e6eaf5 !important;
}

.theme-dark .widefat td,
.theme-dark .list td {
    color: #e6eaf5 !important;
    background: transparent !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.theme-dark .widefat tbody tr:nth-child(odd),
.theme-dark .list tbody tr:nth-child(odd) {
    background: rgba(8, 16, 34, 0.30) !important;
}

.theme-dark .widefat tbody tr:nth-child(even),
.theme-dark .list tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.08) !important;
}

.theme-dark .widefat th,
.theme-dark .widefat tfoot tr th,
.theme-dark .list th {
    background: var(--header-bg) !important;
    color: #f0f3ff !important;
    border-color: var(--border-light) !important;
}

.theme-dark .header,
.theme-dark td.header,
.theme-dark th.header {
    background: var(--header-bg) !important;
    color: #f0f3ff !important;
    border-color: var(--border-light) !important;
}

.theme-dark .header a,
.theme-dark td.header a,
.theme-dark th.header a {
    color: var(--electric-blue) !important;
}

.theme-dark .postbox thead,
.theme-dark .postbox thead tr,
.theme-dark .postbox thead th {
    background: var(--header-bg) !important;
    color: #f0f3ff !important;
    border-color: var(--border-light) !important;
}

.theme-dark .postbox thead a {
    color: var(--electric-blue) !important;
}

.theme-dark .postbox td.popTable {
    background: #102042 !important;
    color: #e6eaf5 !important;
}

.theme-dark .widefat td a,
.theme-dark .list td a {
    color: var(--electric-blue) !important;
}

.theme-dark .widefat td,
.theme-dark .widefat th,
.theme-dark .widefat tfoot tr th {
    border-color: var(--border-light) !important;
}

.theme-dark .widefat tr:hover {
    background: var(--row-hover) !important;
}

.theme-dark input[type="text"],
.theme-dark input[type="password"],
.theme-dark input[type="email"],
.theme-dark input[type="number"],
.theme-dark input[type="search"],
.theme-dark input[type="tel"],
.theme-dark input[type="url"],
.theme-dark textarea,
.theme-dark select {
    background: #111a2b !important;
    color: #e6eaf5 !important;
    border-color: var(--border-light) !important;
}

.theme-dark input::placeholder,
.theme-dark textarea::placeholder {
    color: rgba(230, 234, 245, 0.65) !important;
}

.theme-dark .legend-gray {
    color: rgba(230, 234, 245, 0.72) !important;
}

.theme-dark .legend-red {
    color: #ff8a8a !important;
}

.theme-dark label {
    color: #e6eaf5 !important;
}

.theme-dark #menu-top .current-person {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.theme-dark #menu-top .current-person a:first-child {
    filter: invert(100%) brightness(140%) !important;
}