/*
************************ Programme Card ************************
*/

.student-tooltip .tooltip-inner {
    background-color: #EAF4FF;
    color: #003D7C;
    border-left: 4px solid #007DFF;
}

.student-tooltip .tooltip-arrow {
    visibility: hidden;
}


.programme-scholarship-card {
    position: absolute;
    width: fit-content;
    bottom: 0;
    left: 0;
    background-color: #EF7C00;
    padding: 6px 18px;
    color: #FFFFFF;
    font-weight: 400;
    font-size: 12px;
    font-family: 'Montserrat', sans-serif;
    z-index: 2;
}
.programme-scholarship-card div {
    width: 30px;
    height: 100%;
    background: linear-gradient(to bottom left, transparent 0%, transparent 50%, #EF7C00 50%, #EF7C00 100%);
    position: absolute;
    right: -30px;
    top: 0;
}

/*
************************ Thesis Advisor Page ************************
*/

.media-list-container {
    display: grid;
    gap: 1rem;
    @media screen and (min-width: 600px) {
        grid-template-columns: repeat(2, 1fr);
    }
    @media screen and (min-width: 1200px) {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mentoring-style-list-wrapper {
    display: grid;
    gap: 1rem;
    @media screen and (min-width: 1200px) {
        grid-template-columns: repeat(2, 1fr);
    }
}

#modalACF .modal-dialog {
    width: 90% !important;
    max-width: 90% !important;
    @media (min-width: 1350px) {
        max-width: 1200px !important;
    }
}
#modalACF .modal-content {
    max-height: 75vh !important;
}
#modalViewMore .modal-dialog {
    width: 90% !important;
    max-width: 90% !important;
    @media (min-width: 1350px) {
        max-width: 1000px !important;
    }
}
.ui-autocomplete {
    position: absolute;
    top: 48px !important;
    left: 0;
    list-style-type: none;
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 1200;
    margin-top: 5px;
    margin-left: 0;
    background-color: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
}

/* Style the list items in the autocomplete */
.ui-autocomplete .ui-menu-item {
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

/* Hover effect for the list items */
.ui-autocomplete .ui-menu-item-wrapper:hover {
    background-color: var(--color-nus-blue); /* Change the background color on hover */
    color: white; /* Change the text color on hover */
}

/* Optional: Highlight the selected item with jQuery's built-in class */
.ui-state-focus {
    background-color: var(--color-nus-blue);
    color: white;
}

/*
************************ Student Page ************************
*/

#student_list_page h2 {
    font-size: 36px;
    font-weight: 700;
    text-shadow: 0 5px 5px #3C3C3C;
    @media screen and (max-width: 800px) {
        font-size: 26px;
    }
}
#student_list_page h6 {
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 2px #3C3C3C;
    @media screen and (max-width: 800px) {
        font-size: 16px;
    }
}
.student-list-panel {
    filter: drop-shadow(0px 20px 40px rgba(60, 60, 60, 0.1));
    border-radius: 20px;
}
.student-list-panel input[type="checkbox"] {
    cursor: pointer;
}
.student-list-panel input[type="checkbox"]:checked {
    accent-color: var(--color-darkslateblue);
!important;
}
.student-list-panel > :nth-child(2) {
    border-bottom-right-radius: 20px;
    border-bottom-left-radius: 20px;
    border: 1px solid transparent;
    border-top: none;
    background-color: white;
    padding: 36px;
    @media screen and (max-width: 1000px) {
        padding: 24px;
    }
    @media screen and (max-width: 600px) {
        padding: 16px 12px;
    }

}
.student-portal-tabs {
    color: white;
    background-color: #115AA6;
    cursor: pointer;
    padding: 12px 24px;
    border: 1px solid white;
    @media screen and (max-width: 320px) {
        gap: 0 !important
    }
}

.student-portal-tabs.active {
    background-color: white;
    color: #115AA6;
}

.student-profile-main-tab {
    color: #003D7C;
    cursor: pointer;
}

.student-profile-main-tab.active {
    color: #EF7C00;
}

.student-profile-tab {
    width: 33.3%;
    flex-wrap: nowrap;
    @media screen and (max-width: 768px) {
        width: 100%;
    }
}

.quote-mark {
    #background-color: #EF7C00;
    color: #EF7C00;
    #display: inline-block;
}

#refresh-student-showcase {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    border-radius: 4px;
    border: 1px solid #D9D9D9;
    color: #3C3C3C;
    background-color: transparent;
}
#refresh-student-showcase .rotation-icon {
    transition: transform 0.5s ease;
}
@keyframes rotateOneRound {
    0% {
        /* Start state and pause */
        transform: rotate(0deg);
    }
    50% {
        /* Halfway through the animation, rotate to 180 degrees */
        transform: rotate(180deg);
    }
    100% {
        /* Pause and end state */
        transform: rotate(360deg);
    }
}
#refresh-student-showcase .rotation-icon.rotated {
    animation: rotateOneRound 400ms linear infinite;
}
#refresh-student-showcase:hover {
    color: #003D7C;
    border: 1px solid #003D7C;
}

.liked-student-card {
    position: relative;
    border-radius: 20px;
    display: flex;
    padding: 12px;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    width: 100%;
    overflow: hidden;
    @media screen and (min-width: 780px) {
        flex-direction: row;
    }
}
.liked-student-card.active {
    background: #C2DBFF;
}
.liked-student-card .card-image-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    @media screen and (min-width: 780px) {
        width: 120px;
        height: 120px;
        min-width: 120px;
    }
    @media screen and (min-width: 1000px) {
        width: 180px;
        height: 180px;
    }
}

.liked-student-card ul {
    overflow-x: auto;
    overflow-y: visible;
    list-style-type: none;
    padding: 0;
    display: none;
    gap: 16px;
    margin-top: 16px;
    @media screen and (min-width: 780px) {
        display: flex;
    }
}
.liked-student-card li {
    color: #3C3C3C80;
    font-weight: 600;
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    height: fit-content;
    position: relative;
}
.liked-student-card li.active {
    color: #3C3C3C;
    border-bottom: 2px solid #3C3C3C;
}
.liked-student-card div[card-body="bottom"] {
    display: none;
    @media screen and (min-width: 780px) {
        display: flex;
    }
}

.liked-student-card input[type="checkbox"] {
    position: absolute;
    z-index: 6;
    background: black;
    top: 15px;
    right: 15px;
    height: fit-content;
    @media screen and (min-width: 780px) {
        position: relative;
        margin-left: 20px
    }
}

#liked_students_action_bar button {
    padding: 6px 12px;
    background: #FFFFFF;
    border: 1px solid #D9D9D9;
    box-shadow: 0 0 0 3px #FFFFFF4D;
    display: flex;
    gap: 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #3C3C3C;
    @media screen and (min-width: 780px) {
        padding: 6px 24px;
    }

}
#liked_students_action_bar button:hover {
    border: 1px solid var(--color-darkslateblue-100);
}

/* Four columns to match the thesis advisor grid: at five the cards fell to ~223px,
   which crops portraits tightly and leaves no room for the name and match reason. */
.student-portal-card-list-wrapper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 28px;
    width: 100%;
    padding-top: 0.8rem;
    padding-bottom: 1.6rem;
    box-sizing: border-box;
    /* Rows stretch by default, so a short card would inflate to match the tallest in
       its row and leave its image floating above dead space. */
    align-items: start;
}

@media (max-width: 1200px) {
    .student-portal-card-list-wrapper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .student-portal-card-list-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .student-portal-card-list-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 20px;
    }
}

.student-portal-card-list-wrapper > * {
    min-width: 0;
}


#student_list_page .hover-overlay {
    position: absolute;
    bottom: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 61, 124, 0.05), rgba(0, 61, 124, 0.85));
    opacity: 0;
    transition: opacity 0.5s ease-in-out, bottom 1s ease-in-out;
    z-index: 1;
}

#student_list_page .student-card-image-wrapper:hover .hover-overlay {
    /*animation: fadeIn 0.5s ease-in forwards;*/
    bottom: 0;
    opacity: 1;
}

#student_list_page .student-portal-card-list-wrapper > a {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    padding: 12px;
    box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}

#student_list_page .student-portal-card-list-wrapper > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.12);
}

#student_list_page .student-portal-card-list-wrapper .custom-card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #183b5b;
}

#student_list_page .student-portal-card-list-wrapper .ta-department-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    min-width: 0;
    color: #5f7386;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

#student_list_page .student-portal-card-list-wrapper .ta-department-label svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

#student_list_page .student-portal-card-list-wrapper .ta-department-label svg path {
    fill: #7c92a6;
}

#student_list_page .student-portal-card-list-wrapper .ta-department-label span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#student_list_page .student-portal-card-list-wrapper .student-card-image-wrapper {
    aspect-ratio: 1 / 1 !important;
    border-radius: 16px;
    overflow: hidden;
    background: #e9eef5;
}

@media (max-width: 480px) {
    #student_list_page .student-portal-card-list-wrapper > a {
        padding: 8px;
        border-radius: 14px;
    }
    #student_list_page .student-portal-card-list-wrapper .student-card-image-wrapper {
        aspect-ratio: 1 / 1 !important;
        border-radius: 12px;
    }
    #student_list_page .student-portal-card-list-wrapper .custom-card-title {
        font-size: 13px;
    }

    #student_list_page .student-portal-card-list-wrapper .ta-department-label {
        margin-top: 6px;
        font-size: 11px;
    }

    #student_list_page .student-portal-card-list-wrapper .ta-department-label svg {
        width: 14px;
        height: 14px;
    }

    #student_list_page .student-portal-card-list-wrapper {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

#student_list_page .student-portal-card-list-wrapper .student-card-image-wrapper:hover img {
    filter: saturate(1.05);
}

#student_list_page .student-portal-card-list-wrapper .mt-3 {
    margin-top: 0.5rem !important;
}

#student_list_page .student-portal-card-list-wrapper > a > div:not(.student-card-image-wrapper) {
    padding: 0 4px 4px;
}

#student_list_page .student-portal-card-list-wrapper .skeleton,
#student_list_page .student-portal-card-list-wrapper .skeleton::before {
    max-width: 100%;
    box-sizing: border-box;
}

#student_list_page .student-portal-card-list-wrapper .skeleton-card {
    width: 100%;
    max-width: 100%;
}

#student_list_page .student-portal-card-list-wrapper .skeleton-card > div {
    width: 100%;
}

#student_list_page .student-portal-card-list-wrapper .student-card-image-wrapper img {
    border-radius: inherit;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#student_list_page .student-portal-card-list-wrapper .rounded-circle {
    display: none;
}

#student_list_page .student-portal-card-list-wrapper > a:hover .custom-card-title {
    color: #0f4f93;
}

@media (hover: none) {
    #student_list_page .hover-overlay {
        bottom: 0;
        opacity: 1;
        background: linear-gradient(180deg, rgba(0, 61, 124, 0.15), rgba(0, 61, 124, 0.9));
    }
    #student_list_page .hover-text {
        font-size: 0.95rem !important;
    }
}
#student_list_page .button-disabled {
    pointer-events: none; /* Disable click */
    background-color: gray; /* Optional: visual cue */
    text-decoration: none; /* Optional: remove underline */
    cursor: default; /* Optional: change cursor */
}

#modalAuthentication .back-arrow {
    color: #003d7c;
    font-size: 1.2rem;
    cursor: pointer;
}

#modalAuthentication .otp-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: center;
}

#modalAuthentication .otp-input {
    flex-grow: 1;
    aspect-ratio: 2/3;
    min-width: 30px;
    max-width: 55px;
    text-align: center;
    border: 1px solid #E4E4E4 !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    @media screen and (min-width: 576px) {
        font-size: 1.4rem;
    }
}

#modalAuthentication .error {
    border: 2px red solid !important;
}

.student-profile-photo-crop-field .acf-input > input,
.student-profile-photo-crop-field .acf-input > textarea {
    display: none;
}

.student-photo-crop-preview {
    margin-top: 12px;
    display: none;
}

.student-profile-photo-field .acf-image-uploader.has-value .image-wrap,
.student-profile-photo-field .acf-basic-uploader.has-value .image-wrap {
    display: none !important;
}

.student-profile-photo-field .acf-image-uploader.has-value .hide-if-value,
.student-profile-photo-field .acf-basic-uploader.has-value .hide-if-value {
    display: none !important;
}

.student-profile-photo-field .acf-image-uploader.has-value .show-if-value,
.student-profile-photo-field .acf-basic-uploader.has-value .show-if-value {
    display: none !important;
}

.student-photo-crop-preview.has-image {
    display: block;
}

.student-photo-crop-preview__label {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.student-photo-crop-preview__frame {
    width: 300px;
    height: 300px;
    border-radius: 18px;
    border: 1px solid #d5deea;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
    overflow: hidden;
    position: relative;
}

.student-photo-crop-preview__frame.has-image {
    background: #f3f6fa;
}

.student-photo-crop-preview__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.student-photo-crop-preview__remove {
    color: #7f1d1d;
    text-decoration: none;
    padding-left: 0;
    padding-right: 0;
}

.student-photo-crop-preview__canvas {
    width: 300px;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.student-photo-crop-preview__image {
    display: block;
    max-width: none;
    position: absolute;
    top: 0;
    left: 0;
}

.student-photo-crop-preview__image--cover {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-photo-crop-modal .modal-dialog {
    max-width: 860px;
}

.student-photo-crop-modal__stage {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f7fb;
    border-radius: 20px;
    overflow: hidden;
}

.student-photo-crop-modal__image {
    display: block;
    max-width: 100%;
}

.student-photo-crop-modal__controls {
    margin-top: 16px;
}

@media (max-width: 767px) {
    .student-photo-crop-modal__stage {
        min-height: 280px;
    }
}

#modalAuthentication .message-warning {
    color: red;
    font-size: 14px !important;
    margin: 6px 0 !important;
}

#modalAuthentication .otp-timer-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;
}

#modalAuthentication .progress-ring {
    transform: rotate(-90deg);
}

#modalAuthentication .progress-ring__background {
    fill: none;
    stroke: #eee;
    stroke-width: 8;
}

#modalAuthentication .progress-ring__circle {
    fill: none;
    stroke: #003D7C;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

#modalAuthentication .otp-timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
}

#modalAuthentication .ui-autocomplete {
    top: 40px !important;
}

#chat-list {
    width: 100%;
    background: #F7F7F7;
    @media screen and (min-width: 780px) {
        width: 320px;
    }
    @media screen and (min-width: 1200px) {
        width: 460px;
    }
}
#chat-window {
    display: none;
    width: 100%;
    flex-direction: column;
    flex-grow: 1;
    @media screen and (min-width: 780px) {
        display: flex;
    }
}
#chat-header {
    width: 100%;
    display: flex;
    gap: 12px;
    height: fit-content;
    padding: 12px;
    border-bottom: 1px solid #D9D9D9;
    @media screen and (min-width: 780px) {
        display: none;
    }
}
#chat-panel {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 0 10px 0
}
#chat-panel {
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    scrollbar-width: none; /* Firefox */
}
#chat-panel::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}
#chat-window textarea {
    padding: 5px;
    font-size: 16px;
    border: none;
    outline: none;
    flex-grow: 1;
    resize: none; /* Prevent manual resizing */
    overflow-y: auto; /* Hide overflow */
    box-sizing: border-box; /* Include padding in width calculation */
    height: 30px; /* Initial height */
    max-height: 150px; /* Maximum height */
    /* Hide scrollbar */
    scrollbar-width: none; /* For Firefox */
    -ms-overflow-style: none; /* For Internet Explorer and Edge */
}
#chat-window textarea::-webkit-scrollbar {
    display: none; /* For Chrome, Safari, and Opera */
}
.chat-contact-card {
    padding: 12px;
    gap: 4px;
    border-radius: 12px;
    cursor: pointer;
}
.chat-contact-card.active {
    background: #C2DBFF;
}
.chat-contact-card:hover:not(.active) {
    background: rgba(194, 219, 255, 0.5);
}

/*
************************ Student Portal ************************
