/* ================================================================
   Google Places Autocomplete – Premium SaaS UI
   Reusable across Customers, Sites, Employees, Vendors, etc.
   ================================================================ */

/* ── Outer wrapper ─────────────────────────────────────────────── */
.gp-wrap {
    position: relative;
    width: 100%;
}

/* ── Input wrapper ─────────────────────────────────────────────── */
.gp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 9px !important;
}

.gp-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme, #09958A);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* Override the existing .search-location-block .form-control rule */
.gp-input-wrap > input.form-control {
    padding-left: 38px !important;
    padding-right: 38px !important;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 40px;
}

.gp-input-wrap > input.form-control:focus {
    border-color: var(--theme, #09958A) !important;
    box-shadow: 0 0 0 3px rgba(9, 149, 138, 0.11) !important;
    outline: none;
}

/* ── Clear (×) button ──────────────────────────────────────────── */
.gp-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E2E8F0;
    cursor: pointer;
    color: #64748B;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s;
    z-index: 2;
}

.gp-clear-btn:hover {
    background: #CBD5E1;
    color: #374151;
}

.gp-clear-btn.gp-visible {
    display: flex;
}

/* ── "Enter address manually" link (flex item inside gp-input-wrap) ── */
.gp-enter-manually {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0 12px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary, #1ABC9C);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
    white-space: nowrap;
    z-index: 3;
}

.gp-enter-manually:hover {
    color: var(--primary-hover, #17A589);
    text-decoration: underline;
}

/* ── GeoLocation latlong.net link ──────────────────────────────── */
.geo-latlong-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary, #1ABC9C);
    text-decoration: none;
    transition: color 0.15s;
}

.geo-latlong-link:hover {
    color: var(--primary-hover, #17A589);
    text-decoration: underline;
}

/* ── Dropdown card ─────────────────────────────────────────────── */
.gp-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 9990;
    overflow: hidden;
    display: none;
    animation: gpDropIn 0.17s ease;
}

@keyframes gpDropIn {
    from { opacity: 0; transform: translateY(-7px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gp-dropdown.gp-open {
    display: block;
}

/* ── Suggestion list ───────────────────────────────────────────── */
.gp-list {
    max-height: 295px;
    overflow-y: auto;
    padding: 5px 0;
}

.gp-list::-webkit-scrollbar       { width: 4px; }
.gp-list::-webkit-scrollbar-track { background: transparent; }
.gp-list::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }

/* ── Suggestion item ───────────────────────────────────────────── */
.gp-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 9px 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.13s ease, border-color 0.13s ease;
    user-select: none;
}

.gp-item:hover,
.gp-item.gp-active {
    background: #F0FDFB;
    border-left-color: var(--theme, #09958A);
}

.gp-item.gp-selected {
    background: #E6F9F7;
    border-left-color: var(--theme, #09958A);
}

/* ── Icon circle ───────────────────────────────────────────────── */
.gp-item-icon {
    flex-shrink: 0;
    width: 33px;
    height: 33px;
    border-radius: 50%;
    background: #E6F9F7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.gp-item-icon i {
    color: var(--theme, #09958A);
    font-size: 13px;
}

/* ── Item text ─────────────────────────────────────────────────── */
.gp-item-body {
    flex: 1;
    min-width: 0;
}

.gp-item-main {
    font-size: 13.5px;
    font-weight: 600;
    color: #1A2332;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Highlighted matched portion */
.gp-item-main mark {
    background: none;
    padding: 0;
    color: var(--theme, #09958A);
    font-weight: 700;
}

.gp-item-sub {
    font-size: 11.5px;
    color: #64748B;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

/* ── Loading skeleton ──────────────────────────────────────────── */
.gp-skeleton-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
}

.gp-skeleton-icon {
    width: 33px;
    height: 33px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, #EEF2F7 25%, #E2E8F0 50%, #EEF2F7 75%);
    background-size: 200% 100%;
    animation: gpShimmer 1.4s infinite;
}

.gp-skeleton-body { flex: 1; }

.gp-skeleton-line {
    height: 9px;
    border-radius: 5px;
    margin-bottom: 5px;
    background: linear-gradient(90deg, #EEF2F7 25%, #E2E8F0 50%, #EEF2F7 75%);
    background-size: 200% 100%;
    animation: gpShimmer 1.4s infinite;
}

.gp-skeleton-line:last-child { width: 60%; margin-bottom: 0; }

@keyframes gpShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty state ───────────────────────────────────────────────── */
.gp-empty {
    padding: 26px 20px;
    text-align: center;
}

.gp-empty-icon {
    font-size: 28px;
    color: #CBD5E1;
    margin-bottom: 8px;
}

.gp-empty-title {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 3px;
}

.gp-empty-sub {
    font-size: 11.5px;
    color: #94A3B8;
    line-height: 1.5;
}

/* ── Google branding footer ────────────────────────────────────── */
.gp-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 5px 12px 7px;
    border-top: 1px solid #F1F5F9;
}

.gp-footer-label {
    font-size: 10px;
    color: #9CA3AF;
    font-style: italic;
}

.gp-footer img {
    height: 12px;
    opacity: 0.5;
    display: block;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .gp-dropdown {
        border-radius: 10px;
        left: 0;
        right: 0;
    }
    .gp-item-main { font-size: 13px; }
    .gp-item-sub  { font-size: 11px; }
}

@media (max-width: 480px) {
    .gp-item { padding: 8px 12px; gap: 9px; }
    .gp-item-icon { width: 28px; height: 28px; }
    .gp-item-icon i { font-size: 12px; }
}
