/* Search Icon in Header */
.header-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    margin: 0 10px;
}

.header-search-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-search-icon img,
.header-search-icon svg {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Make icon white */
}

/* Search Modal Overlay */
.search-modal-overlay {
    position: fixed;
    top: -100vh;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: top 0.5s ease-in-out ;
}

.search-modal-overlay.show {
    top :0 
   
}

/* Search Modal Content */
.search-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    position: relative;
}

.search-modal-overlay.show .search-modal-content {
    transform: translateY(0);
}

/* Close Button */
.search-modal-close {
    position: absolute;
    top: 4px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.search-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Modal Title */
.search-modal-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    direction: rtl;
}

/* Custom Search Styles for Modal */
.search-modal-content .custom-search-wrapper {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Custom Search Styles */
.custom-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Modal specific search styling */
.search-modal-content .search-input-container {
    border: 2px solid #007cba;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.2);
}

.search-modal-content .search-input {
    font-size: 18px;
    padding: 15px 25px;
}

.search-modal-content .search-button {
    padding: 15px 20px;
}

.search-modal-content .search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    max-height: 350px;
    overflow-y: auto;
    z-index: 10000;
}

/* Search Advanced Page Styles */
.search-advanced-bar-container {
    margin-bottom: 30px;
    padding: 20px 0;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.search-advanced-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.search-advanced-wrapper .custom-search-wrapper {
    position: relative;
    max-width: none;
    width: 100%;
}

.search-advanced-input-container {
    border: 2px solid #007cba !important;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.15) !important;
    background: white;
    transition: box-shadow 0.3s ease;
}

.search-advanced-input-container:focus-within {
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.25) !important;
    border-color: #005a87 !important;
}

.search-advanced-wrapper .search-input {
    font-size: 18px;
    padding: 18px 25px;
}

.search-advanced-wrapper .search-button {
    padding: 18px 25px;
    background: #007cba;
    transition: all 0.3s ease;
}

.search-advanced-wrapper .search-button:hover {
    background: #005a87;
    transform: translateX(-2px);
}

/* Search Advanced Dropdown Styles */
.search-advanced-wrapper .search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #007cba;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: -2px;
}

.search-advanced-wrapper .search-results {
    max-height: 350px;
    overflow-y: auto;
}

.search-advanced-wrapper .search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: right;
    direction: rtl;
}

.search-advanced-wrapper .search-result-item:hover {
    background-color: #f0f7ff;
}

.search-advanced-wrapper .search-result-item:last-child {
    border-bottom: none;
}

.search-advanced-wrapper .result-type {
    font-size: 13px;
    color: #007cba;
    margin-bottom: 5px;
    font-weight: 600;
}

.search-advanced-wrapper .result-title {
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

/* RTL Support for Search Advanced */
[dir="rtl"] .search-advanced-wrapper .search-button:hover {
    transform: translateX(2px);
}

/* Prevent body scroll when modal is open */
body.search-modal-open {
    overflow: hidden;
}

/* Terms List Styling */
.terms-list-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.terms-list-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    direction: rtl;
}

.terms-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.term-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    direction: rtl;
}

.term-item:hover {
    background: var(--color-primary);
    color: white;
    border-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--color-primary);
}

.term-name {
    font-size: 14px;
    font-weight: 500;
    display: block;
}

/* Responsive terms list */
@media (max-width: 768px) {
    .terms-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .term-item {
        padding: 10px 12px;
    }
    
    .term-name {
        font-size: 13px;
    }
}

/* Scrollbar for terms list */
.terms-list::-webkit-scrollbar {
    width: 6px;
}

.terms-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.terms-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.terms-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    direction: rtl; /* For Arabic text */
}

.search-input::placeholder {
    color: #999;
    direction: rtl;
}

.search-button {
    background: #007cba;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: #005a87;
}

.search-button img,
.search-button i {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1); /* Make icon white */
}

.search-button i {
    color: white;
    font-size: 20px;
    width: auto;
    height: auto;
    filter: none;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: right;
    direction: rtl;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-type {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.result-title {
    font-size: 14px;
    color: #333;
    line-height: 1.3;
}

.category-item {
    padding: 15px;
    background: #f0f0f0;
    border-top: 2px solid #007cba;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    font-weight: 600;
    color: #333;
}

.category-item:hover {
    background: #e0e0e0;
}

.category-text {
    display: block;
    font-size: 16px;
}

.no-results,
.loading,
.error-message,
.short-query {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    direction: rtl;
}

.loading {
    color: #007cba;
    font-weight: 500;
}

.error-message {
    color: #d32f2f;
    background-color: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    margin: 5px;
}

.short-query {
    color: #ff9800;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-search-wrapper {
        max-width: 100%;
        margin: 0;
    }
    
    .search-input {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .search-button {
        padding: 10px 12px;
    }
    
    .search-button img {
        width: 18px;
        height: 18px;
    }
    
    .search-advanced-wrapper .search-input {
        font-size: 16px;
        padding: 14px 20px;
    }
    
    .search-advanced-wrapper .search-button {
        padding: 14px 18px;
    }
}

/* RTL Support */
/* [dir="rtl"] .search-input-container {
    flex-direction: row-reverse;
} */

[dir="rtl"] .search-input {
    text-align: right;
}

/* Scrollbar Styling */
.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


#search-submit-btn 
{
    height: 100%;
    min-height: 65px;
    display: flex;
    background: var(--color-primary);
}

#search-submit-btn svg 
{
    color: #fff;
}