/**
 * Room Search Widget Styles
 * File: assets/css/room-search.css
 * 
 * Google-style search with beautiful dropdown
 */

/* ========== SEARCH CONTAINER ========== */
.rrs-room-search-widget {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.rrs-search-container {
    position: relative;
    width: 100%;
}

/* ========== SEARCH INPUT ========== */
.rrs-search-input {
    width: 100%;
    height: 56px;
    padding: 0 48px 0 48px; /* Space for icon on left, clear/spinner on right */
    font-size: 16px;
    font-weight: 400;
    color: #333;
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rrs-search-input:focus {
    border-color: #FF385C;
    box-shadow: 0 4px 12px rgba(255, 56, 92, 0.15);
}

.rrs-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

/* ========== SEARCH ICON ========== */
.rrs-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    z-index: 2;
}

.rrs-search-input:focus ~ .rrs-search-icon {
    color: #FF385C;
}

/* ========== LOADING SPINNER ========== */
.rrs-search-spinner {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.rrs-search-spinner svg {
    animation: rrs-spin 1s linear infinite;
}

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

/* ========== CLEAR BUTTON ========== */
.rrs-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #999;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 2;
}

.rrs-search-clear:hover {
    background-color: #f5f5f5;
    color: #333;
}

/* ========== RESULTS DROPDOWN ========== */
.rrs-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 1000;
    max-height: 500px;
    overflow-y: auto;
    animation: rrs-dropdown-slide 0.2s ease;
}

@keyframes rrs-dropdown-slide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar */
.rrs-search-results::-webkit-scrollbar {
    width: 8px;
}

.rrs-search-results::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.rrs-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.rrs-search-results::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ========== RESULT ITEM ========== */
.rrs-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
}

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

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

/* ========== RESULT IMAGE ========== */
.rrs-result-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.rrs-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== RESULT CONTENT ========== */
.rrs-result-content {
    flex: 1;
    min-width: 0; /* Prevent text overflow */
}

.rrs-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rrs-result-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
}

.rrs-result-location svg {
    flex-shrink: 0;
    color: #999;
}

/* ========== RESULT PRICE ========== */
.rrs-result-price {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 700;
    color: #222;
    text-align: right;
}

.rrs-result-price span {
    font-size: 12px;
    font-weight: 400;
    color: #666;
}

/* ========== NO RESULTS / LOADING ========== */
.rrs-no-results,
.rrs-loading-results {
    padding: 24px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.rrs-loading-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* ========== RESULT FOOTER ========== */
.rrs-result-footer {
    padding: 12px 16px;
    background-color: #f8f9fa;
    text-align: center;
    font-size: 13px;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
    .rrs-room-search-widget {
        max-width: 100%;
    }
    
    .rrs-search-input {
        height: 48px;
        font-size: 15px;
        padding: 0 40px 0 40px;
    }
    
    .rrs-search-icon {
        left: 12px;
        width: 18px;
        height: 18px;
    }
    
    .rrs-search-clear {
        right: 12px;
    }
    
    .rrs-result-item {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .rrs-result-image {
        width: 50px;
        height: 50px;
    }
    
    .rrs-result-title {
        font-size: 14px;
    }
    
    .rrs-result-location {
        font-size: 12px;
    }
    
    .rrs-result-price {
        font-size: 14px;
    }
}

/* ========== EDITOR PREVIEW ========== */
.rrs-editor-preview .rrs-search-input {
    cursor: not-allowed;
    opacity: 0.7;
}

.rrs-editor-preview .rrs-search-results {
    pointer-events: none;
}