.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: none;
    z-index: 1000;
    max-height: 400px;
    overflow: hidden;
    margin-top: 1px;
    transform: translateY(-10px);
    opacity: 0;
    display: flex;
    flex-direction: column;
}
.live-search-results[style*="display: block"],
.live-search-results:not([style*="display: none"]) {
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.live-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    min-height: 45px;
    position: relative;
    transition: background-color 0.3s ease;
    flex-shrink: 0; 
}
.live-search-header.center-text {
    justify-content: center;
    text-align: center;
    border-bottom: none; 
}
.live-search-header.center-text .live-search-count {
    flex: none;
    text-align: center;
    width: 100%;
    color: #0073aa;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}
.live-search-header.clickable:hover .live-search-count {
    color: #005a87;
}
.live-search-header.clickable {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
.live-search-header.clickable:active {
    background-color: #e9ecef;
}
.live-search-count {
    font-size: 13px;
    color: #666666;
    font-weight: 500;
    flex: 1;
    text-align: right;
}
.live-search-count .counter-text {
    opacity: 0; 
    transition: opacity 0.3s ease-in-out;
    display: inline-block; 
    margin-right: 3px; 
}
.live-search-count .counter-text.is-visible {
    opacity: 1;
}
.live-search-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: absolute;
    left: 15px; 
    top: 50%;
    transform: translateY(-50%);
}
.live-search-loader.loading {
    opacity: 1;
    visibility: visible;
}
.loader-dot {
    width: 8px;
    height: 8px;
    background-color: #0073aa;
    border-radius: 50%;
    animation: dotWave 1.4s ease-in-out infinite;
    animation-play-state: paused;
    opacity: 0.7;
    transform: translateY(0) scale(1);
    transition: none;
}
.live-search-loader.loading .loader-dot {
    animation-play-state: running;
}
.live-search-loader.loading .loader-dot:nth-child(1) { animation-delay: 0s; }
.live-search-loader.loading .loader-dot:nth-child(2) { animation-delay: 0.1s; }
.live-search-loader.loading .loader-dot:nth-child(3) { animation-delay: 0.2s; }
.live-search-loader.loading .loader-dot:nth-child(4) { animation-delay: 0.3s; }

@keyframes dotWave {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
    50% { transform: translateY(-10px) scale(1.2); opacity: 1; }
}
.live-search-main-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0; 
}
.live-search-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
}
.live-search-content::-webkit-scrollbar { width: 6px; }
.live-search-content::-webkit-scrollbar-track { background: #f1f1f1; }
.live-search-content::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.live-search-content::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
.live-search-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.live-search-item:last-child { border-bottom: none; }
.live-search-item:hover { background-color: #f8f9fa; }
.live-search-item:active { background-color: #e9ecef; }

.item-title { margin-bottom: 6px; }
.item-title a { color: #0073aa; text-decoration: none; font-weight: 500; font-size: 14px; line-height: 1.4; display: block; transition: color 0.2s ease; }
.item-title a:hover { color: #005a87; text-decoration: underline; }
.item-title mark, .item-excerpt mark { background-color: #fff3cd; color: #856404; padding: 1px 2px; border-radius: 2px; font-weight: 600; }
.item-excerpt { color: #666666; font-size: 13px; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #999999; }
.item-type { background: #e9ecef; padding: 2px 8px; border-radius: 12px; font-weight: 500; }
.item-date { font-style: italic; }
.no-results, .search-error { padding: 20px 15px; text-align: center; color: #666666; font-style: italic; }
.search-error { color: #dc3545; background-color: #f8d7da; border: 1px solid #f5c6cb; margin: 10px; border-radius: 4px; }
.live-search-header.clickable .live-search-count::after { content: " ▼"; font-size: 10px; margin-right: 5px; transition: transform 0.3s ease; }
.live-search-header.clickable:hover .live-search-count::after { transform: translateY(-1px); }

@media (max-width: 768px) { .live-search-results { max-height: 300px; } }
@media (max-width: 480px) { .live-search-results { max-height: 250px; } }


.keyboard-hide-notice {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s;
}
.live-search-results {
    position: relative;
   
    --loading-animation-color: rgba(50, 150, 255, 0.75);
    --loading-animation-thickness: 2px;
    --loading-complete-color: rgba(50, 150, 255, 0.3);
    --loading-animation-speed: 1.3s;
}
.live-search-results::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 var(--loading-animation-thickness) var(--loading-animation-color);
    opacity: 0;
    pointer-events: none;
    mask-repeat: no-repeat;
}
.live-search-results.is-loading-more::after {
    opacity: 1;
    animation: trailing-gradient-down var(--loading-animation-speed) linear infinite;
}
.live-search-results.finished-loading {
    
    animation: pulse-shadow 0.8s cubic-bezier(0.4, 0, 0.6, 1);
}
@keyframes trailing-gradient-down {
    0% {
        mask: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 1%, rgba(0,0,0,0) 5%) 0 0% / 100% 400%;
        opacity: 0;
    }
    50% {
        mask: linear-gradient(to bottom, rgba(0,0,0,0) 45%, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 55%) 0 50% / 100% 400%;
        opacity: 1;
    }
    100% {
        mask: linear-gradient(to bottom, rgba(0,0,0,0) 95%, rgba(0,0,0,1) 99%, rgba(0,0,0,0) 100%) 0 100% / 100% 400%;
        opacity: 0;
    }
}
@keyframes pulse-shadow {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0);
    }
    50% {
        box-shadow: 0 8px 30px var(--loading-complete-color);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0);
    }
}
.keyboard-hide-notice-inner {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    padding: 10px;
    box-sizing: border-box;
}
.keyboard-hide-notice-inner p {
    margin: 0;
    padding: 0;
}
.keyboard-hide-notice.is-visible {
    max-height: 50px; 
    opacity: 1;
}