/* Contact Form CSS */
.custom-contact-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.custom-contact-form .form-group {
    margin-bottom: 20px;
}

.custom-contact-form label {
    display: block;
    margin-bottom: 8px;
    color: #185789;
    font-size: 14px;
    font-weight: bold;
}

.custom-contact-form .required {
    color: red;
}

.custom-contact-form input[type="text"],
.custom-contact-form textarea {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 14px;
    color: #185789;
}

.custom-contact-form textarea {
    min-height: 110px;
    resize: vertical;
    border-radius: 10px;
}

.custom-contact-form input::placeholder,
.custom-contact-form textarea::placeholder {
    color: #235784;
}

.custom-contact-form .phone-input-container {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}

/* Enhanced Country Dropdown Styling */
.custom-contact-form .country-select {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 5px 10px;
    border-right: 1px solid #ddd;
    cursor: pointer;
}

.custom-contact-form #country_code {
    background: transparent;
    border: none;
    padding-right: 18px;
    font-size: 15px;
    color: #185789;
    width: 65px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.custom-contact-form .country-select::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #185789;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.custom-contact-form #country_code:focus {
    outline: none;
}

/* Style the dropdown options when open */
.custom-contact-form #country_code option {
    padding: 10px;
    background-color: white;
    color: #185789;
    font-size: 14px;
}

/* Enhanced styling for the selected option */
select#country_code option:checked {
    background-color: #f0f7ff;
    color: #185789;
    font-weight: bold;
}

/* Style the scrollbar for the dropdown */
select#country_code::-webkit-scrollbar {
    width: 8px;
}

select#country_code::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
}

select#country_code::-webkit-scrollbar-thumb {
    background: #185789;
    border-radius: 8px;
}

select#country_code::-webkit-scrollbar-thumb:hover {
    background: #104970;
}

/* Custom dropdown arrow using background images for better browser support */
@supports (-webkit-appearance: none) or (-moz-appearance: none) or (appearance: none) {
    select#country_code {
        background-image: 
            linear-gradient(45deg, transparent 50%, #185789 50%),
            linear-gradient(135deg, #185789 50%, transparent 50%);
        background-position:
            calc(100% - 13px) 50%,
            calc(100% - 8px) 50%;
        background-size:
            5px 5px,
            5px 5px;
        background-repeat: no-repeat;
    }
}

/* Improve hover state */
.custom-contact-form .country-select:hover {
    background-color: #f8f9fa;
}

/* Firefox-specific styling */
@-moz-document url-prefix() {
    .custom-contact-form #country_code {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23185789' d='M0 0l5 5 5-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
        padding-right: 24px;
    }

    .custom-contact-form .country-select::after {
        display: none;
    }
}

/* Phone input styling */
.custom-contact-form #phone {
    flex: 1;
    border: none;
    border-radius: 0;
}

.custom-contact-form #phone:focus {
    outline: none;
}

/* Submit button styling */
.custom-contact-form button[type="submit"] {
    background-color: #fca311;
    color: #185789;
    border: none;
    padding: 13px 20px;
    font-size: 18px;
    /* font-weight: bold; */
    cursor: pointer;
    border-radius: 10px;
    text-transform: none;
}

.custom-contact-form button[type="submit"]:hover {
    background-color: #e89716;
    border: none;
}

/* Form messages styling with animation for auto-hide */
.form-messages {
    margin-top: 20px;
    padding: 10px;
    border-radius: 4px;
    display: none;
    animation: fadeIn 0.3s ease-in, fadeOut 0.5s ease-out 4.5s forwards;
    opacity: 0;
}

.form-messages.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
    opacity: 1;
}

.form-messages.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
    opacity: 1;
}

/* Animations for the form messages */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .custom-contact-form input[type="text"],
    .custom-contact-form textarea,
    .custom-contact-form .phone-input-container {
        padding: 10px;
    }
    
    .custom-contact-form button[type="submit"] {
        width: 100%;
    }
    
    .custom-contact-form .country-select {
        padding: 10px;
    }
}

/* Input focus effect styles */
.custom-contact-form input[type="text"]:focus,
.custom-contact-form textarea:focus {
    outline: none;
    border-color: #fca311;
    border-width: 1px;
    /* box-shadow: 0 0 0 2px rgba(24, 87, 137, 0.2); */
}

/* Transition effect for smooth focus */
.custom-contact-form input[type="text"],
.custom-contact-form textarea,
.custom-contact-form select {
    transition: all 0.3s ease;
}

/* Focus effects */
.custom-contact-form input[type="text"]:focus,
.custom-contact-form textarea:focus,
.custom-contact-form select:focus,
.select2-container--default.select2-container--focus .select2-selection--single {
    outline: none;
    border-color: #fca311;
    border-width: 1px;
    /* box-shadow: 0 0 0 2px rgba(24, 87, 137, 0.2); */
}

/* Consistent box sizing */
.custom-contact-form input[type="text"],
.custom-contact-form textarea,
.custom-contact-form select,
.select2-container--default .select2-selection--single {
    box-sizing: border-box;
}



/* Phone input container focus */
.custom-contact-form .phone-input-container:focus-within {
    border-color: #fca311;
    border-width:1px;
}


/* For Select2 container */
.select2-container--open .select2-dropdown {
    border-color: #e89716;
}

/* Style for Select2 dropdown */
.country-dropdown {
    border-radius: 8px;
    border-color: #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.select2-container--default .select2-selection--single {
    border: none;
    background-color: transparent;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #185789;
    line-height: 24px;
    padding-left: 0;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    padding-right: 20px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none;
}
.custom-contact-form button[type="submit"] {
    background-color: #fca311;
    color: #185789;
    border: none;
    padding: 5px 25px;
    font-size: 18px;
    /* font-weight: bold; */
    cursor: pointer;
    border-radius: 10px;
    text-transform: none;
}