/* =========================================================
   GLOBAL RESET
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #fffff0;
}

/* =========================================================
   HEADER & TITLE
   ========================================================= */
/*#header_contact {
    display: flex;
    width: 100%;
    height: 150px;
    background: #fffff0;
    justify-content: center;
    align-items: center;
}
#header_contact{
    background-image: url("CCDB.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
#header_contact h1 {
    color: red;
    font-family: sans-serif;
    font-size: 30px;
    text-shadow: 1px 1px 1px #000;
}*/

/* =========================================================
   HEADER & TITLE (With Zoom Animation)
   ========================================================= */
#header_contact {
    position: relative; /* ::before को पोज़िशन करने के लिए ज़रूरी है */
    display: flex;
    width: 100%;
    height: 150px;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* ताकि ज़ूम होती इमेज बाहर न निकले */
    background: #fffff0;
}

/* यहाँ हमने इमेज को ::before में डाला है */
#header_contact::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("CCDB.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0; /* इमेज पीछे रहेगी */
    
    /* एनीमेशन का नाम और समय (8 सेकंड) सेट करें */
    animation: slowZoom 8s ease-in-out infinite alternate;
}

/* h1 को इमेज के ऊपर दिखाने के लिए */
#header_contact h1 {
    position: relative;
    z-index: 1; /* टेक्स्ट इमेज के ऊपर आएगा */
    color: red;
    font-family: sans-serif;
    font-size: 30px;
    text-shadow: 1px 1px 1px #000;
}

/* एनीमेशन की परिभाषा (Keyframes) */
@keyframes slowZoom {
    0% {
        transform: scale(1); /* नॉर्मल साइज़ */
    }
    100% {
        transform: scale(1.15); /* 15% बड़ा हो जाएगा */
    }
}

/* =========================================================
   MAIN LAYOUT CONTAINER
   ========================================================= */
#contactMe {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    width: 100%;
    height: auto;
    background: #fffff0;
    gap: 40px;
    justify-content: center;
    align-items: flex-start; /* Aligns items to the top */
    padding: 50px 20px;
}

/* =========================================================
   LEFT SIDE: ADDRESS
   ========================================================= */
.address {
    width: 100%;
    max-width: 360px; /* Replaces fixed width */
    height: auto;
    background: transparent;
    border-radius: 12px;
    color: #000;
    text-align: left;
}

.address h2 {
    font-size: 25px;
    color: red;
    text-shadow: 1px 1px 1px #000;
}

.address p {
    font-size: 18px;
    line-height: 1.5;
}

.address a {
    color: #222;
    text-decoration: none;
}

.address a:hover {
    text-decoration: underline;
}

/* =========================================================
   MIDDLE: FORM CONTAINER
   ========================================================= */
.formInfo {
    width: 100%;
    max-width: 400px;
    height: auto;
    background: #5f9ca0;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding: 10px;
}

#userform {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    background: #f0fff0;
    justify-content: center;
    align-items: center;
    padding: 20px 15px;
    border: 5px solid silver;
    border-radius: 12px;
}

#userform h2 {
    color: red;
    text-align: center;
    text-shadow: 1px 1px 1px #000;
    opacity: 0.7;
    font-size: 26px;
    margin-bottom: 20px;
}

/* Form Labels */
label {
    width: 100%;
    max-width: 300px;
    text-align: left;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

/* Form Inputs */
.name, .lastname, .number, .email, .Message-Box {
    width: 100%;
    max-width: 300px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    margin-bottom: 10px; /* Space between fields */
}

.number {
    height: 38px;
}

.Message-Box {
    height: 120px;
    resize: vertical; /* User can resize vertically only */
}

/* Validation States */
#userform input.input-invalid,
#userform textarea.input-invalid {
    border: 2px solid #b00020;
    outline: none;
}

#userform input.input-valid,
#userform textarea.input-valid {
    border: 2px solid green;
    outline: none;
}

/* Error Messages */
.error-message {
    width: 100%;
    max-width: 300px;
    color: #b00020;
    font-size: 13px;
    font-weight: bold;
    min-height: 16px;
    text-align: left;
    margin-top: -5px;
    margin-bottom: 10px;
}

/* Captcha Section */
.captcha-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin-bottom: 5px;
}

#captcha-question {
    font-weight: bold;
    font-size: 18px;
    color: #333;
    background: #e8f5e9;
    padding: 6px 10px;
    border-radius: 5px;
    letter-spacing: 1px;
}

.captcha-input {
    width: 80px;
    height: 35px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#captcha-refresh {
    height: 35px;
    width: 35px;
    border: none;
    border-radius: 5px;
    background: #5f9ca0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

#captcha-refresh:hover {
    background: #4a7f82;
}

/* Success Message */
.form-success {
    display: none;
    margin-top: 15px;
    padding: 10px;
    width: 100%;
    max-width: 300px;
    background: #e8f5e9;
    color: green;
    border: 1px solid green;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

/* Submit Button */
.submit {
    width: 150px;
    height: 40px;
    background: green;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.submit:hover {
    background: darkgreen;
}

/* =========================================================
   RIGHT SIDE: IMAGE
   ========================================================= */
.form_image {
    width: 100%;
    max-width: 430px;
    height: auto;
    background: transparent;
    border-radius: 12px;
}

.form_image h3 {
    font-size: 23px;
    margin-bottom: 20px;
    font-weight: bolder;
    color: #222;
    text-align: center;
}

#reply_image {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* =========================================================
   FOOTER
   ========================================================= */
.bottom {
    width: 100%;
    height: auto;
    padding: 15px 10px;
    background: #f0fff0;
    color: #222;
    justify-content: center;
    display: flex;
    align-items: center;
    text-align: center;
    font-size: 14px;
    margin-top: 20px;
}

/* =========================================================
   MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================================= */

/* --- Tablets & Small Laptops (max-width: 1024px) --- */
@media (max-width: 1024px) {
    #contactMe {
        gap: 30px;
        padding: 40px 20px;
    }
    
    .address {
        text-align: center; /* Center text for better look */
    }

    /* Optional: Adjust image max-width */
    .form_image {
        max-width: 500px;
    }
}

/* --- Mobile Devices (max-width: 768px) --- */
@media (max-width: 768px) {
    #contactMe {
        flex-direction: column;
        align-items: center;
        gap: 35px;
        padding: 30px 15px;
    }

    #header_contact {
        height: 80px;
    }

    #header_contact h1 {
        font-size: 26px;
    }

    .address {
        max-width: 100%;
        padding: 0 10px;
    }

    .formInfo {
        max-width: 100%;
        padding: 5px;
    }

    #userform {
        width: 100%;
        border-width: 3px; /* Thinner border on mobile */
    }

    .form_image {
        max-width: 100%;
        padding: 0 10px;
    }

    .form_image h3 {
        font-size: 20px;
    }
}

/* --- Small Phones (max-width: 400px) --- */
@media (max-width: 400px) {
    .address p {
        font-size: 16px;
    }

    #userform h2 {
        font-size: 22px;
    }

    .name, .lastname, .number, .email, .Message-Box, label, .error-message {
        max-width: 100%; /* Take full width of the padding container */
    }

    .captcha-row {
        justify-content: center; /* Center captcha on very small screens */
    }

    #captcha-question {
        font-size: 16px;
        padding: 5px 8px;
    }

    .captcha-input {
        width: 70px;
    }
    
    .submit {
        width: 100%; /* Full width button on small phones */
        max-width: 200px;
    }
}
