/* Modern Contact Form */
.nk-section {
    padding: 5rem 2rem;
    background-color: #f8f9fa;
    color: #1E1E1E;
}

.contact-container {
    background-color: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 0;
    max-width: 1100px;
    margin: 2rem auto;
    display: flex;
    min-height: 450px;
    flex-wrap: wrap;
}

/* Text Styling */
.nk-section-title,
.nk-section-subtitle,
.nk-section-text {
    color: #1E1E1E !important;
}

.nk-section-subtitle {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    color: #86C232;
}

.nk-section-title {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c3e50;
    line-height: 1.2;
}

.nk-section-text {
    font-size: 1.125rem;
    color: #5a6a7d;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

/* Main Container */
.contact-container {
    display: flex;
    max-width: 1100px;
    margin: 2rem auto;
    min-height: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    background: #fff;
    flex-wrap: wrap;
}

/* Left Side - Image Panel */
.contact-image {
    flex: 0 0 48%;
    background-color: #f5f9f3;
    position: relative;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 400px;
}

.contact-svg {
    width: 85%;
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.contact-svg path {
    fill: #68AE1E;
}

.contact-image:hover .contact-svg {
    transform: scale(1.03);
}

/* Right Side - Form Panel */
.contact-form-container {
    flex: 0 0 48%;
    padding: 2rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
    min-height: 400px;
    max-width: 480px;
    margin: 0 auto;
}

.contact-form-container h3 {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
    color: #1a365d;
    font-weight: 700;
}

.contact-form-container p.subtext {
    color: #5a6a7d;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-control {
    height: 50px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #86C232;
    box-shadow: 0 0 0 2px rgba(134, 194, 50, 0.2);
    outline: none;
}

textarea.form-control {
    min-height: 130px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    resize: vertical;
}

/* Form Icons */
.form-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #A0AEC0;
    font-size: 1.1rem;
    z-index: 10;
}

textarea + .form-icon {
    top: 1.25rem;
    transform: none;
}

/* Button Styles */
.btn-primary {
    background-color: #86C232;
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    margin-top: 0.75rem;
    box-sizing: border-box;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(134, 194, 50, 0.3);
}

/* Phone Input Container with Custom Select */
.phone-input-container {
    display: flex;
    gap: 15px;
    position: relative;
    flex-wrap: wrap;
    align-items: center;
}

.phone-input-container .form-control {
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding-left: 0.75rem;
}

.phone-input-container .form-control:focus {
    border-color: #86C232;
    box-shadow: 0 0 0 2px rgba(134, 194, 50, 0.2);
}

/* Custom Country Selector Styling */
.contact-form-container .custom-select {
    position: relative;
    max-width: 48%;
    min-width: 120px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    height: 50px;
    box-sizing: border-box;
    background: white;
    flex: 1 1 auto; /* Ensure it respects container width */
}

.contact-form-container .custom-select .selected-option {
    padding: 0.75rem 2rem 0.75rem 0.75rem;
    display: block;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center; /* Adjusted closer to edge */
    background-size: 12px;
    overflow: hidden; /* Force containment */
    text-overflow: ellipsis; /* Ensure ellipsis works */
    white-space: nowrap; /* Keep on one line */
    width: 100%; /* Full width of parent */
    max-width: 100%; /* Explicit max-width */
    box-sizing: border-box; /* Include padding in width */
}

.contact-form-container .custom-select .options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: white;
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contact-form-container .custom-select .options li {
    padding: 0.75rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
}

.contact-form-container .custom-select .options li:hover {
    background-color: #f8f9fa;
}

/* Validation Feedback */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Responsive Design */
@media (max-width: 1399.98px) {
    .contact-container {
        max-width: 100%;
        margin: 0 1.5rem;
        min-height: 550px;
    }
    .contact-form-container {
        padding: 2.5rem 2.5rem;
    }
}

@media (max-width: 1199.98px) {
    .contact-form-container {
        padding: 2.25rem;
    }
    .contact-image {
        padding: 2.5rem;
    }
}

@media (max-width: 991.98px) {
    .contact-container {
        flex-direction: column;
        max-width: 700px;
        min-height: auto;
        margin: 0 auto;
        border-radius: 12px;
    }
    .contact-image,
    .contact-form-container {
        flex: 0 0 100%;
    }
    .contact-image {
        min-height: 300px;
        padding: 2.5rem 2rem;
        border-radius: 12px 12px 0 0;
    }
    .contact-svg {
        max-width: 300px;
        width: 80%;
    }
    .contact-form-container {
        padding: 2.5rem 2rem;
        border-radius: 0 0 12px 12px;
    }
    .nk-section-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 767.98px) {
    .nk-section {
        padding: 2.5rem 0;
    }
    .contact-container {
        margin: 0 1rem;
        border-radius: 10px;
        max-width: 90%;
    }
    .contact-image {
        min-height: 250px;
        padding: 1.5rem 1rem;
    }
    .contact-form-container {
        padding: 1.5rem 1rem;
    }
    .nk-section-title {
        font-size: 1.75rem;
    }
    .nk-section-subtitle {
        margin-bottom: 0.5rem;
    }
    .nk-section-text {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    .phone-input-container {
        flex-direction: column;
        gap: 12px;
    }
    .contact-form-container .custom-select {
        max-width: 100%;
        min-width: 0;
        width: 100%;
        flex: 1 1 auto; /* Ensure it takes full width */
    }
    .contact-form-container .custom-select .selected-option {
        padding: 0.5rem 1.5rem 0.5rem 0.75rem; /* Reduced padding */
        background-position: right 0.3rem center; /* Adjusted arrow */
        font-size: 0.9rem; /* Reduced further */
        max-width: 100%; /* Explicit constraint */
    }
    .phone-input-container .form-control {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .contact-container {
        margin: 0 0.5rem;
        border-radius: 8px;
        max-width: calc(100% - 1rem);
    }
    .contact-image {
        min-height: 220px;
        padding: 1.25rem 0.75rem;
    }
    .contact-svg {
        max-width: 200px;
        width: 70vw;
        height: auto;
    }
    .contact-form-container {
        padding: 1.25rem 0.75rem;
    }
    .contact-form-container h3 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    .contact-form-container .subtext {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    .form-control {
        height: 44px;
        padding: 0.75rem 1rem 0.75rem 2rem;
        font-size: 0.95rem;
    }
    .form-icon {
        left: 0.6rem;
        font-size: 0.95rem;
    }
    textarea.form-control {
        min-height: 100px;
        padding: 0.75rem 1rem 0.75rem 2rem;
    }
    .btn-primary {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    .phone-input-container input[type="tel"] {
        height: 44px;
        padding: 0.75rem 1rem 0.75rem 0.75rem;
    }
    .contact-form-container .custom-select {
        height: 44px;
        font-size: 0.9rem; /* Reduced further */
        padding: 0.5rem 1.5rem 0.5rem 0.75rem; /* Reduced padding */
        background-position: right 0.3rem center;
    }
    .contact-form-container .custom-select .options li {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    .contact-form-container > * {
        animation: none;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.contact-form-container > * {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.contact-form-container > *:nth-child(1) { animation-delay: 0.1s; }
.contact-form-container > *:nth-child(2) { animation-delay: 0.2s; }
.contact-form-container > *:nth-child(3) { animation-delay: 0.3s; }
.contact-form-container > *:nth-child(4) { animation-delay: 0.4s; }
.contact-form-container > *:nth-child(5) { animation-delay: 0.5s; }
.contact-form-container > *:nth-child(6) { animation-delay: 0.6s; }

body {
    overflow-x: hidden;
}