/* Search Overlay Styles */

.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: flex-start;
    padding-top: 80px;
}

.search-overlay.active {
    display: flex;
}

.search-overlay-inner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.search-overlay-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    padding: 10px 8px;
    color: #333;
    background: transparent;
    font-family: inherit;
}

.search-input::placeholder {
    color: #aaa;
}

.search-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #999;
    font-size: 18px;
    line-height: 1;
}

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

.search-result {
    max-height: 400px;
    overflow-y: auto;
}

.search-result a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.search-result a:hover {
    background: #f9f9f9;
    color: #3199db;
}

.search-result a .result-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.search-result a .result-excerpt {
    display: block;
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result a .result-date {
    display: inline-block;
    font-size: 12px;
    color: #bbb;
    margin-right: 8px;
}

.search-hint {
    padding: 16px 20px;
    font-size: 13px;
    color: #bbb;
    text-align: center;
    border-top: 1px solid #f5f5f5;
}

/* Night mode support */
body.night-mode .search-overlay-inner {
    background: #1e1e1e;
}

body.night-mode .search-overlay-header {
    border-color: #333;
}

body.night-mode .search-input {
    color: #e0e0e0;
}

body.night-mode .search-result a {
    color: #e0e0e0;
    border-color: #2a2a2a;
}

body.night-mode .search-result a:hover {
    background: #2a2a2a;
}

body.night-mode .search-hint {
    color: #666;
    border-color: #2a2a2a;
}

/* Search toggle button in header */
.nav-search {
    list-style: none !important;
}

.nav-search a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    transition: color 0.2s;
    text-decoration: none;
}

.nav-search a:hover {
    color: #fff;
}

body.night-mode .headerDown .nav-search a {
    color: #666;
}

body.night-mode .headerDown .nav-search a:hover {
    color: #333;
}

.search-toggle:hover {
    color: #fff;
}

body.night-mode .headerDown .search-toggle {
    color: #666;
}

body.night-mode .headerDown .search-toggle:hover {
    color: #333;
}

/* Mobile */
@media (max-width: 695px) {
    .search-overlay {
        padding-top: 20px;
    }

    .search-overlay-inner {
        margin: 0 12px;
        border-radius: 4px;
    }

    .search-toggle {
        right: 46px;
    }
}
