/* Search Container Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: #2980b9;
}

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

/* Search Suggestions Styles */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 5px;
}

.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:active {
    background: #e9ecef;
}

.suggestion-image {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.suggestion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-info {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-type {
    font-size: 12px;
    color: #7f8c8d;
}

/* Highlight search query */
.suggestion-name mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Search form container */
#timkiem {
    position: relative;
}

.frm_timkiem {
    position: relative;
}

/* Responsive styles */
@media (max-width: 768px) {
    .search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 40px 10px 12px;
    }
    
    .search-btn {
        width: 30px;
        height: 30px;
    }
    
    .search-btn i {
        font-size: 12px;
    }
    
    .suggestion-item {
        padding: 10px 12px;
    }
    
    .suggestion-image {
        width: 35px;
        height: 35px;
        margin-right: 10px;
    }
    
    .suggestion-name {
        font-size: 13px;
    }
    
    .suggestion-type {
        font-size: 11px;
    }
}

/* Animation for suggestions */
.search-suggestions {
    animation: slideDown 0.2s ease-out;
}

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

/* Loading state */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #7f8c8d;
}

.search-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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