/**
 * PicBlick - Suchfeld-Styling
 */

/* Suchcontainer mit Positionierung für Ergebnisse */
.search-container {
    position: relative;
}

/* Ergebniscontainer */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 450px;
    overflow-y: auto;
    background-color: #24283b;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1010;
    border: 1px solid var(--header-border);
    padding: 4px;
    display: none;
    animation: resultsFade 0.2s ease;
}

/* Animation für Ergebnisse */
@keyframes resultsFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lade-Animation */
.search-loading {
    padding: 16px;
    text-align: center;
    color: var(--header-text);
    font-size: 0.9rem;
    font-style: italic;
}

/* Keine Ergebnisse */
.no-results {
    padding: 16px;
    text-align: center;
    color: var(--header-text);
    font-size: 0.9rem;
}

/* Fehlermeldung */
.search-error {
    padding: 16px;
    text-align: center;
    color: #ff6b6b;
    font-size: 0.9rem;
}

/* Ergebniselement */
.result-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--header-text);
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.result-item:hover {
    background-color: rgba(122, 162, 247, 0.15);
}

.result-item:last-child {
    margin-bottom: 0;
}

/* Thumbnail für Ergebnisse */
.result-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.05);
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ergebnisinformationen */
.result-info {
    flex-grow: 1;
    margin-left: 12px;
    overflow: hidden;
}

.result-title {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-description {
    font-size: 0.8rem;
    color: #787c99;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge für öffentliche Alben */
.result-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(122, 162, 247, 0.2);
    color: var(--header-text-active);
    margin-left: 8px;
    white-space: nowrap;
}

/* Scrollbar für Ergebnisliste */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Hellmodus Anpassungen */
@media (prefers-color-scheme: light) {
    .search-results {
        background-color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .result-description {
        color: #6b6d7d;
    }
    
    .result-item:hover {
        background-color: rgba(61, 89, 161, 0.1);
    }
    
    .result-badge {
        background-color: rgba(61, 89, 161, 0.15);
        color: var(--header-text-active);
    }
    
    .search-results::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .search-results::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.15);
    }
    
    .search-results::-webkit-scrollbar-thumb:hover {
        background-color: rgba(0, 0, 0, 0.25);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-results {
        width: 100%;
        left: 0;
        right: 0;
        top: calc(100% + 10px);
        max-height: 350px;
    }
}