/* Basic Reset and Font */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: #f0f0f0; /* Change default text color for better contrast on dark form */
    overflow-y: auto; /* Allow vertical scrolling while preventing horizontal scroll */
}

/* Background Image Styling */
.background-container {
    position: fixed; /* Stays in place during scroll */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1; /* Places it behind all other content */
}

.blurry-background {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the area without distortion */
    filter: blur(8px); /* This creates the blurry effect */
    transform: scale(1.1); /* Slightly zoom in to hide hard edges from the blur */
    object-position: center center; /* Center the image */
}

/* Responsive Image */
.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* 
   For larger screens (laptops/desktops) and landscape-oriented tablets/phones,
   fit the entire image within the screen. This prevents important parts from being cropped.
   The background color of the body will show in the empty space (letterboxing).
*/
@media only screen and (min-width: 992px), screen and (orientation: landscape) {
    .blurry-background {
        object-fit: contain; /* "Fit" the image on screen */
    }
}

/* High resolution displays */
@media only screen and (min-resolution: 192dpi), (-webkit-min-device-pixel-ratio: 2) {
    .blurry-background {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Navbar Styling */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(31, 32, 36, 0.75); /* Semi-transparent background */
    backdrop-filter: blur(14px); /* Glassmorphism effect */
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
}

.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1f2024;
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dropdown-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-link:hover {
    background-color: #0056b3;
}

.nav-link:hover,
.nav-link.active:hover {
    background-color: rgba(0, 86, 179, 0.3); /* Subtle blue background on hover */
}
.nav-link.active:not(:hover) {
    background-color: rgba(0, 86, 179, 0.5); /* Slightly stronger background for active link */
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
}

.hamburger {
    display: none;
    cursor: pointer;
}
.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: #ffffff;
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}



/* Contact Form Container */
.contact-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    padding-top: 80px; /* Add padding to prevent overlap with fixed navbar */
}

/* Form Styling */
.contact-form {
    position: relative; /* Needed for the loading overlay */
    background: rgba(10, 25, 47, 0.75); /* Dark navy blue, semi-transparent */
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(14px); /* Slightly increase blur for a smoother effect */
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 100%;
    max-width: 800px; /* Make form wider for two columns */
}

.contact-form h1 {
    font-size: clamp(1.8rem, 5vw, 2.2rem); /* Fluid font size */
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #ffffff; /* White header text */
}

.contact-form p {
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group.span-two {
    grid-column: span 2;
}


/* Form Groups and Inputs */
.form-group {
    margin-bottom: 1.5rem; /* Increased default margin slightly */
}

/* Utility class to reduce space between specific form groups */
.form-group.compact-margin {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #4a5568; /* Darker border */
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: rgba(255, 255, 255, 0.1); /* Slightly transparent input background */
    color: #ffffff; /* White input text */
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: #a0aec0; /* Lighter placeholder text */
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #63b3ed; /* Light blue focus color */
    box-shadow: 0 0 5px rgba(99, 179, 237, 0.5);
}

textarea {
    resize: vertical; /* Allows vertical resizing only */
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 0.5rem;
}

#country-code {
    flex: 0 0 80px; /* Fixed width for country code */
    text-align: center;
}

#phone {
    flex: 1 1 auto; /* Takes up remaining space */
}

.field-note {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 0.5rem;
}
.field-note a,
.field-note a:visited {
    color: #63b3ed; /* Bright light blue for visibility */
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.field-note a:hover {
    color: #90cdf4; /* Lighter blue on hover */
    text-decoration: underline;
}

/* Label Group for Message field */
.label-group {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.label-note {
    font-size: 0.8rem;
    font-weight: 300;
}

/* Captcha Styling */
.captcha-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #4a5568;
    margin-top: 0.5rem;
}

.captcha-card label {
    font-size: 0.9rem;
    font-weight: 400;
    color: #a0aec0;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.captcha-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1; /* Allow it to take available space */
}

.captcha-display {
    padding: 0.85rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid #4a5568;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 4px;
    user-select: none; /* Prevents text selection */
    text-decoration: line-through; /* Keeps the strikethrough style */
    flex-grow: 1; /* Allow it to grow and fill space */
}

/* Refresh Captcha Button */
.refresh-btn {
    background: none; /* Keep background transparent */
    border: 1px solid #f39c12; /* Orange border */
    color: #f39c12; /* Orange icon color */
    padding: 0;
    height: 46px; /* Slightly smaller */
    width: 46px;  /* Slightly smaller */
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.6rem; /* Slightly smaller icon */
    line-height: 1;
    transition: color 0.3s ease, transform 0.4s ease, border-color 0.3s ease;
    flex-shrink: 0;
}
.refresh-btn:hover {
    color: #f5b041; /* Lighter orange on hover */
    transform: rotate(180deg);
}

/* File Upload Link Styling */
.file-upload-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #4a5568;
    text-align: center;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #138535;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border: 1px solid #0e6a2a; /* Darker shade for border */
}

.upload-btn:hover {
    background-color: #0e6a2a; /* Darker shade for hover */
}

.upload-note {
    font-size: 0.8rem !important; /* Override general p style */
    color: #a0aec0;
    margin-top: 0.75rem;
    margin-bottom: 0 !important;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 0.85rem;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #003d82;
}

/* Form Status Message */
#form-status {
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
}

/* Social Links Styling */
.social-links {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.social-links p {
    margin-bottom: 1rem;
    font-weight: 400;
    font-size: 0.9rem;
}

.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 45px; /* Set icon size to 45px */
    margin: 0 clamp(0.5rem, 2vw, 0.75rem);
    color: #a0aec0; /* Default neutral color */
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-3px);
    filter: brightness(1.2); /* Slightly brighten on hover */
}

/* Social Icon Brand Colors */
.social-icon.whatsapp { color: #25D366; }
.social-icon.wechat { color: #09B83E; }
.social-icon.line { color: #00B900; }
.social-icon.facebook { color: #1877F2; }
.social-icon.social-network { color: #f39c12; } /* Orange color for the generic icon */

/* Remove background-color on hover as it's no longer needed */

/* Loading Overlay and Paper Plane Animation */
.loading-overlay {
    position: fixed; /* Covers the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.85);
    z-index: 10;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.loading-overlay.show {
    display: flex;
}

.paper-plane-container {
    width: 100px;
    height: 100px;
    animation: fly 2.5s ease-in-out infinite;
}

.loading-overlay .fa-paper-plane {
    font-size: clamp(2.5rem, 8vw, 4rem); /* Responsive font size, smaller on mobile */
    color: #ffffff; /* White paper plane */
}

@keyframes fly {
    0% {
        transform: translateX(-20vw) translateY(15vh) rotate(-20deg);
    }
    100% {
        transform: translateX(20vw) translateY(-15vh) rotate(45deg);
        opacity: 0;
    }
}



/* Toast / Bubble Notification Styling */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease, bottom 0.3s ease;
}

.toast.show {
    opacity: 1;
    bottom: 3rem;
}

.toast.success { background-color: #28a745; }
.toast.error { background-color: #dc3545; }

/* Success Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 25, 47, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1f2024;
    padding: 2rem 3rem;
    border-radius: 15px;
    text-align: center;
    color: #ffffff;
    border: 1px solid #4a5568;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 1rem;
}



/* Responsive Design for smaller devices */
@media (max-width: 600px) {
    .contact-container {
        padding: 1rem;
        align-items: flex-start; /* Align form to the top */
        min-height: auto;
        padding-top: 80px; /* Adjust padding for mobile */
    }

    .contact-form {
        padding: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 2rem;
    }
    .social-icon {
        font-size: 40px; /* Slightly smaller on mobile */
    }

    .contact-form h1 {
        font-size: 1.8rem;
    }

}

/* Specific adjustments for portrait mode on phones */
@media (max-width: 480px) and (orientation: portrait) {
    .social-icon {
        font-size: clamp(30px, 9vw, 38px); /* Further reduce size for narrow screens */
        margin: 0 clamp(0.3rem, 1.5vw, 0.5rem); /* Reduce space between icons */
    }
    .label-group {
        flex-direction: column; /* Stack message label and note */
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
    .form-group.span-two {
        grid-column: span 1; /* Ensure it only takes one column on mobile */
    }
    .captcha-container { /* This now stacks the captcha-line and the input field */
        flex-direction: column; /* Stacks the line and input vertically */
        align-items: stretch; /* Makes them full-width */
    }    
    .contact-container {
        padding: 0; /* Remove padding for full-screen form */
        padding-top: 70px; /* Keep space for navbar */
    }
    .contact-form {
        width: 100%;
        min-height: calc(100vh - 70px);
        margin: 0;
        border-radius: 0; /* No rounded corners on mobile */
        box-shadow: none; /* No shadow on mobile */
        border: none; /* No border on mobile */
        /* Restore transparency and blur for mobile full-screen view */
        background: rgba(10, 25, 47, 0.75);
        backdrop-filter: blur(14px);
    }

    .hamburger {
        display: block; /* Show the hamburger on mobile */
    }
    .nav-menu {
        position: fixed;
        left: -100%; /* Start off-screen */
        top: 70px; /* Position below the navbar */
        flex-direction: column;
        background-color: #1f2024;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    }
    .nav-menu.active {
        left: 0; /* Slide in when active */
    }
    .nav-item {
        padding: 1rem 0;
    }

    /* Mobile Dropdown Specifics */
    .nav-item.dropdown .dropdown-menu {
        display: none; /* Hide by default */
        position: static; /* Override absolute positioning */
        background-color: #2a2c31; /* Slightly lighter for contrast */
        box-shadow: none;
        width: 100%;
        opacity: 1;
        visibility: visible;
        padding: 0;
        margin-top: 0.5rem;
    }

    .nav-item.dropdown .dropdown-menu.show-mobile {
        display: block; /* Show when toggled by JS */
    }

    .nav-link.active-dropdown {
        background-color: rgba(0, 86, 179, 0.3); /* Keep hover/active color when dropdown is open */
    }
}
