/* Header Search Styles */
.header-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.search-icon-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}


.search-icon-trigger svg {
    stroke: #fff;
    transition: stroke 0.3s ease;
}

.search-icon-trigger:hover svg {
    stroke: #ddd;
}

.search-input-container {
    position: relative;
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
}

.search-input-container.expanded {
    width: 300px;
    margin-left: 10px;
}

.header-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.header-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-close-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.search-close-btn svg {
    stroke: rgba(255, 255, 255, 0.7);
    transition: stroke 0.3s ease;
}

.search-close-btn:hover svg {
    stroke: #fff;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.search-results-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-results-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-results-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-results-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.search-loading,
.search-no-results,
.search-error {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-error {
    color: #d32f2f;
}

.search-results-list {
    padding: 10px;
}

.search-result-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    margin-bottom: 8px;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-image {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-excerpt {
    font-size: 12px;
    color: #666;
    margin: 0 0 5px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-date {
    font-size: 11px;
    color: #999;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .search-input-container.expanded {
        width: 250px;
    }
    
    .search-results-dropdown {
        width: 100vw;
        max-width: 350px;
        right: -20px;
    }
    
    .search-result-image {
        width: 60px;
        height: 45px;
    }
    
    .search-result-title {
        font-size: 13px;
    }
    
    .search-result-excerpt {
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    .header-search-wrapper {
        margin-right: 10px;
    }
    
    .search-input-container.expanded {
        width: 200px;
    }
    
    .search-results-dropdown {
        max-width: 300px;
    }
}

/* Search Page Results */
.search-results-page .news-heading span {
    color: #444;
    font-weight: 700;
}

.search-results-page .news-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 15px 0;
}

.search-results-page .news-date {
    font-size: 13px;
    color: #999;
}

.search-results-page .no-results {
    padding: 50px 0;
    text-align: center;
}

.search-results-page .admin-only-notice {
    text-align: center;
    padding: 100px 20px;
}

.search-results-page .admin-only-notice h1 {
    margin-bottom: 20px;
}
