/* Live Search Styles */

/* Search Popup Container */
.navbar-search-popup {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-width: 90vw;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    margin-top: 10px;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.navbar-search-popup.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Search Form */
.navbar-search-form {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.navbar-search-form .search-form {
    position: relative;
    display: flex;
    gap: 5px;
}

.navbar-search-form .search-field {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.navbar-search-form .search-field:focus {
    border-color: #fa897b;
}

.navbar-search-form .search-submit {
    padding: 10px 20px;
    background: #fa897b;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.navbar-search-form .search-submit:hover {
    background: #f96b5a;
}

/* Loading Animation */
.live-search-animation {
    display: none;
    padding: 20px;
    text-align: center;
}

.live-search-animation:before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #fa897b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Results Container */
.navbar-search-response {
    display: none;
    max-height: 500px;
    overflow-y: auto;
}

.live-search-results {
    padding: 10px;
}

/* Search Result Item */
.live-search-item {
    margin-bottom: 5px;
    border-bottom: 1px solid #f5f5f5;
}

.live-search-item:last-of-type {
    border-bottom: none;
}

.live-search-link {
    display: flex;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 5px;
    transition: background 0.3s;
}

.live-search-link:hover {
    background: #f9f9f9;
}

.live-search-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
}

.live-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-search-content {
    flex: 1;
    min-width: 0;
}

.live-search-title {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 600;
    color: #242424;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.live-search-excerpt {
    margin: 0 0 5px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.live-search-date {
    font-size: 11px;
    color: #999;
}

/* Footer with "View All" Link */
.live-search-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    text-align: center;
}

.live-search-view-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    background: #fa897b;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
}

.live-search-view-all:hover {
    background: #f96b5a;
}

/* No Results */
.live-search-no-results,
.live-search-error {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.live-search-no-results p,
.live-search-error p {
    margin: 0;
    font-size: 14px;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .navbar-search-popup {
        width: 100%;
        max-width: 100%;
        right: auto;
        left: 0;
        border-radius: 0 0 8px 8px;
        position: fixed;
        top: auto;
        margin-top: 0;
    }

    .mobile-search .navbar-search-popup {
        top: 60px; /* Adjust based on mobile header height */
    }

    .live-search-thumb {
        width: 60px;
        height: 60px;
    }

    .live-search-title {
        font-size: 13px;
    }

    .live-search-excerpt {
        font-size: 11px;
    }
}

/* Detailed Search Results Page */
.search-results-page {
    padding: 30px 0;
}

.search-results-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f5f5f5;
}

.search-results-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    color: #242424;
}

.search-results-count {
    font-size: 14px;
    color: #666;
}

.search-results-keyword {
    color: #fa897b;
    font-weight: 600;
}

/* Search Form on Results Page */
.search-results-form-wrapper {
    margin: 20px 0;
}

.search-results-form {
    max-width: 600px;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 8px;
    border: 2px solid #e5e5e5;
    transition: border-color 0.3s;
}

.search-input-wrapper:focus-within {
    border-color: #fa897b;
    background: #fff;
}

.search-results-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    color: #242424;
}

.search-results-input::placeholder {
    color: #999;
}

.search-results-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: #fa897b;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-results-submit:hover {
    background: #f96b5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(250, 137, 123, 0.3);
}

.search-results-submit i {
    font-size: 16px;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.search-result-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.search-result-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-result-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.search-result-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    padding: 20px;
}

.search-result-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: #242424;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-excerpt {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.search-result-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-result-category {
    color: #fa897b;
    font-weight: 600;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.search-pagination a,
.search-pagination span.current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #242424;
    font-weight: 600;
    transition: all 0.3s;
}

.search-pagination a:hover {
    background: #fa897b;
    border-color: #fa897b;
    color: #fff;
}

.search-pagination span.current {
    background: #fa897b;
    border-color: #fa897b;
    color: #fff;
}

.search-pagination .prev,
.search-pagination .next {
    font-size: 18px;
}

/* No Results on Details Page */
.search-no-results {
    padding: 60px 20px;
    text-align: center;
}

.search-no-results-icon {
    font-size: 60px;
    color: #ddd;
    margin-bottom: 20px;
}

.search-no-results-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: #242424;
}

.search-no-results-text {
    margin: 0 0 20px;
    font-size: 16px;
    color: #666;
}

.search-back-home {
    display: inline-block;
    padding: 12px 30px;
    background: #fa897b;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s;
}

.search-back-home:hover {
    background: #f96b5a;
}

/* Mobile Responsive for Details Page */
@media (max-width: 768px) {
    .search-results-title {
        font-size: 22px;
    }
    
    .search-results-form {
        max-width: 100%;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-results-submit {
        width: 100%;
        justify-content: center;
        padding: 14px 25px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .search-result-title {
        font-size: 16px;
    }

    .search-result-excerpt {
        font-size: 13px;
    }

    .search-pagination a,
    .search-pagination span.current {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        font-size: 14px;
    }
}


.search-input-wrapper {
  display: flex;
  justify-content: center;
}
