/* ============================================================
   Bootstrap 5 polish — IMI Bhubaneswar StudentWeb.
   Loaded after default.css and bootstrap.min.css so these rules win.
   Brand blue: #4a77d4 (the theme's own .HeaderStyle colour in default.css).
   ============================================================ */

/* ---------- GridViews (grids carrying .gv-nice) ----------
   Child combinators (> tbody > tr > td) keep borders/striping off
   nested tables inside ItemTemplates. */
.gv-nice {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: .9rem;
}

.gv-nice > tbody > tr > th,
.gv-nice > tbody > tr > td,
.gv-nice > thead > tr > th,
.gv-nice > tr > th,
.gv-nice > tr > td {
    border: 1px solid #cdd7df; /* vertical + horizontal column lines */
    padding: 8px 10px;
    vertical-align: middle;
}

/* Header: brand navy, left by default (gridview.js syncs each column to its
   data cells). UseAccessibleHeader="False" renders header cells as <td> and
   puts the HeaderStyle class on the ROW, so the cells are painted directly -
   otherwise a row hover on the cells covers the row's navy. */
.gv-nice > tbody > tr > th,
.gv-nice > thead > tr > th,
.gv-nice > tr > th,
.gv-nice .HeaderStyle,
.gv-nice > tbody > tr.HeaderStyle > td,
.gv-nice > tbody > tr.HeaderStyle > th {
    background-color: #4a77d4 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #4a77d4 !important;
    text-align: left;
    font-weight: 600;
    box-shadow: none !important;
}

    .gv-nice > tbody > tr > th a,
    .gv-nice > tbody > tr.HeaderStyle a {
        color: #fff !important;
    }

.gv-nice > tbody > tr:nth-child(even) > td {
    background-color: #eef3f6;
}

/* row hover - never the header row (class lives on the <tr>) */
.gv-nice > tbody > tr:not(.HeaderStyle):hover > td {
    background-color: #dceaf5;
}

/* ---------- Buttons: outline style ----------
   Recolours the classes the markup already uses, so no .aspx/.ascx changes. */
.btn {
    border-radius: .375rem;
    font-weight: 600;
}

.btn-secondary,
.btn-primary {
    --bs-btn-bg: transparent;
    --bs-btn-color: #4a77d4;
    --bs-btn-border-color: #4a77d4;
    --bs-btn-hover-bg: #4a77d4;
    --bs-btn-hover-border-color: #4a77d4;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #2f4f94;
    --bs-btn-active-border-color: #2f4f94;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #9db3c6;
    --bs-btn-disabled-color: #9db3c6;
    --bs-btn-focus-shadow-rgb: 74, 119, 212;
    border-width: 1px;
}

.btn-danger {
    --bs-btn-bg: transparent;
    --bs-btn-color: #b02a37;
    --bs-btn-border-color: #b02a37;
    --bs-btn-hover-bg: #b02a37;
    --bs-btn-hover-border-color: #b02a37;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #8f222d;
    --bs-btn-active-border-color: #8f222d;
    --bs-btn-active-color: #fff;
    border-width: 1px;
}

/* ASP.NET renders a disabled Button as <input disabled>; BS5's
   --bs-btn-disabled-* only reaches .disabled on <a>/<button>. */
.btn-secondary:disabled,
.btn-primary:disabled,
.btn-secondary[disabled],
.btn-primary[disabled] {
    background-color: transparent;
    border-color: #9db3c6;
    color: #9db3c6;
    opacity: 1;
}

/* btn-xs was dropped in BS5 but the legacy markup still uses it */
.btn-xs {
    --bs-btn-padding-y: .12rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .78rem;
    --bs-btn-border-radius: .25rem;
}

.gv-nice td .btn,
.gv-nice th .btn {
    --bs-btn-padding-y: .12rem;
    --bs-btn-padding-x: .5rem;
    --bs-btn-font-size: .8rem;
}

/* legacy themed button -> outline (drops the gif background).
   Scoped to real buttons only: <asp:Button> renders <input>, <asp:LinkButton> <a>.
   A <span> (<asp:Label>) using ButtonStyle as a status badge - e.g. "FINAL GRADES
   SAVED, (EDIT MODE)" in SubmitGradesByFaculty - keeps its original Default.css look. */
input.ButtonStyle,
button.ButtonStyle,
a.ButtonStyle {
    background-image: none !important;
    background-color: transparent !important;
    color: #4a77d4 !important;
    border: 1px solid #4a77d4 !important;
    border-radius: .375rem !important;
    padding: .35rem 1rem !important;
    font-weight: 600 !important;
    font-size: .9rem !important;
    text-decoration: none;
    cursor: pointer;
    margin: 2px 3px;
}

    input.ButtonStyle:hover,
    button.ButtonStyle:hover,
    a.ButtonStyle:hover {
        background-color: #4a77d4 !important;
        color: #fff !important;
    }

/* label used as a status badge: keep the maroon text, drop the background */
span.ButtonStyle {
    background-color: transparent;
}

#pageContent .btn + .btn {
    margin-left: 6px;
}

/* ---------- UpdateProgress "Processing" overlay ---------- */
.proc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100010;
}

.proc-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, .32);
    padding: 28px 40px;
    min-width: 300px;
    max-width: 90vw;
}

.proc-spinner {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 5px solid #d3dded;
    border-top-color: #4a77d4;
    border-radius: 50%;
    animation: proc-spin .7s linear infinite;
}

@keyframes proc-spin {
    to { transform: rotate(360deg); }
}

.proc-text {
    color: #4a77d4;
    font-weight: 600;
    font-size: 1.15rem;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .proc-spinner { animation-duration: 2s; }
}

/* ---------- ReportViewer ----------
   The viewer lays out in a table-layout:fixed table whose column widths come
   from a hidden first row (25% Document Map + splitter). Fixed layout still
   reserves those hidden columns, squeezing the report area. Auto layout lets
   the visible report column fill the control. Matched by id suffix because a
   ReportViewer's CssClass does not land on the fixedTable's ancestor. */
#pageContent table[id$="_fixedTable"] {
    table-layout: auto !important;
    width: 100% !important;
}

    #pageContent table[id$="_fixedTable"] > tbody > tr > td[style*="display:none"],
    #pageContent table[id$="_fixedTable"] > tbody > tr > td[style*="display: none"] {
        width: 0 !important;
        padding: 0 !important;
    }

#pageContent div[id$="_ctl13"] {
    width: 100% !important;
}

/* centre the report page; auto margins fall back to 0 (not clipped) when
   the report is wider than the area */
#pageContent div[id$="_oReportDiv"] > table {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ---------- Page title image ----------
   Titles come from titletext.ashx. BS5 img-fluid (unlike BS3 img-responsive)
   is not display:block, so centre it explicitly. Matched by src because the
   title image's ID varies between controls. */
#pageContent img[src*="titletext.ashx"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Form controls & labels ---------- */
.form-control,
.form-select {
    font-size: .92rem;
}

/* labels sat flush against their control in the legacy markup */
.LabelStyle {
    font-weight: 600;
    display: inline-block;
    margin-bottom: 4px;
}

/* ---------- Vertical rhythm ----------
   Filler rows (<tr><td>&nbsp;</td></tr>) are tagged .sp-row and given a
   controlled height instead of a full blank line. */
.sp-row > td {
    height: 6px;
    padding: 0 !important;
    font-size: 0;
    line-height: 0;
}

#pageContent .gv-nice {
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Sticky footer: the master page's form fills the window and the content
   container grows, so on short pages the footer still sits at the bottom. */
.site-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-page > .container {
    flex: 1 0 auto;
}

/* ---------- Page footer (MasterPage.master) ----------
   Light grey bar under a three-shade brand-blue strip; the browser note
   sits in a pale blue pill. */
.site-footer {
    margin-top: 24px;
    background: #f3f5f8;
    color: #5f6b7a;
    font-size: .85rem;
}

.site-footer::before {
    content: "";
    display: block;
    height: 4px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(90deg, #4a77d4 0 33%, #7fa3e6 33% 66%, #b9cdf2 66%);
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 24px;
    padding: 14px 20px;
}

.site-footer a {
    color: #2f4f94;
    font-weight: 600;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #2f4f94;
    text-decoration: underline;
}

.site-footer .bi {
    margin-right: 4px;
}

.site-footer-note {
    background: #e3eaf6;
    color: #2f4f94;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .8rem;
}

@media (max-width: 575.98px) {
    .site-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ---------- Popups (AjaxControlToolkit ModalPopupExtender panels) ----------
   Panel gets CssClass="modal-card"; inside it .modal-card-header (title +
   .modal-card-close), .modal-card-body and an optional .modal-card-footer.
   The extender positions the panel itself, so only the look is set here. */
.modalBackground {
    background-color: rgba(15, 30, 60, .55) !important;
    opacity: 1 !important;
}

.modal-card {
    background: #fff;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 30, 60, .28);
    max-width: calc(100vw - 32px);
    overflow: hidden;
    font-size: .92rem;
    text-align: left;
}

.modal-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #4a77d4, #3a5fb0);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.modal-card-header .bi {
    font-size: 1.15rem;
}

.modal-card-close {
    margin-left: auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.2rem;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
}

.modal-card-close:hover,
.modal-card-close:focus {
    background: rgba(255, 255, 255, .3);
    color: #fff;
}

.modal-card-body {
    padding: 18px;
}

.modal-card-body > table {
    width: 100%;
}

.modal-card-footer {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px;
    background: #f6f8fb;
    border-top: 1px solid #e5eaf2;
}

/* the popup's main action is filled (site buttons are outlined elsewhere) */
.modal-card .btn-primary {
    --bs-btn-bg: #4a77d4;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #3a5fb0;
    --bs-btn-hover-border-color: #3a5fb0;
    --bs-btn-active-bg: #2f4f94;
    --bs-btn-active-border-color: #2f4f94;
}

.modal-card .btn-danger {
    --bs-btn-bg: #b02a37;
    --bs-btn-color: #fff;
}

/* 6-digit OTP entry */
.otp-input {
    max-width: 220px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .45em;
    padding-left: .45em;
}

/* export-type choices in ExportSettingsPanel */
.export-options input {
    margin-right: 8px;
}

.export-options label {
    display: inline-block;
    margin-bottom: 8px;
}

.export-options .aspNetDisabled {
    opacity: .5;
}

/* ---------- ReportViewer toolbar ----------
   Restyles the viewer's own toolbar (.MSRS-RVC is its container) to match
   the BS5 look: soft rounded bar, square icon buttons with a brand-blue
   hover, greyed disabled icons and Bootstrap-like inputs. Look only - the
   viewer still shows/hides its buttons itself. */
.MSRS-RVC .ToolBarBackground {
    background: #f6f8fb !important;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    margin-bottom: 8px;
}

.MSRS-RVC .ToolBarButtonsCell {
    border: 0 !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px 6px;
}

/* groups: vertically centred, lighter dividers */
.MSRS-RVC .ToolBarButtonsCell > .WidgetSet {
    display: inline-flex !important;
    align-items: center;
    height: 40px;
    padding: 0 10px !important;
    border-right: 1px solid #dfe6ef !important;
    vertical-align: middle !important;
}

.MSRS-RVC .ToolBarButtonsCell > .WidgetSet:last-child {
    border-right: 0 !important;
}

.MSRS-RVC .ToolBarButtonsCell .WidgetSet td {
    height: auto !important;
    vertical-align: middle;
}

.MSRS-RVC .InterWidgetGroup {
    width: 2px;
}

/* icon buttons */
.MSRS-RVC .NormalButton,
.MSRS-RVC .DisabledButton,
.MSRS-RVC .ExportLink {
    height: auto !important;
    border-radius: 8px;
}

.MSRS-RVC .NormalButton table,
.MSRS-RVC .DisabledButton table {
    width: 34px;
    height: 34px;
}

.MSRS-RVC .NormalButton td,
.MSRS-RVC .DisabledButton td {
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
    height: 34px !important;
}

.MSRS-RVC .glyphui {
    color: #2f4f94 !important;
    font-size: 17px !important;
    line-height: 1 !important;
    height: auto !important;
    vertical-align: middle !important;
}

.MSRS-RVC .NormalButton {
    cursor: pointer;
    transition: background-color .12s;
}

.MSRS-RVC .NormalButton:hover,
.MSRS-RVC .NormalButton:focus-visible,
.MSRS-RVC .ExportLink:hover {
    background: #e3eaf6;
}

.MSRS-RVC .DisabledButton .glyphui {
    color: #b8c4d6 !important;
}

.MSRS-RVC .ExportLink {
    display: inline-flex !important;
    align-items: center;
    gap: 2px;
    padding: 8px !important;
    text-decoration: none;
}

.MSRS-RVC .glyphui-downarrow {
    font-size: 11px !important;
}

/* inputs: page number, zoom, find */
.MSRS-RVC .ToolBarButtonsCell input[type="text"],
.MSRS-RVC .ToolBarButtonsCell select {
    height: 30px !important;
    border: 1px solid #cdd7df !important;
    border-radius: 6px;
    padding: 2px 8px !important;
    font-size: .85rem !important;
    background-color: #fff;
    color: #212529;
    vertical-align: middle;
}

.MSRS-RVC .ToolBarButtonsCell input[type="text"]:focus,
.MSRS-RVC .ToolBarButtonsCell select:focus {
    border-color: #4a77d4 !important;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(74, 119, 212, .2);
}

.MSRS-RVC .ToolbarPageNav input[type="text"] {
    width: 48px !important;
    text-align: center;
    margin: 0 6px !important;
}

.MSRS-RVC .ToolbarPageNav,
.MSRS-RVC .ToolbarFind {
    font-size: .85rem;
    color: #5f6b7a;
}

.MSRS-RVC .ToolbarFind input[type="text"] {
    width: 160px !important;
    margin-right: 6px !important;
}

.MSRS-RVC .ToolbarFind a {
    padding: 4px 8px;
    border-radius: 6px;
    text-decoration: none;
}

.MSRS-RVC .ToolbarFind a.ActiveLink {
    color: #2f4f94 !important;
    font-weight: 600;
}

.MSRS-RVC .ToolbarFind a.ActiveLink:hover {
    background: #e3eaf6;
}

.MSRS-RVC .ToolbarFind a.DisabledLink {
    color: #9aa7b8 !important;
}
