/**
 * K12 Custom Autocomplete Styles
 * LoveForm-inspired design with dark turquoise brand colors
 * Matches /quote page pattern for consistency
 */

/* Autocomplete wrapper positioning */
.form-group.autocomplete-wrapper,
.search-input-container {
    position: relative;
}

/* Custom autocomplete dropdown - LoveForm Compliant
   UNIFIED MODAL PATTERN: Autocomplete is IN the modal flow, not a separate overlay.
   This allows the modal to expand smoothly to contain suggestions. */
.autocomplete-results {
    /* Position relative keeps it in document flow - modal expands to contain it */
    position: relative;
    width: 100%;
    margin-top: 12px; /* Space below input field */
    /* LoveForm card styling - no border/shadow since it's inside the modal */
    background: transparent; /* Inherits modal background */
    color: #222222; /* Dark text for readability */
    border: none; /* No border - part of modal */
    border-top: none;
    border-radius: 0; /* No rounding - flows with modal */
    box-shadow: none; /* No shadow - modal provides shadow */
    padding: 8px 0 0;
    max-height: none;
    overflow: visible;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    -webkit-overflow-scrolling: touch;
}

.autocomplete-results.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Individual autocomplete items */
.autocomplete-item {
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    border-radius: 12px;
}

.autocomplete-item:hover,
.autocomplete-item.active,
.autocomplete-item.autocomplete-active {
    background: #f7f7f7;
}

.autocomplete-item .place-icon-wrap {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Location pin icon */
.autocomplete-item .place-icon {
    stroke: #222222;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Place text container */
.autocomplete-item .place-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: left;
    align-items: flex-start;
}

/* Main address text */
.autocomplete-item .place-primary,
.autocomplete-item .place-text > div:first-child {
    font-size: 15px;
    font-weight: 400;
    color: #222222;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item .place-primary strong,
.autocomplete-item .place-secondary strong {
    font-weight: 600;
    color: #222222;
}

/* Secondary address text (city, state) */
.autocomplete-item .place-secondary {
    font-size: 13px;
    color: #717171;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No results message */
.autocomplete-no-results {
    padding: 20px;
    color: #717171;
    text-align: center;
    font-size: 14px;
}

.autocomplete-no-results a {
    color: #289a96;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.autocomplete-no-results a:hover {
    color: #1a7572;
    text-decoration: underline;
}

/* Powered by Google footer - Inside unified modal */
.autocomplete-powered {
    align-self: flex-end;
    margin-top: 10px;
    margin-left: auto;
    padding: 6px 10px 0;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(34, 34, 34, 0.48);
    border-top: none;
    background: transparent;
}

/* Hide default Google autocomplete dropdown */
.pac-container {
    display: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .autocomplete-results {
        border-radius: 8px;
    }

    .autocomplete-item {
        padding: 8px 4px;
    }

    .autocomplete-item .place-text > div:first-child {
        font-size: 15px;
    }

    .autocomplete-item .place-secondary {
        font-size: 13px;
    }
}

/* Accessibility: Focus visible states */
.autocomplete-item:focus-visible {
    outline: 2px solid #289a96;
    outline-offset: -2px;
}

/* Touch-friendly larger hit areas on mobile */
@media (pointer: coarse) {
    .autocomplete-item {
        min-height: 56px;
    }
}
