/* color config */
:root {
  --fux-dark: #051422;
  --fux-yellow: #90A4AE;
  --fux-blue: #1D3143;
  --fux-blue_normal: #254F7B;
  --fux-red: #B4003A;
  --fux-red_dark: #761C19;
  --grey-light: #EAEAEA;
  --grey: #787878;
  --fux-dark_normal: #0E2237;
  --notice-background: #BFD7EE;
  --notice-border: #94BDE2;
  --error-background: #F0CCD8;
  --error-border: #DA809D;
  --error-font: #B4003A;
  --font: #0A0A0A;
  --yellow-light: #F5F5E7;
}

* {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
}

/* Responsive utility classes (Bootstrap 5 missing custom utilities) */
/* NOTE: Breakpoint at 992px matches flex-lg-row — cards go side-by-side only when row layout is active */
@media (min-width: 992px) {
  .w-md-50 { width: 50% !important; max-width: 50% !important; }
}

/* Table responsive wrapper */
.table-responsive-webinfo {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* resetting general stylings */
#frame {
    height: 100%;
    overflow: hidden !important;
}
#frame #maincontent {
    margin: 0;
    padding: 0;
    max-width: 100vW;
    height: 100vH;
}
#frame #maincontent #content {
    margin: 0;
    padding: 0;
    display: flex;
    max-width: 100vW;
    height: 100vH;
}
/* links */
a:not(.btn) {
    color: var(--fux-dark);
}
a:not(.btn):hover {
    color: var(--fux-blue);
    text-decoration: underline;
}

/* buttons*/
.btn,
.fc .fc-button {
    height: 40px;
    padding: 8px 16px;
    border-radius: 24px;
    border: 0;
    color: var(--font);
    font-size: 14px;
    line-height: 14px;
    width: fit-content;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-around;
}
.btn:disabled,
.fc .fc-button:disabled {
    background-color: var(--grey-light);
    color: var(--font);
    opacity: 1;
}
.btn:focus,
.btn:active,
.btn:active:focus,
.fc .fc-button-primary:not(:disabled).fc-button-active:focus, 
.fc .fc-button-primary:not(:disabled):active:focus {
    border: none;
    box-shadow: none;
    background-color: var(--fux-blue);
    color: #FFFFFF;
}
.btn.btn-primary,
.fc .fc-button-primary {
    background-color: var(--fux-yellow);
}
.btn.btn-secondary:hover,
.btn.btn-primary:hover,
.btn.btn-delete:hover,
.btn.btn-outline-primary:hover,
.fc .fc-button-primary:hover {
    background-color: var(--fux-blue);
    color: #FFFFFF;
}
.btn.btn-secondary {
    background-color: var(--grey-light);
}
.btn.btn-delete {
    background-color: var(--fux-red);
    color: #FFFFFF;
}
.fc .fc-prev-button,
.fc .fc-next-button {
   padding: 5px 16px;
}
.btn .icon {
    display: inline-block;
    height: 24px;
    width: 24px;
}
.btn.btn-outline-primary {
    background-color: var(--fux-dark_normal);
    border: 2px solid var(--fux-yellow);
    color: var(--fux-yellow);
}
.btn.btn-outline-primary:hover {
    border: 2px solid var(--fux-blue);
}
/* forms */
form small {
    line-height: normal;
    font-size: 10px;;
    padding: 5px;
}
form .form-control.error {
    background-color: var(--error-background);
}

form .form-subtitle {
    color: var(--fux-yellow);
    font-size: 14px;
    letter-spacing: 0.15px;
}
form .flex-column {
    gap: 8px;
}
form .flex-column input {
    width: 100%;
}

/* checkboxes */
.form-check-input,
.form-check-input:checked,
.form-check-input:active,
.form-check-input:focus {
    height: 16px;
    width: 16px;
    border: 1px solid var(--fux-yellow);
    color: #000000;
}
.form-check-input.error {
    border: 1px solid var(--error-border);
    background: var(--error-background);
}
.form-check-input:checked {
    background-color: var(--fux-yellow);
}
.form-check .form-check-label {
    font-weight: 600;
}

/* select */
.form-select {
    border: 2px solid var(--fux-yellow);
    background-color: var(--yellow-light);
    border-radius: 50px;
    text-align: center;
    max-width: 180px;
}

/* alert */
.alert.alert-danger {
    color: var(--error-font);
    background-color: var(--error-background);
    border: var(--error-border);
}
.alert.alert-info {
    color: var(--fux-blue);
    background-color: var(--notice-background);
    border: var(--notice-border);
}
.alert p {
    margin-bottom: 0;
}

/* cards */
.card {
    box-shadow: 4px 4px 4px 0px #0000001A;
    border: solid 1px var(--fux-dark);
    border-radius: 24px;
    height: fit-content;
}
.card .card-header {
    background: linear-gradient(180deg, rgba(5, 20, 34, 0) 0%, #051422 100%), linear-gradient(0deg, var(--fux-dark, #0E2237), var(--fux-dark, #0E2237));
    color: var(--fux-yellow);
    font-weight: 600;
    font-size: 20px;
    padding: 24px;
    border-top-left-radius: 17px;
    border-top-right-radius: 17px;
    border: none;
    align-items: center;
}
.card .card-header .btn {
    height: 33px;
}
.card .card-body {
    padding: 0;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
}
.card .card-body .card-subtitle {
    text-align: center;
    font-weight: 600;
    font-size: 20px;
}
.card .card-body .card-body-section {
    padding: 16px 24px;
}
.card .card-body .card-body-section:not(:last-of-type) {
    border-bottom: solid 1px var(--fux-dark_normal);
}
.card .card-body .card-body-section .card-body-section-item {
    padding: 4px 0px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.card .card-body .card-body-section .card-body-section-item span {
    text-align: right;
}
.card .card-body .card-body-section .card-body-section-item .list-item:not(:last-of-type)::after {
    content: ', ';
}
.card .card-body .card-body-section .card-body-section-item label {
    text-align: left;
    font-weight: bold;
    display: flex;
    align-items: center;
}

/* modal */
.modal .modal-dialog {
    box-shadow: 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
    border-radius: 24px;
}

.modal .modal-dialog .modal-content {
    border-radius: 26px;
}
.modal .modal-dialog .modal-header {
    background-color: var(--fux-dark);
    text-align: center;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}
.modal .modal-dialog .modal-header .modal-title {
    color: var(--fux-yellow);
    font-weight: 600;
    font-size: 20px;
}
.modal .modal-dialog .modal-header .btn-close {
    background-color: var(--fux-yellow);
    color: var(--fux-dark);
    text-shadow: none;
    opacity: 1;
    height: 20px;
    width: 20px;
    border-radius: 4px;
    padding: 4px;
    margin: 0;
}
.modal .modal-dialog .modal-body {
    padding: 16px 24px;
}
.modal .modal-dialog .modal-body .modal-actions {
    width: 100%;
    padding-top: 24px;
    display: flex;
    justify-content: center;
    gap: 24px;
}

/* table */
table.table thead {
    background-color: var(--fux-dark);
}
table.table thead tr th {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    padding: 16px 0px;
}
table.border-primary {
    border-color: var(--fux-dark) !important;
}

/* action header */
.action-header {
    background-image: url("../../img/webinfo/header-background.png");
    background-position: center;
    height: 120px;
    border-radius: 24px;
    width: 100%;
}
.action-header .action-header-content-wrapper {
    background:  linear-gradient(180deg, rgba(5, 20, 34, 0) 0%, #051422 100%);
    justify-content: space-between;
    display: flex;
    width: 100%;
    height: 100%;
    padding: 12px 24px;
    border-radius: 24px;
    align-items: center;
}
.action-header .action-header-content-wrapper h1 {
    color: var(--fux-yellow);
}

/* Student tab navigation header */
.webinfo-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: fit-content;
    width: 100%;
    margin-bottom: 10px;
}
.webinfo-page-header h1 {
    margin-bottom: 0;
}
.webinfo-page-header .nav-tabs {
    padding-left: 24px;
    padding-right: 30px;
    margin: 0;
    border-bottom: 3px solid var(--fux-yellow);
    align-items: end;
}
.webinfo-page-header .nav-tabs .nav-link,
.webinfo-page-header .nav-tabs .nav-link.active {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border: none;
    font-size: 22px;
    text-decoration: none;
    color: var(--fux-dark);
    padding: 16px 10px;
}
.webinfo-page-header .nav-tabs .nav-link i {
    padding-right: 8px;
    font-size: 22px;
}
.webinfo-page-header .nav-tabs .nav-link.active {
    background: var(--fux-yellow);
}
.webinfo-page-header .single-student-header {
    height: 60px;
    gap: 15px;
    border-bottom: solid 2px var(--fux-yellow);
    padding-left: 20px;
}
.webinfo-page-header .single-student-header .single-student-item {
    gap: 8px;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
}
.webinfo-page-header .single-student-header .single-student-item span {
    font-size: 20px;
    font-weight: 500;
}
.webinfo-page-header .single-student-header .single-student-item .icon {
    height: 24px;
    width: 24px;
    color: var(--fux-yellow);
    fill: var(--fux-yellow);
}
/* account & period: scrollable content area beside fixed sidebar */
.webinfo-account-container,
.webinfo-period-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.webinfo-account-container {
    padding: 32px 24px;
}
/* icons */
.icon {
    background-color: currentColor;
    -webkit-mask: no-repeat center / contain;
    mask: no-repeat center / contain;
}
#user-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/user.svg");
    mask-image: url("../../img/webinfo/nav-icons/user.svg");
}
#college-hat-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/college-hat.svg");
    mask-image: url("../../img/webinfo/nav-icons/college-hat.svg");
}
#dashboard-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/dashboard.svg");
    mask-image: url("../../img/webinfo/nav-icons/dashboard.svg");
}
#first-half-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/first-half.svg");
    mask-image: url("../../img/webinfo/nav-icons/first-half.svg");
}
#school-svg {
    -webkit-mask-image: url("../../img/webinfo/school.svg");
    mask-image: url("../../img/webinfo/school.svg");
}
#second-half-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/second-half.svg");
    mask-image: url("../../img/webinfo/nav-icons/second-half.svg");
}
#overall-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/overall.svg");
    mask-image: url("../../img/webinfo/nav-icons/overall.svg");
}
#calendar-svg {
    -webkit-mask-image: url("../../img/webinfo/nav-icons/calendar.svg");
    mask-image: url("../../img/webinfo/nav-icons/calendar.svg");
}
#teacher-svg {
    -webkit-mask-image: url("../../img/webinfo/teacher.svg");
    mask-image: url("../../img/webinfo/teacher.svg");
}
#classbook-svg {
    -webkit-mask-image: url("../../img/webinfo/classbook.svg");
    mask-image: url("../../img/webinfo/classbook.svg");
}

/* ============================================================
   RESPONSIVE DESIGN — Mobile & Tablet Breakpoints
   ============================================================ */

/* --- Hamburger Menu Button --- */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1050;
    background-color: var(--fux-dark);
    color: var(--fux-yellow);
    border: 2px solid var(--fux-yellow);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Focus state for hamburger (keyboard accessibility) */
.hamburger-btn:focus-visible {
    outline: 3px solid var(--fux-yellow);
    outline-offset: 2px;
}

/* General focus-visible for interactive elements */
a:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--fux-yellow);
    outline-offset: 2px;
}

/* --- Sidebar Overlay Backdrop --- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1039;
}
.sidebar-backdrop.active {
    display: block;
}

/* --- Tablet: <= 1024px --- */
@media (max-width: 1024px) {
    .hamburger-btn {
        display: flex;
    }

    /* Page header: stack vertically */
    .webinfo-page-header {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 12px;
    }
    .webinfo-page-header h1 {
        font-size: 22px;
    }
    .webinfo-page-header .nav-tabs {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .webinfo-page-header .nav-tabs .nav-link,
    .webinfo-page-header .nav-tabs .nav-link.active {
        font-size: 16px;
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Action header: stack buttons */
    .action-header {
        height: auto;
        min-height: 80px;
    }
    .action-header .action-header-content-wrapper {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
        align-items: flex-start;
    }
    .action-header .action-header-content-wrapper h1 {
        font-size: 20px;
    }
    .action-header .action-wrapper {
        width: 100%;
    }
    .action-header .button-wrapper {
        flex-wrap: wrap;
    }

    /* Forms: select full width */
    .form-select {
        max-width: 100%;
    }

    /* Account container: add space for hamburger */
    .webinfo-account-container,
    .webinfo-period-container {
        padding: 24px 16px;
        padding-top: 72px;
    }

    /* Cards: ensure min touch targets */
    .btn {
        min-height: 44px;
    }
}

/* --- Mobile: <= 768px --- */
@media (max-width: 768px) {
    .webinfo-page-header .nav-tabs .nav-link,
    .webinfo-page-header .nav-tabs .nav-link.active {
        font-size: 14px;
        padding: 8px 6px;
    }
    .webinfo-page-header .nav-tabs .nav-link i {
        font-size: 16px;
        padding-right: 4px;
    }

    .webinfo-page-header .single-student-header {
        height: auto;
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    .webinfo-page-header .single-student-header .single-student-item {
        font-size: 16px;
    }
    .webinfo-page-header .single-student-header .single-student-item span {
        font-size: 16px;
    }

    /* Action header: smaller */
    .action-header .action-header-content-wrapper h1 {
        font-size: 18px;
    }

    /* Card headers: smaller */
    .card .card-header {
        font-size: 16px;
        padding: 16px;
    }
    .card .card-body .card-body-section {
        padding: 12px 16px;
    }
    .card .card-body .card-body-section .card-body-section-item {
        flex-direction: column;
        gap: 2px;
    }
    .card .card-body .card-body-section .card-body-section-item span {
        text-align: left;
    }

    /* Modal: full-width on mobile */
    .modal .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }
    .modal .modal-dialog .modal-body .modal-actions {
        flex-direction: column;
        gap: 12px;
    }
    .modal .modal-dialog .modal-body .modal-actions .btn {
        width: 100%;
    }
}

/* --- Small Phone: <= 480px --- */
@media (max-width: 480px) {
    * {
        font-size: 13px;
    }

    .webinfo-account-container,
    .webinfo-period-container {
        padding: 16px 8px;
        padding-top: 68px;
    }

    .webinfo-page-header h1 {
        font-size: 18px;
    }

    .btn {
        font-size: 13px;
        padding: 8px 12px;
        gap: 4px;
    }

    .card .card-header {
        font-size: 14px;
        padding: 12px;
    }
    .card .card-header .btn {
        font-size: 12px;
        padding: 6px 10px;
        height: auto;
        min-height: 36px;
    }
}

/* ============================================================
   PRINT STYLES — Desktop layout for printing
   ============================================================ */
@media print {
    /* Hide navigation and interactive elements */
    .sidebar-container,
    .hamburger-btn,
    .sidebar-backdrop,
    .btn,
    .nav-tabs,
    .action-header {
        display: none !important;
    }

    /* Full-width content, no padding for hamburger */
    .webinfo-account-container,
    .webinfo-period-container {
        padding: 0 !important;
        width: 100% !important;
    }

    /* Cards side-by-side in print (desktop layout) */
    .d-flex.flex-column.flex-lg-row {
        flex-direction: row !important;
    }
    .w-md-50 {
        width: 50% !important;
        max-width: 50% !important;
    }

    /* No card shadows in print */
    .card {
        box-shadow: none !important;
        break-inside: avoid;
    }

    /* Tables: full width, no scroll */
    .table-responsive-webinfo {
        overflow: visible !important;
    }

    /* Page breaks */
    .subject-block {
        break-inside: avoid;
    }

    /* Reset font size */
    * {
        font-size: 12px !important;
    }
    .card .card-header {
        font-size: 14px !important;
    }
    h1 {
        font-size: 18px !important;
    }
}