/* Search Modal - Full Screen Dark Theme with Golden Glow */

/* Modal Overlay - Full Screen Dark Background */
.search_modal_overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2147483647;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.search_modal_overlay.active {
    display: flex;
    opacity: 1;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

/* Modal Container */
.search_modal_container {
    width: 100%;
    max-width: 800px;
    background: rgba(21, 20, 20, 0.98);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(191, 149, 63, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(191, 149, 63, 0.1);
    padding: 40px;
    position: relative;
    margin-top: 0;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search_modal_overlay.active .search_modal_container {
    transform: translateY(0);
}

/* Close Button */
.search_modal_close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(191, 149, 63, 0.2);
    cursor: pointer;
    z-index: 10;
}

.search_modal_close:hover {
    color: #BF953F;
    background: rgba(191, 149, 63, 0.1);
    border-color: rgba(191, 149, 63, 0.4);
    transform: rotate(90deg);
    box-shadow: 0 0 20px rgba(191, 149, 63, 0.3);
}

/* Search Input Container */
.search_modal_input_wrap {
    position: relative;
    margin-bottom: 30px;
}

.search_modal_input {
    width: 100%;
    padding: 28px 60px 28px 20px;
    font-size: 24px !important;
    font-weight: 400;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(191, 149, 63, 0.2);
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    min-height: 80px;
    box-sizing: border-box;
    padding-left: 20px !important;
}

.search_modal_input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    padding-left: 20px !important;
}

.search_modal_input:focus {
    border-color: rgba(191, 149, 63, 0.8);
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 4px rgba(191, 149, 63, 0.1),
        0 0 30px rgba(191, 149, 63, 0.2),
        inset 0 0 20px rgba(191, 149, 63, 0.05);
}

/* Search Icon in Input */
.search_modal_input_icon {
    display: none !important;
}

/* Results Container */
.search_modal_results {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden !important;
    margin-top: 20px;
    padding-right: 10px;
}

.search_modal_results::-webkit-scrollbar {
    width: 10px;
}

.search_modal_results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.search_modal_results::-webkit-scrollbar-thumb {
    background: rgba(191, 149, 63, 0.3);
    border-radius: 5px;
}

.search_modal_results::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 149, 63, 0.5);
}

/* Result Items */
.search_result_item {
    margin-bottom: 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.search_result_item:last-child {
    margin-bottom: 0;
}

.search_result_item:hover,
.search_result_item.selected {
    background-color: rgba(191, 149, 63, 0.1);
    border-color: rgba(191, 149, 63, 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(191, 149, 63, 0.15);
}

.search_result_link {
    display: block;
    padding: 18px 20px;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease;
    border-radius: 10px;
}

.search_result_link:hover {
    color: #fff;
    text-decoration: none;
}

.search_result_header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.search_result_badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    background: rgba(191, 149, 63, 0.2);
    color: #BF953F;
    border: 1px solid rgba(191, 149, 63, 0.3);
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.search_result_title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0;
    color: #DFBE6A;
    line-height: 1.4;
    font-family: 'Cairo', sans-serif;
    flex: 1;
    min-width: 0;
}

.search_result_title mark {
    background-color: rgba(223, 190, 106, 0.4);
    color: #DFBE6A;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.search_result_excerpt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search_result_excerpt mark {
    background-color: rgba(223, 190, 106, 0.25);
    color: #DFBE6A;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Loading, No Results, Error States */
.search_result_loading,
.search_result_no_results,
.search_result_error {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.search_result_error {
    color: rgba(255, 100, 100, 0.9);
}

/* Keyboard Shortcut Hint */
.search_modal_hint {
    display: none !important;
}

.search_modal_hint_kbd {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search_modal_overlay.active {
        padding-top: 5vh;
        padding-left: 15px;
        padding-right: 15px;
        padding-bottom: 15px;
    }

    .search_modal_container {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .search_modal_input {
        font-size: 18px;
        padding: 16px 50px 16px 20px;
    }

    .search_modal_input_icon {
        font-size: 20px;
        right: 16px;
    }

    .search_modal_close {
        width: 36px;
        height: 36px;
        top: 15px;
        right: 15px;
        font-size: 20px;
    }

    .search_modal_results {
        max-height: 50vh;
    }

    .search_result_link {
        padding: 14px 16px;
    }

    .search_result_title {
        font-size: 16px;
    }

    .search_result_excerpt {
        font-size: 13px;
    }

    .search_modal_hint {
        display: none;
        /* Hide keyboard hint on mobile */
    }
}

/* Prevent body scroll when modal is open */
body.search_modal_open {
    overflow: hidden;
}

/* CCS Pages (except golden-visa) - Blue and DodgerBlue Colors */
html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_container {
    background: rgba(2, 37, 66, 0.98);
    box-shadow:
        0 0 0 1px rgba(30, 144, 255, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(30, 144, 255, 0.2);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_close {
    border-color: rgba(30, 144, 255, 0.3);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_close:hover {
    color: #1E90FF;
    background: rgba(30, 144, 255, 0.15);
    border-color: rgba(30, 144, 255, 0.5);
    box-shadow: 0 0 20px rgba(30, 144, 255, 0.4);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_input {
    border-color: rgba(30, 144, 255, 0.3);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_input:focus {
    border-color: rgba(30, 144, 255, 0.8);
    box-shadow:
        0 0 0 4px rgba(30, 144, 255, 0.15),
        0 0 30px rgba(30, 144, 255, 0.3),
        inset 0 0 20px rgba(30, 144, 255, 0.1);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_input_icon {
    color: rgba(30, 144, 255, 0.6);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_input:focus+.search_modal_input_icon {
    color: #1E90FF;
    text-shadow: 0 0 10px rgba(30, 144, 255, 0.6);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_hint_kbd {
    background: rgba(30, 144, 255, 0.15);
    border-color: rgba(30, 144, 255, 0.3);
    color: #1E90FF;
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_result_item:hover,
html[data-route="ccs"]:not([data-page="golden-visa"]) .search_result_item.selected {
    background-color: rgba(30, 144, 255, 0.15);
    border-color: rgba(30, 144, 255, 0.4);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.2);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_result_title {
    color: #87CEEB;
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_result_title mark {
    background-color: rgba(135, 206, 235, 0.4);
    color: #87CEEB;
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_result_excerpt mark {
    background-color: rgba(135, 206, 235, 0.25);
    color: #87CEEB;
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_result_badge {
    background: rgba(30, 144, 255, 0.2);
    color: #1E90FF;
    border-color: rgba(30, 144, 255, 0.4);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_results::-webkit-scrollbar-thumb {
    background: rgba(30, 144, 255, 0.4);
}

html[data-route="ccs"]:not([data-page="golden-visa"]) .search_modal_results::-webkit-scrollbar-thumb:hover {
    background: rgba(30, 144, 255, 0.6);
}

/* CPS Pages - Green Colors (#51c680) */
html[data-route="cps"] .search_modal_container {
    background: rgba(5, 40, 20, 0.98);
    box-shadow:
        0 0 0 1px rgba(81, 198, 128, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(81, 198, 128, 0.2);
}

html[data-route="cps"] .search_modal_close {
    border-color: rgba(81, 198, 128, 0.3);
}

html[data-route="cps"] .search_modal_close:hover {
    color: #51c680;
    background: rgba(81, 198, 128, 0.15);
    border-color: rgba(81, 198, 128, 0.5);
    box-shadow: 0 0 20px rgba(81, 198, 128, 0.4);
}

html[data-route="cps"] .search_modal_input {
    border-color: rgba(81, 198, 128, 0.3);
}

html[data-route="cps"] .search_modal_input:focus {
    border-color: rgba(81, 198, 128, 0.8);
    box-shadow:
        0 0 0 4px rgba(81, 198, 128, 0.15),
        0 0 30px rgba(81, 198, 128, 0.3),
        inset 0 0 20px rgba(81, 198, 128, 0.1);
}

html[data-route="cps"] .search_modal_input_icon {
    color: rgba(81, 198, 128, 0.6);
}

html[data-route="cps"] .search_modal_input:focus+.search_modal_input_icon {
    color: #51c680;
    text-shadow: 0 0 10px rgba(81, 198, 128, 0.6);
}

html[data-route="cps"] .search_modal_hint_kbd {
    background: rgba(81, 198, 128, 0.15);
    border-color: rgba(81, 198, 128, 0.3);
    color: #51c680;
}

html[data-route="cps"] .search_result_item:hover,
html[data-route="cps"] .search_result_item.selected {
    background-color: rgba(81, 198, 128, 0.15);
    border-color: rgba(81, 198, 128, 0.4);
    box-shadow: 0 4px 12px rgba(81, 198, 128, 0.2);
}

html[data-route="cps"] .search_result_title {
    color: #8cfdc0;
}

html[data-route="cps"] .search_result_title mark {
    background-color: rgba(140, 253, 192, 0.4);
    color: #8cfdc0;
}

html[data-route="cps"] .search_result_excerpt mark {
    background-color: rgba(140, 253, 192, 0.25);
    color: #8cfdc0;
}

html[data-route="cps"] .search_result_badge {
    background: rgba(81, 198, 128, 0.2);
    color: #51c680;
    border-color: rgba(81, 198, 128, 0.4);
}

html[data-route="cps"] .search_modal_results::-webkit-scrollbar-thumb {
    background: rgba(81, 198, 128, 0.4);
}

html[data-route="cps"] .search_modal_results::-webkit-scrollbar-thumb:hover {
    background: rgba(81, 198, 128, 0.6);
}
