/* ============================================================
   schoolPicker.css
   Styling for the school search widget used in transfer and TPA forms
   ============================================================ */

.school-picker {
    position: relative;
    width: 100%;
}

/* ---------- Search input and dropdown ---------- */

.school-picker-search-wrapper {
    position: relative;
}

.school-picker-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    background-color: #fff;
    background-image: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.school-picker-input:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.school-picker-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.school-picker-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1rem;
    pointer-events: none;
}

.school-picker-help-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 1.1rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem;
    line-height: 1;
}

.school-picker-help-icon:hover {
    color: #0d6efd;
}

/* ---------- Results dropdown ---------- */

.school-picker-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    display: none;
}

.school-picker-results.visible {
    display: block;
}

.school-picker-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: background-color 0.1s;
    min-height: 60px;
}

.school-picker-result-item:last-child {
    border-bottom: none;
}

.school-picker-result-item:hover,
.school-picker-result-item.active {
    background-color: #e7f1ff;
}

.school-picker-result-campus {
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.school-picker-result-district {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.3;
}

.school-picker-result-city {
    font-size: 0.8rem;
    color: #868e96;
    font-style: italic;
    margin-top: 0.1rem;
}

.school-picker-result-item mark {
    background-color: #fff3cd;
    color: inherit;
    padding: 0 1px;
    font-weight: 700;
}

.school-picker-result-item.active mark {
    background-color: #ffe69c;
}

/* ---------- Empty state (offers "Not listed" option) ---------- */

.school-picker-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: #6c757d;
}

.school-picker-empty-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.school-picker-empty-message {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.school-picker-not-listed-link {
    color: #0d6efd;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    background: none;
    border: none;
    padding: 0;
}

.school-picker-not-listed-link:hover {
    color: #0a58ca;
}

/* ---------- Loading state ---------- */

.school-picker-loading {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.school-picker-loading i {
    animation: school-picker-spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes school-picker-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- Selected state confirmation card ---------- */

.school-picker-selection {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: #e7f5ea;
    border: 1px solid #b7e4c7;
    border-radius: 0.375rem;
    gap: 1rem;
}

.school-picker-selection-info {
    flex: 1;
    min-width: 0;
}

.school-picker-selection-district {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.2rem;
}

.school-picker-selection-campus {
    font-size: 1.1rem;
    color: #212529;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.school-picker-selection-city {
    font-size: 0.85rem;
    color: #6c757d;
}

.school-picker-selection-other-badge {
    display: inline-block;
    background-color: #fff3cd;
    color: #664d03;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.school-picker-selection-change {
    background: none;
    border: 1px solid #6c757d;
    color: #495057;
    padding: 0.35rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.school-picker-selection-change:hover {
    background-color: #fff;
    border-color: #495057;
}

/* ---------- Not Listed manual entry form ---------- */

.school-picker-other-form {
    padding: 1.25rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.school-picker-other-form h6 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #212529;
}

.school-picker-other-form .form-text {
    margin-bottom: 1rem;
}

.school-picker-other-form .row {
    margin-top: 0.5rem;
}

.school-picker-other-form .form-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.school-picker-other-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.school-picker-other-actions .btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* ---------- Mobile adjustments ---------- */

@media (max-width: 576px) {
    .school-picker-result-item {
        padding: 0.9rem 1rem;
        min-height: 64px;
    }
    
    .school-picker-result-campus {
        font-size: 0.95rem;
    }
    
    .school-picker-selection {
        flex-direction: column;
        align-items: stretch;
    }
    
    .school-picker-selection-change {
        align-self: flex-start;
    }
}

/* ---------- Hidden utility ---------- */

.school-picker-hidden {
    display: none !important;
}

/* ---------- Compact two-line result rows ---------- */

.school-picker-result-meta {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.3;
    margin-top: 0.1rem;
}

/* Override the old three-line styles - we no longer use these */
.school-picker-result-district,
.school-picker-result-city {
    display: none;
}

/* ---------- Loading state on the input itself ---------- */

.school-picker-input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.school-picker-input:disabled::placeholder {
    color: #adb5bd;
}