/**
 * SADE AUTOCOMPLETE CSS + UZMANLIK BADGE
 */

/* Parent container */
.search-container {
    position: relative !important;
}

/* Dropdown styling */
.search-container .autocomplete-dropdown {
    position: absolute !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    border: 1px solid #297cbb !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(41, 124, 187, 0.2) !important;
    z-index: 99999 !important;
    display: none !important;
    max-height: 300px !important;
    overflow: hidden !important;
}

.search-container .autocomplete-dropdown.show {
    display: block !important;
}

.autocomplete-list {
    max-height: 250px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.autocomplete-item {
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    background: white;
    min-height: 80px;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f8f9fa;
    border-left: 3px solid #297cbb;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

/* Görsel alanı - BÜYÜTÜLDÜ */
.autocomplete-image {
    width: 60px;
    height: 60px;
    margin-right: 16px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.autocomplete-item:hover .autocomplete-thumb {
    transform: scale(1.05);
}

.autocomplete-icon {
    width: 18px;
    margin-left: 10px;
    text-align: center;
    color: #6c757d;
    font-size: 12px;
    flex-shrink: 0;
}

.autocomplete-content {
    flex: 1;
    min-width: 0;
}

.autocomplete-text {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    line-height: 1.3;
}

/* Yazar bilgisi + Uzmanlık Badge + İstatistikler */
.autocomplete-author {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
    text-align: center;
}

/* Yazar adı ve badge yan yana - ortalanmış */
.author-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.author-main i {
    color: #297cbb;
    font-size: 11px;
}

.author-name {
    font-weight: 500;
    color: #495057;
}

/* Uzmanlık Badge */
.expert-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    border: none;
}

/* İstatistikler - ortalanmış */
.author-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.stat-item {
    font-size: 10px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f8f9fa;
    padding: 1px 4px;
    border-radius: 4px;
}

.stat-item i {
    font-size: 9px;
}

/* Uzman tipine göre farklı renkler */
.expert-badge[data-type="travel_expert"] {
    background: #007bff;
    color: white;
}

.expert-badge[data-type="cultural_expert"] {
    background: #28a745;
    color: white;
}

.expert-badge[data-type="local_blogger"] {
    background: #ffc107;
    color: #212529;
}

.expert-badge[data-type="archaeologist"] {
    background: #6f42c1;
    color: white;
}

.expert-badge[data-type="gastronomy_expert"] {
    background: #dc3545;
    color: white;
}

.expert-badge[data-type="nature_guide"] {
    background: #20c997;
    color: white;
}

.expert-badge[data-type="historian"] {
    background: #6c757d;
    color: white;
}

.expert-badge[data-type="faith_tourism_expert"] {
    background: #fd7e14;
    color: white;
}

.autocomplete-highlight {
    background: #fff3cd;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
}

.autocomplete-footer {
    padding: 6px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    font-size: 11px;
}

.autocomplete-loading {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

.autocomplete-no-results {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 13px;
}

/* Input hover'ı devre dışı bırak */
.search-container:has(.autocomplete-dropdown.show) .input-group {
    transform: none !important;
}

/* Lucky button'ı dropdown açıkken alta it */
.search-container:has(.autocomplete-dropdown.show) ~ div {
    margin-top: 350px !important;
    transition: margin-top 0.3s ease !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-container .autocomplete-dropdown {
        left: -5px !important;
        right: -5px !important;
        box-shadow: 0 4px 15px rgba(41, 124, 187, 0.15) !important;
    }
    
    .autocomplete-item {
        padding: 12px;
        min-height: 70px;
    }
    
    .autocomplete-text {
        font-size: 13px;
    }
    
    .autocomplete-author {
        font-size: 11px;
    }
    
    .expert-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}