/* ================================================================
   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: none !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;
    }
}
