/**
 * Trip Enhancements Styles
 */

/* Discount Badge */
.hme-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: badge-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.hme-discount-badge svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 12px rgba(255, 107, 107, 0.5);
    }
}

/* Location Filter */
.hme-location-filter {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    font-family: 'Cairo', sans-serif;
}

.hme-location-filter > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 200px;
}

.hme-location-filter label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 0;
}

.hme-location-filter select,
.hme-location-search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Cairo', sans-serif;
}

.hme-location-filter select:hover,
.hme-location-search-input:hover {
    border-color: #d4af37;
}

.hme-location-filter select:focus,
.hme-location-search-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.hme-location-search-wrapper {
    position: relative;
}

.hme-location-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hme-location-result-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.hme-location-result-item:hover {
    background-color: #f8f9fa;
}

.hme-location-result-item:last-child {
    border-bottom: none;
}

.hme-location-no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.hme-clear-filters {
    padding: 10px 20px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    align-self: flex-end;
    margin-top: 20px;
}

.hme-clear-filters:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Loading Indicator */
.hme-loading {
    display: none;
    text-align: center;
    padding: 40px 20px;
    margin: 20px 0;
}

.hme-loading.active {
    display: block;
}

.hme-loading.complete {
    display: block;
}

.hme-loading p {
    margin-top: 15px;
    font-size: 16px;
    color: #666;
}

.hme-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hme-location-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hme-location-filter select {
        width: 100%;
        min-width: auto;
    }

    .hme-discount-badge {
        font-size: 11px;
        padding: 5px 10px;
    }

    .hme-discount-badge svg {
        width: 14px;
        height: 14px;
    }
}

/* Grid and List View Compatibility */
.trip-grid-view .hme-discount-badge,
.trip-list-view .hme-discount-badge {
    display: inline-flex;
}

/* Trip Card Enhancements */
.wte-trip-item .hme-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Ensure badge is visible in both layouts */
.grid-view .hme-discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
}

.list-view .hme-discount-badge {
    margin-top: 10px;
}

/* Location Search Enhancements */
.hme-location-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.hme-location-search-wrapper {
    position: relative;
}

.hme-location-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hme-location-result-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.hme-location-result-item:hover {
    background: #f5f5f5;
}

.hme-location-no-results {
    padding: 10px 15px;
    color: #888;
    font-style: italic;
}

/* Distance Badge */
.hme-distance-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 5;
}

.hme-distance-sorting {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Enhanced Select2 styling for location */
.select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    padding-left: 15px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 10px;
}

/* Hide pagination (replaced by infinite scroll) */
.wte-pagination,
.pagination,
.archive-pagination,
.trip-pagination {
    display: none !important;
}

/* Lazy loading for trip images */
.trip-item img,
.wte-trip-item img,
.trip-card img {
    transition: opacity 0.3s;
}

.trip-item img[loading="lazy"] {
    opacity: 0.7;
}

.trip-item img.loaded {
    opacity: 1;
}