/* Google Places Autocomplete Styles */

/* Base autocomplete input styles */
.autocomplete-input {
    position: relative;
}

/* Loading state */
.autocomplete-loading {
    background-image: linear-gradient(90deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(90deg, transparent 50%, #f0f0f0 50%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 0;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: -20px 0, -10px 0;
    }
    100% {
        background-position: 20px 0, 10px 0;
    }
}

/* Loading spinner */
.autocomplete-spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
    z-index: 10;
}

.autocomplete-spinner i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.autocomplete-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.autocomplete-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Success state */
.autocomplete-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Google Places dropdown customization */
.pac-container {
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    z-index: 1051; /* Above Bootstrap modals */
}

/* New PlaceAutocompleteElement styles */
.place-autocomplete-container {
    position: relative;
    width: 100%;
}

.place-autocomplete-container gmp-place-autocomplete {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
}

.place-autocomplete-container gmp-place-autocomplete:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.pac-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    line-height: 1.4;
}

.pac-item:last-child {
    border-bottom: none;
}

.pac-item:hover {
    background-color: #f8f9fa;
}

.pac-item-selected {
    background-color: #e9ecef;
}

.pac-item-query {
    font-weight: bold;
    color: #007bff;
}

.pac-matched {
    font-weight: bold;
}

/* Place details in dropdown */
.pac-item .pac-icon {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.pac-item .pac-item-query {
    color: #333;
}

/* Hotel specific styling */
.hotel-autocomplete .pac-item {
    display: flex;
    align-items: center;
}

.hotel-autocomplete .pac-item .pac-icon {
    color: #28a745;
}

/* Rating display in dropdown */
.autocomplete-rating {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    font-size: 12px;
    color: #ffc107;
}

.autocomplete-rating .star {
    margin-right: 2px;
}

.autocomplete-rating .rating-text {
    color: #666;
    margin-left: 4px;
}

/* Address styling */
.autocomplete-address {
    color: #666;
    font-size: 12px;
    margin-top: 2px;
}

/* Price level indicator */
.autocomplete-price-level {
    margin-left: 8px;
    font-size: 12px;
    color: #28a745;
}

/* Selected place info display */
.selected-place-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.selected-place-info .place-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.selected-place-info .place-address {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.selected-place-info .place-details {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.selected-place-info .place-rating,
.selected-place-info .place-price {
    display: flex;
    align-items: center;
}

.selected-place-info .place-rating .stars {
    color: #ffc107;
    margin-right: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pac-container {
        width: calc(100vw - 40px) !important;
        max-width: none !important;
    }

    .selected-place-info .place-details {
        flex-direction: column;
        gap: 5px;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .pac-container {
        background-color: #bfbfbf;
        border-color: #495057;
        color: #acacac;
    }

    .pac-item:hover {
        background-color: #495057;
    }

    .pac-item-selected {
        background-color: #6c757d;
    }

    .pac-item-query {
        color: #007bff;
    }

    .autocomplete-address {
        color: #adb5bd;
    }

    .selected-place-info {
        background-color: #343a40;
        border-color: #495057;
        color: #fff;
    }

    .selected-place-info .place-name {
        color: #fff;
    }

    .selected-place-info .place-address {
        color: #adb5bd;
    }

    .selected-place-info .place-details {
        color: #adb5bd;
    }
}

/* Accessibility improvements */
.pac-container .pac-item[aria-selected="true"] {
    background-color: #e9ecef;
}

.autocomplete-input input[aria-expanded="true"] {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Focus management */
.autocomplete-input input:focus + .pac-container {
    display: block;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pac-container {
        border: 2px solid #000;
    }

    .pac-item {
        border-bottom: 2px solid #000;
    }

    .pac-item:hover,
    .pac-item-selected {
        background-color: #000;
        color: #fff;
    }
}

/* Selected place details styles */
.selected-place-details {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.selected-place-details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107);
}

.selected-place-details .place-website,
.selected-place-details .place-phone {
    margin-bottom: 15px;
    font-size: 14px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-place-details .place-website i,
.selected-place-details .place-phone i {
    color: #007bff;
    width: 16px;
}

.selected-place-details .place-website a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.selected-place-details .place-website a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.selected-place-details .place-photos-carousel {
    margin-top: 20px;
}

.selected-place-details .place-photos-carousel h4 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-place-details .place-photos-carousel h4::before {
    content: '📸';
    font-size: 18px;
}

.photo-carousel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.photo-carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

.photo-carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
}

.photo-carousel-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.photo-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.photo-carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.photo-carousel-btn i {
    color: #333;
    font-size: 16px;
}

.photo-carousel-prev {
    left: 15px;
}

.photo-carousel-next {
    right: 15px;
}

.photo-carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.photo-carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-carousel-indicator.active {
    background: white;
    transform: scale(1.2);
}

.photo-carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Responsive carousel */
@media (max-width: 768px) {
    .photo-carousel-container {
        max-width: 100%;
    }

    .photo-carousel-image {
        height: 250px;
    }

    .photo-carousel-btn {
        width: 35px;
        height: 35px;
    }

    .photo-carousel-btn i {
        font-size: 14px;
    }
}
