.category-card-wrapper {
    display: grid !important;
    grid-gap: 12px;
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 2rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

#student_policy_list_cover .category-card-wrapper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media screen and (max-width: 900px) {
    #student_policy_list_cover .category-card-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 600px) {
    #student_policy_list_cover .category-card-wrapper {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.category-card-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.category-card-item .category-title {
    text-align: center;
}

@media screen and (min-width: 600px) {
    .category-card-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-gap: 12px;
    }
}

@media screen and (min-width: 900px) {
    .category-card-wrapper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-gap: 16px;
    }
}

@media screen and (min-width: 1400px) {
    .category-card-wrapper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-gap: 18px;
    }
}

.category-card {
    width: 100%;
    max-width: none;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    background-size: cover;
    background: #E4E4E4 no-repeat center;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
}

.category-card:hover {
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
}

.subcard, .preview-subcard {
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    padding: 4px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    @media screen and (min-width: 380px) {
        padding: 4px;
        font-size: 10px;
    }
    @media screen and (min-width: 480px) {
        padding: 6px;
        font-size: 12px;
    }
    @media screen and (min-width: 800px) {
        padding: 10px;
        font-size: 0.85rem;
    }
}

.subcard:hover, .subcard.preview:hover {
    transform: scale(1.03);
}

.subcards-container, .preview-subcard {
    padding: 6px;
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    overflow: hidden;
}

/* Specific styles for preview subcard */
.preview-subcard {
    padding: 4px; /* Slightly smaller padding */
    gap: 4px; /* Less gap between mini icons */
    position: relative;
}

.preview-subcard:hover {
    background: rgba(255, 255, 255, 0.5); /* Lighter background */
}

.preview-subcard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: auto;
    border-radius: 4px;
}
/**************************** Student Profile Form ***********************************/
#student-profile-form {
    background-color: #F2F2F2;
    margin: 0 auto;
    height: 100%;
    min-height: 50vh;
    padding: 50px 1.5rem;
}

#student-profile-form .acf-tab-button {
    color: black;
    background: none;
    border: none;
    padding: 18px;
    border-radius: 9px;
}

#student-profile-form .acf-tab-wrap.-top {
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}
#student-profile-form .acf-fields .-border {
    border: none !important;
}

#student-profile-form .acf-tab-wrap.-top {
    background: rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

#student-profile-form .acf-tab-wrap.-top .acf-tab-group li a {
    font-size: 14px;
    padding: 12px;
    font-weight: 400;
}

#student-profile-form .acf-tab-wrap.-left .acf-tab-group {
    margin-top: 26px;
}

#student-profile-form .acf-tab-wrap.-left .acf-tab-group li a {
    font-size: 14px;
    font-weight: 600;
}

#student-profile-form .acf-tab-wrap.-left li.active {
    background: #F2F2F2;
}
#student-profile-form .acf-tab-wrap.-top li.active a {
    border-radius: 0px;
    color: var(--color-nus-blue) !important;
    border-bottom: 2px solid var(--color-nus-blue) !important;
    font-weight: 600;
}

#student-profile-form .acf-fields.-sidebar:before {
    background: none;
    border-right: none;
}

#student-profile-form .acf-tab-group {
    padding: 0;
}

#student-profile-form #disable-edit-field input {
    color: #374151;                 /* slate-700 */
    background-color: #EEF1F6;      /* soft cool grey */
    border: none;      /* light neutral border */
    border-radius: 10px;
    cursor: not-allowed;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

#student-profile-form #disable-edit-field input:focus {
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
    border-color: #E5E7EB;
}

#student-profile-form .acf-tab-wrap.-top .acf-hl.acf-tab-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
}

#student-profile-form .acf-hl.acf-tab-group::before {
    display: none;
}

#student-profile-form .acf-field[data-width] + .acf-field[data-width] {
    border-left: none;
}

#student-profile-form #student_orcid_form_list_header input {
    background-color: white;
    border: none;
    padding: 0;
}

/**************************** Page Generator *****************************************/
#page-generator {
    width: 100%;
    justify-self: center;
    background: #E4E4E4;
}

#page-generator #return-to-dashboard {
    color: #003d7c;
    text-decoration: underline;
    font-weight: 600;
}

#page-generator #save-container {
    background: white;
    border-radius: 20px;
    padding: 24px 72px;
    align-items: center;
}

#page-generator-single #page-generator-sections,
#page-generator #page-generator-sections {
    background-color: white;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 16px;
}

#page-generator .page-section:hover {
    border: 3px dashed #605AA2;
}

#page-generator .page-section:hover:after {
    content: attr(data-index) ". " attr(data-type) ": " attr(section-name);
    position: absolute;
    top: -1.8rem;
    left: 0;
    background: mediumpurple;
    color: white;
    padding: 6px 12px;
    z-index: 10;
}

#page-generator-modal .hover-button,
#page-generator .hover-button {
    display: flex;
    background: #95D7FF;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    height: 1.8rem;
    width: 1.8rem;
    border: none;
    color: #003d7c;
    display: flex;
    visibility: hidden;
    z-index: 3;
}

#page-generator-single .main-text-container,
#page-generator .main-text-container {
    @media screen and (max-width: 576px) {
        width: 100% !important;
    }
}

#page-generator-single .image-container,
#page-generator .image-container {
    @media screen and (max-width: 576px) {
        width: 100% !important;
    }
}

input:checked + .timeline-layout-container,
input:checked + .image-text-layout-container {
    border: 2px solid blue;
}

#page-generator-modal .tab-content {
    display: flex;
}

#page-generator-modal .tab-pane {
    display: block;
    visibility: hidden;
    margin-right: -100%;
    width: 100%;
}

#page-generator-modal .active {
    visibility: visible;
}

#page-generator-modal #timeline-main-container,
#page-generator-modal #image-text-main-container {
    justify-content: space-between;
    @media screen and (max-width: 992px) {
        grid-template-columns: repeat(2, minmax(150px, 250px)) !important;
        justify-content: center;
    }
    @media screen and (max-width: 400px) {
        grid-template-columns: repeat(1, minmax(150px, 250px)) !important;
        justify-content: center;
    }
}

#page-generator-single .accordion-body,
#page-generator-single .accordion-button,
#page-generator .accordion-body,
#page-generator .accordion-button {
    @media screen and (max-width: 576px) {
        padding-left: 0;
        padding-right: 0;
    }
}

#page-generator-single #page-title,
#page-generator #page-title {
    outline: none;
    border-bottom: 1px solid black;
    font-size: 1.5rem;
    overflow: hidden;
    position: relative;
    min-width: 200px;
}

#page-generator-single #page-title:empty::before,
#page-generator #page-title:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    position: absolute;
    pointer-events: none;
}

#page-generator-single .hover-container,
#page-generator .hover-container {
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease-in-out;
}

#page-generator-single .hover-text-button,
#page-generator .hover-text-button {
    width: 100%;
}

#page-generator-single .hover-overlay,
#page-generator .hover-overlay {
    position: absolute;
    bottom: -100%;
    width: 100%;
    height: 100%;
    background-color: #003D7C80;
    transition: bottom 0.5s ease-in-out;
    z-index: 1;
}

#page-generator-single .gallery-row,
#page-generator .gallery-row {
    height: 300px;
    @media screen and (max-width: 1200px) {
        height: 250px;
    }
    @media screen and (max-width: 767px) {
        height: 200px;
    }
    @media screen and (max-width: 576px) {
        /*display: flex !important;*/
        /*flex-direction: column;*/
        height: unset;
    }
}

#page-generator-single .gallery-row-item,
#page-generator .gallery-row-item {
    height: 300px;
    @media screen and (max-width: 1200px) {
        height: 250px;
    }
    @media screen and (max-width: 767px) {
        height: 200px;
    }
    @media screen and (max-width: 576px) {
        height: unset;
        aspect-ratio: 1;
    }
}

/* Set the 3 possible types of timeline */
/* The actual timeline (the vertical ruler) */
.timeline {
    position: relative;
    /*margin: 0 auto;*/
}

/* The actual timeline (the vertical ruler) */
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: repeating-linear-gradient(
            to bottom,
            black 0px,
            black 10px,
            transparent 10px,
            transparent 20px
    );
    top: 0;
    bottom: 0;
    margin-left: -3px;
}
.timeline-left::after {
    left: 15px
}
.timeline-middle::after {
    left: 50%
}
.timeline-right::after {
    right: 15px
}

/* Container around content */
.timeline .timeline-card {
    padding: 10px 40px;
    position: relative;
    @media screen and (max-width: 576px) {
        padding: 10px 10px 10px 40px;
    }

}
.timeline-middle .timeline-card {
    width: 50%
}

.timeline-right .timeline-card,
.timeline-left .timeline-card {
    width: 100%
}

/* The circles on the timeline */
.timeline .timeline-card::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: black;
    top: 50%;
    border-radius: 50%;
    z-index: 1;
}

.timeline-middle .timeline-card::after {
    right: -6px;
}

/* Place the container to the left */
.timeline .left {
    left: 0;
}

.timeline-left .left::after {
    left: 5px;
}
.timeline-right .right::after {
    right: 8px;
}

/* Place the container to the right */
.timeline-middle .right {
    left: 50%;
}

.timeline-middle .right::after {
    left: -10px;
}

.timeline .timeline-content {
    padding: 36px;
    border-radius: 20px;
    border: 1px solid #D9D9D9;
    @media screen and (max-width: 576px) {
        padding: 36px 10px;
    }
}

/* Media queries - Responsive timeline on screens less than 600px wide */
@media screen and (max-width: 992px) {
    /* Place the timelime to the left */
    .timeline-middle::after {
        left: 15px;
    }

    /* Full-width containers */
    .timeline-middle .timeline-card {
        width: 100%;
    }

    /* Make sure all circles are at the same spot */
    .timeline-middle .left::after, .timeline-middle .right::after {
        left: 5px;
    }

    /* Make all right containers behave like the left ones */
    .timeline-middle .right {
        left: 0%;
    }
}

#page-generator-modal input:checked + .slider,
#modalReOrder input:checked + .slider {
    background-color: #003D7C !important;
}

input:checked + .select-choice {
    color: #003d7c;
    font-weight: bold;
    border: 2px solid #003d7c !important;
}

/********************************* Quill Related CSS ************************************************/
.ql-editor {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
}

.ql-align-center {
    text-align: center;
}
.ql-align-right {
    text-align: right;
}
.ql-align-justify {
    text-align: justify;
}

/*.ql-snow .ql-picker.ql-size .ql-picker-label[data-value]::before, .ql-snow .ql-picker.ql-size .ql-picker-item[data-value]::before { content: attr(data-value) !important; }*/

.ql-style .ql-picker-item:before {
    content: attr(data-label) !important;
}

.ql-style-heading1 {
    font-size: 60px;
    font-weight: 600; /* For Semibold */
    line-height: 1.2;
    color: #115AA6;
    text-transform: none;
}

.ql-style-heading2 {
    font-size: 36px;
    font-weight: 600; /* For Semibold */
    line-height: 1.2;
    color: #115AA6;
    text-transform: none;
}

.ql-style-heading3 {
    font-size: 24px;
    font-weight: 600; /* For Semibold */
    line-height: 1.2;
    color: #115AA6;
    text-transform: none;
}

.ql-style-body {
    font-size: 16px;
    line-height: 1.4;
    color: #333333;
    text-transform: none;
}
.ql-style-hyperlinks {
    font-size: 16px;
    font-weight: 500; /* For Semibold */
    line-height: 1.4;
    color: #115AA6;
    text-transform: none;
}

.ql-formats .ql-icon-picker .ql-picker-options {
    display: flex;
    flex-wrap: wrap;
    width: 160px;
    padding: 4px;
    background: white;
    border: 1px solid #ccc;
    position: absolute;
    z-index: 10;
}

.ql-formats .ql-icon-picker .ql-picker-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ql-formats .ql-icon-picker .ql-picker-label {
    font-size: 16px;
    cursor: pointer;
}

.ql-formats .ql-icon-picker {
    position: relative;
}

.ql-formats .ql-icon-picker .ql-picker-options {
    display: none;
    position: absolute;
    z-index: 100;
    background: white;
    border: 1px solid #ccc;
    padding: 4px;
    flex-wrap: wrap;
    width: 160px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ql-formats .ql-icon-picker.ql-expanded .ql-picker-options {
    display: flex !important;
}

.ql-formats .ql-icon img {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ql-formats .ql-icon {
    display: inline-block;
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
}
