/* استایل‌های اختصاصی برای فرم جستجوی حمل و نقل دریایی */

.search-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 20px;
    opacity: 0;
    transition: all 0.5s ease;
    direction: rtl;
}

.search-container.animated {
    opacity: 1;
}

.search-container .row {
    margin: 0 -15px;
}

.search-container .col-lg-3 {
    padding: 0 15px;
}

.search-title {
    color: #333;
    font-weight: bold;
    margin-bottom: 12px;
    display: block;
    font-size: 15px;
    text-align: right;
}

.search-icon-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #2273f8;
    z-index: 10;
    font-size: 18px;
}

/* استایل برای سلکت ها */
.select2-container {
    width: 100% !important;
    direction: rtl;
    text-align: right;
}

.select2-container--default .select2-selection--single {
    height: 50px;
    border-radius: 8px;
    border: 1px solid #e4e8f1;
    background-color: #f8f9fd;
    display: flex;
    align-items: center;
    padding: 0 40px 0 15px !important;
    transition: all 0.3s;
    direction: rtl;
    text-align: right;
}

.select2-container--default .select2-selection--single:hover,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #2273f8;
    box-shadow: 0 0 0 3px rgba(34, 115, 248, 0.1);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333;
    line-height: 50px;
    font-size: 14px;
    padding-right: 5px !important;
    padding-left: 25px !important;
    text-align: right;
    width: 100%;
    direction: rtl;
}

/* بهبود استایل برای حالت عدم انتخاب */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #666;
    font-weight: normal;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    left: 10px !important;
    right: auto !important;
    top: 1px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #2273f8 transparent transparent transparent;
    border-width: 6px 5px 0 5px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #2273f8 transparent;
    border-width: 0 5px 6px 5px;
}

/* استایل دراپ‌داون */
.select2-dropdown {
    border: 1px solid #e4e8f1;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    direction: rtl;
    text-align: right;
    overflow: hidden;
    background-color: white;
    z-index: 9999;
}

.select2-dropdown.select2-dropdown--above {
    margin-bottom: 5px;
    border-bottom: 1px solid #e4e8f1 !important;
}

.select2-dropdown.select2-dropdown--below {
    margin-top: 5px;
    border-top: 1px solid #e4e8f1 !important;
}

.select2-search--dropdown {
    direction: rtl;
    padding: 10px !important;
    position: relative;
    background-color: #f8f9fd;
    border-bottom: 1px solid #e4e8f1;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd;
    padding: 10px 36px 10px 10px;
    border-radius: 6px;
    direction: rtl;
    text-align: right;
    background-color: white;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #2273f8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 115, 248, 0.1);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #2273f8;
}

.select2-results__option {
    padding: 12px 15px;
    font-size: 14px;
    text-align: right;
    direction: rtl;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.select2-results__option:last-child {
    border-bottom: none;
}

.select2-results__option:hover {
    background-color: #f5f8ff;
}

.select2-results__options {
    direction: rtl;
    text-align: right;
    max-height: 250px;
    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 #f5f5f5;
    padding: 5px 0;
}

/* استایل برای جستجوی select2 */
.select2-search:before {
    content: "\f002";
    font-family: 'Line Awesome Free';
    font-weight: 900;
    position: absolute;
    left: auto;
    right: 20px;
    top: 20px;
    color: #2273f8;
    font-size: 16px;
    z-index: 5;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    padding-right: 35px !important;
    padding-left: 10px !important;
}

/* استایل برای دکمه جستجو */
.search-btn {
    background-color: #2273f8;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    padding: 14px 40px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    width: auto;
    margin-top: 30px;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(34, 115, 248, 0.25);
}

.search-btn:hover {
    background-color: #1b5fd2;
    box-shadow: 0 6px 15px rgba(34, 115, 248, 0.35);
    transform: translateY(-2px);
}

.search-btn:disabled {
    background-color: #84b2ff;
    cursor: not-allowed;
    box-shadow: none;
}

/* استایل برای پیام نتیجه جستجو */
#searchResultMessage {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    direction: rtl;
    text-align: center;
}

.alert-danger {
    background-color: #fff2f2;
    border: 1px solid #ffdfdf;
    color: #e74c3c;
}

.alert-success {
    background-color: #f0fff4;
    border: 1px solid #d4ffea;
    color: #27ae60;
}

/* استایل برای حالت غیرفعال سلکت */
select:disabled {
    background-color: #f9f9f9;
    cursor: not-allowed;
}

/* بهبود استایل فیلدهای غیرفعال */
.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #f5f5f5;
    opacity: 0.8;
    cursor: not-allowed;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__rendered {
    color: #777;
    font-style: italic;
    padding-right: 5px;
}

/* استایل برای موبایل */
@media (max-width: 767px) {
    .search-container {
        padding: 20px;
    }
    
    .search-container .col-lg-3 {
        margin-bottom: 20px;
    }
    
    .search-btn {
        width: 100%;
        margin-top: 15px;
    }
}

/* استایل برای لودینگ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* استایل برای لودینگ select */
.select-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(245, 247, 252, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 15;
}

.select-loading i {
    color: #2273f8;
    font-size: 24px;
}

/* انیمیشن fadeIn */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

/* استایل برای افکت تکان خوردن المان های ناقص */
@keyframes shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}

.shake-element {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

/* فیکس آیکون های کشورها */
.la-globe, .la-ship {
    margin-left: 5px;
}

/* بهبود جستجو و راست‌چین بودن select2 */
.rtl-search {
    text-align: right !important;
    direction: rtl !important;
}

.rtl-select {
    text-align: right !important;
    direction: rtl !important;
}

.select2-container--default .select2-selection--single {
    text-align: right !important;
    direction: rtl !important;
}

/* بهبود استایل آپشن‌های کشور و بندر */
.country-option-container, .port-option-container {
    width: 100%;
    text-align: right;
    direction: rtl;
    padding: 8px 5px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.country-name, .port-name {
    display: block;
    width: 100%;
    text-align: right;
    direction: rtl;
    font-size: 14px;
    font-weight: normal;
}

/* یکسان‌سازی آپشن‌های بندر با کشور */
.port-option-container {
    padding: 8px 5px !important;
    display: flex !important;
    align-items: center !important;
    font-size: 14px !important;
}

/* پنهان کردن آیکون اصلی select و قرار دادن آیکون سفارشی */
.select2-selection__arrow {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.select2-selection__arrow b {
    display: none !important;
}

.select2-selection__arrow:after {
    content: "\f107";
    font-family: 'Line Awesome Free';
    font-weight: 900;
    font-size: 18px;
    color: #2273f8;
}

/* اسکرولبار سفارشی برای دراپ‌داون */
.select2-results__options::-webkit-scrollbar {
    width: 6px;
}

.select2-results__options::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    border-radius: 6px;
    border: 2px solid #f5f5f5;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

/* بهبود متن "ابتدا کشور مبدا را انتخاب کنید" */
.disabled-message .select2-selection__rendered {
    color: #888 !important;
    font-style: italic;
    opacity: 0.8;
    font-size: 13px !important;
}

/* حالت بدون نتیجه */
.select2-results__message {
    color: #777;
    font-style: italic;
    padding: 15px !important;
    text-align: center;
}

/* رفع مشکل نمایش سلکشن */
.select2-selection__rendered {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* استایل بهبود یافته برای فیلدهای select بندرها */
#origin_port, #destination_port {
    height: 50px;
    border-radius: 8px;
    border: 1px solid #e4e8f1;
    background-color: #f8f9fd;
    padding: 0 40px 0 15px;
    font-size: 14px;
    transition: all 0.3s;
    direction: rtl;
    text-align: right;
    width: 100%;
}

/* استایل برای حالت غیرفعال سلکت بندرها */
#origin_port:disabled, #destination_port:disabled,
select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.8;
    color: #777;
    font-style: italic;
}

/* رفع مشکل ظاهری select بندرها */
#origin_port, #destination_port {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* یکسان‌سازی استایل select2 برای بندرها */
#origin_port + .select2-container, #destination_port + .select2-container {
    margin-bottom: 0 !important;
}

#origin_port + .select2-container .select2-selection--single,
#destination_port + .select2-container .select2-selection--single {
    height: 50px !important;
    background-color: #f8f9fd !important;
}

#origin_port + .select2-container .select2-selection__rendered,
#destination_port + .select2-container .select2-selection__rendered {
    line-height: 50px !important;
    font-size: 14px !important;
    color: #333 !important;
} 