/* Custom Select Styling */
.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
    /* Override parent font-size: 0 from qcf.css line 66 */
    font-size: 16px !important;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    /* Match the height of regular form inputs */
    height: 1.3em;
    line-height: 1.3em;
    min-height: 1.3em;
    /* Prevent overflow from long text */
    max-width: 310px;
    overflow: hidden;
}

@media (min-width: 500px) {
    .custom-select-trigger {
        max-width: 100%;
    }
}

@media (min-width: 1000px) {
    .custom-select-trigger {
        max-width: 445px;
    }
}

.custom-select:focus .custom-select-trigger,
.custom-select.open .custom-select-trigger {
    outline: none;
}

.custom-select-value {
    flex: 1;
    color: #333;
    font-size: 16px;
    line-height: 1.3em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-trigger .custom-select-value:empty::before,
.custom-select-trigger .custom-select-value[data-default="true"]::before {
    content: "Select a Program";
    color: #888;
}

.custom-select.disabled .custom-select-trigger .custom-select-value:empty::before,
.custom-select.disabled .custom-select-trigger .custom-select-value[data-default="true"]::before {
    content: "Select a Degree Level First";
    color: #888;
}

.custom-select.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.custom-select.disabled .custom-select-trigger {
    cursor: not-allowed;
}

.custom-select.disabled .custom-select-value {
    color: #aaa;
}

.custom-select-arrow {
    font-size: 12px;
    color: #333;
    transition: transform 0.3s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    /* Position relative to the .field-wrapper */
    top: 100%;
    left: -0.5em;
    right: -0.5em;
    max-height: 650px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #707070;
    border-radius: 0.125rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    margin-top: 2px;
}

.custom-select.open .custom-select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    padding: 4px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 16px;
    color: #333;
    line-height: 1.4em;
    position: relative;
}

/* Indented options (non-accelerated programs) */
.custom-select-option.indented {
    padding-left: 28px;
    background-color: #f9f9f9;
}

/* Accelerated programs with lightning bolt icon */
.custom-select-option.accelerated {
    padding-left: 28px;
    background-color: #fff;
}

.custom-select-option.accelerated::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 18px;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 28" fill="none" stroke="%23B6A36B" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolygon points="12 2 3 16 10 16 8 26 17 12 10 12 12 2"%3E%3C/polygon%3E%3C/svg%3E');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.custom-select-option:hover {
    background-color: #003B5D;
    color: #fff;
}

.custom-select-option.accelerated:hover::before {
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"%3E%3C/polygon%3E%3C/svg%3E');
}

.custom-select-option.selected {
    background-color: #B6A36B;
    color: #000;
}

.custom-select-option.accelerated.selected::before {
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 28" fill="none" stroke="%23000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolygon points="12 2 3 16 10 16 8 26 17 12 10 12 12 2"%3E%3C/polygon%3E%3C/svg%3E');
}

.custom-select-option[data-value="default"] {
    color: #888;
    font-style: italic;
}

/* Scrollbar styling for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Keyboard navigation highlight */
.custom-select-option.keyboard-focus {
    background-color: #003B5D;
    color: #fff;
    outline: none;
}

.custom-select-option.accelerated.keyboard-focus::before {
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"%3E%3C/polygon%3E%3C/svg%3E');
}

/* Accessibility - focus visible */
.custom-select:focus-visible {
    outline: none;
}

/* Responsive adjustments - match qcf.css mobile styles */
@media only screen and (max-width: 999px) {
    .custom-select-trigger {
        height: 34px;
        line-height: 34px;
        min-height: 34px;
    }

    .custom-select-value {
        line-height: 34px;
    }

    .custom-select-dropdown {
        max-height: 350px;
    }

    .custom-select-option {
        padding: 6px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .custom-select-option.indented {
        padding-left: 28px;
    }
}

/* Animation for dropdown appearance */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide option if filtered out */
.custom-select-option.filtered-out {
    display: none;
}
