body {
    padding-top: 60px !important; /* Ennyi hely marad a kereső sávnak */
}

/* Header extra padding keskeny képernyőn */
@media (max-width: 1265px) {
    body > header,
    header.site-header,
    .site-header,
    #masthead {
        padding-top: 30px !important;
    }
}

/* Kereső ikon pozícionálása - FIX SÁV A TETEJÉN */
#pdf-search-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 50px; /* A sáv magassága */
    z-index: 999999;
    pointer-events: none;
    background: transparent;
}

.pdf-search-trigger {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    /* Pozícionálás a sávon belül - jobb felső sarok */
    position: absolute;
    top: 5px;
    right: 15px;
}

.pdf-search-trigger:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.pdf-search-trigger .search-icon {
    color: #333;
    transition: color 0.3s ease;
    width: 18px;
    height: 18px;
}

.pdf-search-trigger:hover .search-icon {
    color: #0073aa;
}

/* Overlay */
.pdf-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999998;
    display: none;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.pdf-search-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Keresőmező konténer */
.pdf-search-box {
    position: relative;
    max-width: 700px;
    margin: 80px auto 20px;
    padding: 0 20px;
}

#pdf-search-input {
    width: 100%;
    padding: 20px 60px 20px 25px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    outline: none;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#pdf-search-input:focus {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Bezárás gomb */
.pdf-search-close {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-search-close:hover {
    color: #333;
}

/* Keresési eredmények */
#pdf-search-results {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

#pdf-search-results::-webkit-scrollbar {
    width: 8px;
}

#pdf-search-results::-webkit-scrollbar-track {
    background: transparent;
}

#pdf-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#pdf-search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Eredmény kategóriák */
.search-category {
    margin-bottom: 30px;
}

.search-category-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-left: 10px;
    opacity: 0.7;
}

/* Eredmény elemek */
.search-result-item {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.search-result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #0073aa;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.search-result-item:hover::before {
    transform: scaleY(1);
}

.search-result-item.type-pdf::before {
    background: #dc3545;
}

/* Eredmény fejléc */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.result-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-type.type-page {
    background: #e3f2fd;
    color: #1976d2;
}

.result-type.type-post {
    background: #f3e5f5;
    color: #7b1fa2;
}

.result-type.type-pdf {
    background: #ffebee;
    color: #c62828;
}

/* Eredmény kivonat */
.result-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.result-excerpt mark {
    background: #fff59d;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Betöltés animáció */
.search-loading {
    text-align: center;
    padding: 40px;
    color: #fff;
}

.search-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Nincs találat */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #fff;
}

.no-results-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.no-results-hint {
    font-size: 14px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 50px !important; /* Mobilon is ugyanannyi */
    }
    
    #pdf-search-container {
        height: 50px;
    }
    
    .pdf-search-trigger {
        width: 38px;
        height: 38px;
        top: 6px;
        right: 10px;
    }
    
    .pdf-search-trigger .search-icon {
        width: 16px;
        height: 16px;
    }
    
    .pdf-search-box {
        margin-top: 40px;
        padding: 0 15px;
    }
    
    #pdf-search-input {
        font-size: 16px;
        padding: 18px 55px 18px 20px;
    }
    
    #pdf-search-results {
        padding: 0 15px;
    }
    
    .search-result-item {
        padding: 15px;
    }
    
    .result-title {
        font-size: 15px;
    }
    
    .result-excerpt {
        font-size: 13px;
    }
}

/* Accessibility */
.pdf-search-trigger:focus,
#pdf-search-input:focus,
.pdf-search-close:focus,
.search-result-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Dark mode támogatás */
@media (prefers-color-scheme: dark) {
    .pdf-search-trigger {
        background: rgba(30, 30, 30, 0.95);
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
    
    .pdf-search-trigger:hover {
        background: rgba(45, 45, 45, 0.95);
    }
    
    .pdf-search-trigger .search-icon {
        color: #fff;
    }
}