/* Basic Reset & Global Styles */
:root {
    --primary-color: #4285f4; /* Google Blue, a vibrant color for CTAs */
    --secondary-color: #6a6a6a; /* Dark grey for text */
    --light-grey: #e0e0e0; /* Light grey for borders */
    --background-light: #f5f5f5; /* Off-white for background */
    --form-background: #ffffff; /* Pure white for form */
    --error-color: #d32f2f; /* Red for errors */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition-speed: 0.3s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--secondary-color);
    line-height: 1.6;
}

/* Body Background */
.demo-bg {
    background: linear-gradient(135deg, #e0f7fa, #bbdefb); /* A subtle gradient */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Ensures it takes full viewport height */
    padding: 20px; /* Add some padding for smaller screens */
    overflow-y: auto; /* Allow scrolling if content is too long */
}

/* Container Wrapper for Form */
.container-wrapper {
    max-width: 500px; /* Max width for the form on larger screens */
    width: 100%;
    margin: auto; /* Center the container */
}

/* Form Container Styling */
.form-container {
    background-color: var(--form-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px; /* Spacing between form elements */
}

.form-container h2 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

/* Labels */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.95em;
}

/* Input and Select Fields */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-grey);
    border-radius: var(--border-radius);
    font-size: 1em;
    color: #444;
    background-color: var(--background-light);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    -webkit-appearance: none; /* Remove default styling for select on WebKit */
    -moz-appearance: none;    /* Remove default styling for select on Firefox */
    appearance: none;         /* Remove default styling for select */
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
.multi-btn:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
    outline: none;
    background-color: #fff;
}

/* Specific styling for the select dropdown arrow */
select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236a6a6a%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-6.5%200-12.3%203.2-16.1%208.1-3.9%204.9-4.9%2011.4-2.9%2017.7l139.3%20139.3c3.9%203.9%209.2%206.1%2014.7%206.1s10.8-2.2%2014.7-6.1l139.3-139.3c4.1-4.1%205.1-10.3%202.9-16.6z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 12px auto;
    cursor: pointer;
}


/* Validation Error Messages */
.validation-error {
    color: var(--error-color);
    font-size: 0.85em;
    margin-top: -10px; /* Adjust margin to pull it closer to the input */
    margin-bottom: 5px; /* Space it from the next label */
    min-height: 18px; /* Reserve space to prevent layout shifts */
}

/* Multiselect Dropdown for Skills */
.multiselect {
    position: relative;
    width: 100%;
    margin-bottom: 5px; /* Spacing before error/next element */
}

.multi-btn {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-grey);
    border-radius: var(--border-radius);
    background-color: var(--background-light);
    font-size: 1em;
    color: #444;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.multi-btn::after {
    content: '▼'; /* Dropdown arrow */
    font-size: 0.7em;
    color: var(--secondary-color);
    margin-left: 10px;
}

.checkbox-dropdown {
    display: none; /* Hidden by default, controlled by JS */
    position: absolute;
    top: 100%; /* Position right below the button */
    left: 0;
    right: 0;
    background-color: var(--form-background);
    border: 1px solid var(--light-grey);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 100; /* Ensure it appears above other content */
    max-height: 200px; /* Limit height to enable scrolling */
    overflow-y: auto;
    padding: 10px 0; /* Vertical padding */
    margin-top: 5px; /* Small gap between button and dropdown */
}

.checkbox-dropdown label {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-bottom: 0; /* Override default label margin */
    transition: background-color var(--transition-speed);
    font-weight: 400; /* Normal weight for list items */
    color: #333;
}

.checkbox-dropdown label:hover {
    background-color: var(--background-light);
}

.checkbox-dropdown input[type="checkbox"] {
    margin-right: 10px;
    width: auto; /* Don't take full width */
    vertical-align: middle;
    transform: scale(1.1); /* Slightly larger checkboxes */
}

/* Call-to-Action Button */
.cta-button {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px; /* Space above button */
    margin-bottom: 10px; /* Space below button */
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    box-shadow: var(--shadow);
}

.cta-button:hover {
    background-color: #357ae8; /* Slightly darker blue on hover */
    transform: translateY(-2px); /* Subtle lift effect */
}

.cta-button:active {
    transform: translateY(0); /* Return to original position */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* "What is a demo class?" link */
.demo-info-link {
    display: block; /* Make it a block element to control margin */
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
    margin-top: 5px; /* Space below button */
    transition: color var(--transition-speed);
}

.demo-info-link:hover {
    color: #357ae8;
    text-decoration: underline;
}

/* Message class div */
#formMessclass {
    text-align: center;
    font-weight: 500;
    margin-top: 10px;
    color: #4CAF50; /* Example color for success messages */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-container {
        padding: 25px;
        margin: 15px; /* Add some margin on smaller screens */
    }

    .form-container h2 {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    select,
    .multi-btn,
    .cta-button {
        padding: 10px 12px;
        font-size: 0.95em;
    }

    .checkbox-dropdown label {
        font-size: 0.9em;
    }

    .cta-button {
        font-size: 1em;
        padding: 12px 15px;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 20px;
    }

    .form-container h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    label {
        font-size: 0.9em;
    }

    .validation-error {
        font-size: 0.8em;
    }

    .demo-bg {
        padding: 10px;
    }
}
