/* Right Floating Sidebar */

/* Declare variable to adjust by users */
:root {
    --qimeta_tooltip_label: DarkGreen;  /* #FFD700;  Default color (Gold)  This variable is set in qimeta_show_file.html*/
    --qimeta_tooltip_label_font_weight: normal;
    --qimeta_tooltip_label_bg: color-mix(in srgb, var(--qimeta_tooltip_label) 30%, transparent);

}


.qimeta_right_sidebar {
    position: fixed;
    right: 0; /* 0 Initially hidden */
    top: 0;
    width: 250px;
    height: 100%;
    background-color: #ffffff;
    border-left: 1px solid #e5e5e5;
    padding: 20px;
    transition: right 0.3s ease-in-out;

    z-index: 1000;

    /* NEW slide mechanism */
    transform:translateX(100%);       /* hidden = shifted 100 % of itself */
    transition:transform .3s ease-in-out;
}

.qimeta_right_sidebar_menu_item{
        margin-top:12px;                /* vertical gap  */
        padding-top:12px;
        padding-bottom:12px;
        border-bottom:1px solid #e5e5e5;   /* grey line     */
    }


/* Sidebar Open State */
.qimeta_right_sidebar.open{
    transform:translateX(0);          /* visible */
}

/* only the inner wrapper scrolls */
.sidebar-content{
    height:100%;
    overflow-y:auto;
}

/* toggle button now absolute inside sidebar */
.qimeta-toggle-right{
    position:absolute;
    left:-35px;           /* sits just outside the sidebar */
    top:100px;   
            
    width:35px;          /* new */
    height:35px;         /* new */
    display:flex;        /* keeps the ☰ centred */
    align-items:center;
    justify-content:center;

    background:#fff;
    /* background: red; */
    padding:10px;
    border:1px solid #e5e5e5;
    border-radius:50%;
    cursor:pointer;
    z-index:1002;
    transition:left .3s ease;
}



.qimeta_sidebar-resizer{
    position:absolute;
    left:-4px;                 /* sits just outside the sidebar */
    top:0;
    width:14px;
    height:100%;
    cursor:col-resize;         /* ← resize cursor */
    background:transparent;    /* invisible until hover */
    z-index:1001;
}
.qimeta_sidebar-resizer:hover{
    background:#ccc;           /* thin grey line when user hovers */
}




/* Ensure submenu takes full width and aligns left */
.qimeta_right_sidebar_menu_item .submenu {
    display: flex;
    flex-wrap: nowrap; /* Prevents wrapping to new lines */
    align-items: center;
    justify-content: flex-start; /* Ensures elements stay to the left */
    width: 100%; /* Takes full available space */
    padding: 0;
    margin: 0;
}

/* Remove any unwanted padding or margins */
/* .qimeta_right_sidebar .submenu li {
    padding: 0;
    margin: 0;
} */


/* Remove bullets from all lists in the right sidebar */
.qimeta_right_sidebar ul {
    list-style: none;  /* Remove bullets */
    padding: 0;
    margin: 0;
}

/* Ensure list items do not have extra spacing */
/* .qimeta_right_sidebar ul li {
    margin: 0;
    padding: 0;
} */

/*  subtle styling for second-level links inside the assessment submenu  */
#AssessmentsSubmenu > li > a{
    font-size: 0.9em;          /* slightly smaller text           */
    color:#555;                /* softer gray that matches palette*/
    padding-left: 14px;        /* indents under parent headline   */
    display:flex;              /* keeps icon + text aligned       */
    gap:6px;                   /* space between icon and label    */
}

#AssessmentsSubmenu > li > a:hover{
    color:#1E90FF;             /* same blue you use on hover els. */
}



/* Fix color-picker-row spacing */
.color-picker-row {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start; /* Aligns to left */
    flex-wrap: nowrap; /* Prevents extra spacing */
    width: 100%; /* Use full width */
    padding: 10px 0;
}
/* Color Option Buttons */
.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.3s ease;
}

.color-option:hover {
    border: 2px solid black;
}

/* Custom Color Picker */
.color-picker-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-picker-label {
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
    transition: background 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Light Tooltip Effect */
.color-picker-label::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #f9f9f9;
    color: #333;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
}

.color-picker-label:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Hide the default color picker */
.color-picker {
    visibility: hidden;
    width: 0;
    height: 0;
    position: absolute;
}


/* Responsive: Adjust button for smaller screens */
@media screen and (max-width: 480px) { /* Mobile */
    .qimeta-toggle-right {
        /* right: -35px; */
        padding: 8px;
    }
}


/* 📱 Responsive Design */
@media screen and (max-width: 1024px) { /* Tablet (iPad, notebooks) */
    .qimeta_right_sidebar {
        width: 220px;
        padding: 15px;
    }

    .color-option {
        width: 25px;
        height: 25px;
    }

    .color-picker-label {
        padding: 5px;
        font-size: 16px;
    }
}

@media screen and (max-width: 768px) { /* Smaller tablets & landscape phones */
    .qimeta_right_sidebar {
        width: 200px;
        padding: 10px;
    }

    .color-option {
        width: 22px;
        height: 22px;
    }

    .color-picker-label {
        padding: 4px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {

    .qimeta_right_sidebar {
        /*
         * Keep the SAME slide mechanism used on desktop.
         *
         * IMPORTANT:
         * Do not use right:-75% here.
         * transform:translateX(100%) already hides the sidebar.
         */
        width: 75%;
        max-width: 320px;

        height: 100%;
        right: 0;

        padding: 12px;

        transform: translateX(100%);
    }


    .qimeta_right_sidebar.open {
        right: 0;
        transform: translateX(0);
    }


    /*
     * Keep the circular launcher just outside the left edge
     * of the hidden sidebar.
     *
     * Because the sidebar is translated exactly 100%,
     * this leaves the button visible at the right edge
     * of the iPhone screen.
     */
    .qimeta-toggle-right {
        left: -35px;
        top: 70px;

        width: 35px;
        height: 35px;

        padding: 8px;

        display: flex;
        align-items: center;
        justify-content: center;

        border-radius: 50%;

        z-index: 1002;
    }


    .color-picker-row {
        justify-content: space-between;
        padding: 8px;
    }


    .color-option {
        width: 20px;
        height: 20px;
    }


    .color-picker-label {
        padding: 3px;
        font-size: 12px;
    }
}


/* Font-Weight Selector - Ensure full width */
.font-weight-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 6px; /* Aligns with first color button */
    margin-top: 5px;
    width: 100%; /* Takes full space */
}

/* Font-weight label aligns with first color button */
.font-weight-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    min-width: 90px; /* Ensures alignment */
    text-align: left;
}

/* Adjust dropdown width */
.font-weight-dropdown {
    flex-grow: 1; /* Makes sure it fills available space */
    padding: 6px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}






/* ==========================================================================
   Mental Notes sidebar
   ========================================================================== */
.qimeta-mental-notes-menu,
.qimeta-mental-notes-menu * {
    font-family: century-gothic, "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
}

.mental-notes-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.mental-notes-title:hover,
.mental-notes-title.open {
    color: #31b8b3;
}

.mental-notes-title .fa-sticky-note {
    color: #4ec6c2;
    width: 16px;
    text-align: center;
}

.mental-notes-count {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(78, 198, 194, 0.14);
    color: #2a8f8b;
    border: 1px solid rgba(78, 198, 194, 0.35);
    font-size: 11px;
    font-weight: 700;
}

.mental-notes-panel {
    width: 100%;
    margin-top: 10px;
}

.mental-notes-status {
    padding: 10px 8px;
    color: #888;
    font-size: 12px;
    line-height: 1.45;
}

/* Override generic .submenu flex rules: Mental Notes are a vertical list. */
.qimeta_right_sidebar .mental-notes-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mental-notes-list-item {
    width: 100%;
    margin: 0;
    padding: 0;
}

.mental-note-sidebar-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 10px 11px;
    box-sizing: border-box;
    text-align: left;
    background: #fff;
    color: #333;
    border: 1px solid #e5e5e5;
    border-left: 3px solid #4ec6c2;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
    font: inherit;
}

.mental-note-sidebar-item:hover,
.mental-note-sidebar-item:focus-visible {
    background: #f5fbfb;
    border-color: #a8e6e4;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    outline: none;
}

.mental-note-sidebar-item:active {
    transform: translateY(1px);
}

.mental-note-sidebar-quote {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
}

.mental-note-sidebar-quote::before {
    content: "“";
    color: #4ec6c2;
    font-size: 15px;
    margin-right: 1px;
}

.mental-note-sidebar-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #666;
    font-size: 11.5px;
    line-height: 1.4;
}

.mental-note-sidebar-jump {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    color: #31b8b3;
    font-size: 10.5px;
    font-weight: 700;
}

/* Briefly call attention to the passage after sidebar navigation. */
.mental-note-highlight.mental-note-sidebar-target {
    animation: qimetaMentalNoteTargetPulse 1.8s ease-out;
    scroll-margin-top: 18vh;
}

@keyframes qimetaMentalNoteTargetPulse {
    0%, 100% { box-shadow: none; }
    20%, 55% {
        box-shadow: 0 0 0 4px rgba(78,198,194,.30), 0 0 14px rgba(78,198,194,.35);
        background-color: rgba(78,198,194,.26) !important;
    }
}

@media screen and (max-width: 480px) {
    .mental-note-sidebar-item {
        padding: 11px;
    }
    .mental-note-sidebar-quote { font-size: 13px; }
    .mental-note-sidebar-text  { font-size: 12px; }
}

/* ==========================================================================
   QIMETA RIGHT SIDEBAR — UNIFIED MAIN MENU VISUALS
   --------------------------------------------------------------------------
   IMPORTANT:
   This section intentionally does NOT change:
     - .qimeta_right_sidebar position/right/top/transform
     - .qimeta_right_sidebar.open transform
     - .qimeta-toggle-right position/left/top
     - sidebar width or slide-in behavior

   The existing right-side fixed drawer and floating circular toggle therefore
   remain controlled by the original rules near the top of this file.
   ========================================================================== */

.qimeta_right_sidebar {
    font-family:
        century-gothic,
        "Century Gothic",
        CenturyGothic,
        AppleGothic,
        sans-serif;
    color: #333333;
}

/* Consistent spacing for the four primary sections. */
.qimeta_right_sidebar_menu_item {
    margin-top: 0;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.qimeta_right_sidebar_menu_item:first-child {
    padding-top: 0;
}

/* Shared appearance for Mental Notes, Assessment Tests,
   Highlight Colors, and Listen Language. */
.qimeta-sidebar-main-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    padding: 9px 10px;
    border-radius: 8px;

    color: #333333 !important;
    background: transparent;
    text-decoration: none !important;

    font-family:
        century-gothic,
        "Century Gothic",
        CenturyGothic,
        AppleGothic,
        sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.35;

    cursor: pointer;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.qimeta-sidebar-main-label {
    flex: 1 1 auto;
    min-width: 0;
}

/* Every primary icon occupies the same 20px column. */
.qimeta-sidebar-main-link > i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 20px !important;
    min-width: 20px;
    height: 20px;
    margin: 0 !important;

    color: #4ec6c2 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    text-align: center;
}

.qimeta-sidebar-main-link:hover,
.qimeta-sidebar-main-link:focus-visible,
.qimeta-sidebar-main-link.open {
    color: #287f7c !important;
    background-color: #f0fafa;
    outline: none;
}

.qimeta-sidebar-main-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(78, 198, 194, 0.22);
}

/* Mental Notes count aligns at the far right without disturbing icon/text. */
.mental-notes-count {
    margin-left: auto;
    flex: 0 0 auto;
}

/* Mental Notes remain a vertical list, overriding the generic horizontal
   .submenu behavior used by controls such as the color picker. */
.qimeta_right_sidebar .mental-notes-list {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

/* Assessment submenu is also a vertical hierarchy. */
#AssessmentsSubmenu {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
}

#AssessmentsSubmenu > li {
    width: 100%;
}

/* Keep second-level assessment links visually subordinate. */
#AssessmentsSubmenu > li > a {
    font-family:
        century-gothic,
        "Century Gothic",
        CenturyGothic,
        AppleGothic,
        sans-serif;
    color: #555555;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
}

#AssessmentsSubmenu > li > a i {
    color: #4ec6c2;
}

/* Make the language control fit the same light sidebar visual system.
   !important is needed because the current HTML has inline colors. */
#qimeta-sidebar-lang-picker {
    background: #ffffff !important;
    color: #444444 !important;
    border: 1px solid #d9dfe3 !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;

    font-family:
        century-gothic,
        "Century Gothic",
        CenturyGothic,
        AppleGothic,
        sans-serif !important;
    font-size: 12px !important;
}

#qimeta-sidebar-lang-picker:focus {
    outline: none;
    border-color: #4ec6c2 !important;
    box-shadow: 0 0 0 2px rgba(78, 198, 194, 0.14);
}

/* Polish the EXISTING floating circular opener without changing its geometry. */
.qimeta-toggle-right {
    color: #333333;
    background: #ffffff;
    border-color: #e1e5e8;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.08);
}

.qimeta-toggle-right:hover {
    color: #287f7c;
    background: #f0fafa;
    border-color: #b9e1df;
}

/* Do not override sidebar positioning in responsive rules.
   Only scale typography slightly on narrower screens. */
@media screen and (max-width: 768px) {
    .qimeta-sidebar-main-link {
        min-height: 40px;
        padding: 8px;
        font-size: 13px !important;
    }

    .qimeta-sidebar-main-link > i {
        width: 18px !important;
        min-width: 18px;
        height: 18px;
        font-size: 15px !important;
    }
}

.mental-note-sidebar-owner {
    display: block;

    margin-bottom: 3px;

    color: #2a8f8b;

    font-family:
        century-gothic,
        "Century Gothic",
        CenturyGothic,
        AppleGothic,
        sans-serif;

    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.3;
}
