/* ========================================
   KARLS ADDRESS AUTOCOMPLETE STYLING
   Beautiful Google Places Integration
   ======================================== */

/* ========================================
   AUTOCOMPLETE INPUT
   ======================================== */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-input {
    width: 100%;
    padding: 14px 50px 14px 16px;
    border: 2px solid #79b51c;
    border-radius: 12px;
    font-family: 'Arnet-Regular', sans-serif;
    font-size: 1rem;
    background: #f5f8f0;
    color: #18232f;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(121, 181, 28, 0.1);
}

.autocomplete-input:focus {
    outline: none;
    border-color: #79b51c;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(121, 181, 28, 0.2);
    transform: translateY(-2px);
}

.autocomplete-input::placeholder {
    color: #5a6677;
    opacity: 0.7;
}

.autocomplete-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #79b51c;
    pointer-events: none;
    transition: all 0.3s ease;
}

.autocomplete-loading {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.autocomplete-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   GOOGLE PLACES DROPDOWN STYLING
   ======================================== */

/* Container */
.pac-container {
    background: #ffffff;
    border: 2px solid #79b51c !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    margin-top: 8px !important;
    padding: 8px 0 !important;
    font-family: 'Arnet-Regular', sans-serif !important;
    z-index: 9999 !important;
}

.pac-container:after {
    display: none !important;
}

/* Individual suggestion items */
.pac-item {
    padding: 12px 16px !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
    font-family: 'Arnet-Regular', sans-serif !important;
    font-size: 0.95rem !important;
}

.pac-item:hover,
.pac-item-selected {
    background: #f5f8f0 !important;
}

/* Icon in suggestions */
.pac-icon {
    background-image: none !important;
    margin-top: 0 !important;
    width: 24px !important;
    height: 24px !important;
    margin-right: 12px !important;
}

.pac-icon:before {
    content: "📍";
    font-size: 18px;
    line-height: 24px;
}

/* Main text (street) */
.pac-item-query {
    font-family: 'Arnet-Bold', sans-serif !important;
    color: #18232f !important;
    font-size: 1rem !important;
    padding-right: 8px !important;
}

/* Secondary text (city, etc) */
.pac-item span {
    color: #5a6677 !important;
    font-size: 0.9rem !important;
}

.pac-matched {
    color: #79b51c !important;
    font-weight: 600 !important;
}

/* Logo */
.pac-logo:after,
.hdpi.pac-logo:after {
    display: none !important;
}

/* ========================================
   SECTION SUBTITLE
   ======================================== */
.section-subtitle {
    font-family: 'Arnet-Regular', sans-serif;
    font-size: 0.95rem;
    color: #5a6677;
    margin-top: 8px;
}

/* ========================================
   LABEL HINT
   ======================================== */
.label-hint {
    font-family: 'Arnet-Regular', sans-serif;
    font-size: 0.85rem;
    color: #79b51c;
    font-weight: normal;
    margin-left: 6px;
}

/* ========================================
   ADDRESS DIVIDER
   ======================================== */
.address-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #5a6677;
    font-family: 'Arnet-Regular', sans-serif;
    font-size: 0.9rem;
}

.address-divider::before,
.address-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e0e7ed;
}

.address-divider span {
    padding: 0 16px;
}

/* ========================================
   FIELD WRAPPER WITH CHECKMARK
   ======================================== */
.address-field-wrapper {
    position: relative;
}

.field-checkmark {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #79b51c;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

/* Field filling animation */
.field-filling {
    animation: fieldHighlight 0.6s ease;
}

@keyframes fieldHighlight {
    0% {
        background: transparent;
    }
    50% {
        background: rgba(121, 181, 28, 0.1);
        border-radius: 12px;
    }
    100% {
        background: transparent;
    }
}

/* ========================================
   SUCCESS MESSAGE
   ======================================== */
.address-success-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #79b51c;
    color: #ffffff;
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Arnet-Regular', sans-serif;
    animation: slideDown 0.4s ease;
    box-shadow: 0 4px 12px rgba(121, 181, 28, 0.3);
    transition: opacity 0.3s ease;
}

.address-success-message svg {
    flex-shrink: 0;
}

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

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .autocomplete-input {
        padding: 12px 50px 12px 14px;
        font-size: 0.95rem;
    }

    .pac-item {
        padding: 10px 14px !important;
        font-size: 0.9rem !important;
    }

    .pac-item-query {
        font-size: 0.95rem !important;
    }

    .pac-item span {
        font-size: 0.85rem !important;
    }

    .address-divider {
        margin: 20px 0;
        font-size: 0.85rem;
    }

    .field-checkmark {
        font-size: 1.3rem;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .autocomplete-input {
        padding: 10px 45px 10px 12px;
        font-size: 0.9rem;
    }

    .autocomplete-icon {
        right: 12px;
    }

    .autocomplete-icon svg,
    .autocomplete-loading svg {
        width: 18px;
        height: 18px;
    }

    .pac-container {
        margin-top: 6px !important;
    }

    .pac-item {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }

    .pac-icon {
        width: 20px !important;
        height: 20px !important;
        margin-right: 10px !important;
    }

    .pac-icon:before {
        font-size: 16px;
    }

    .label-hint {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }

    .address-success-message {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}