/* General Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif; /* Changed font to Poppins for modern feel */
    background-color: var(--bg-color);
    color: var(--text-color-dark);
    line-height: 1.6;
    visibility: hidden;
}

/* Container & Heading */
.container {
    max-width: 850px; /* Slightly wider container */
    margin: 2.5rem auto; /* More vertical margin */
    background-color: var(--text-color-light);
    padding: 3rem; /* Increased padding */
    border-radius: 15px; /* More rounded corners */
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18); /* Deeper, more elegant shadow */
    border: 1px solid #e0e0e0; /* Subtle border */
}

h2 {
    text-align: center;
    margin-bottom: 2.5rem; /* More space below heading */
    font-size: 2.2rem; /* Larger heading */
    color: var(--primary-color); /* Emphasize heading */
    font-weight: 700;
    letter-spacing: 0.5px; /* Slight letter spacing */
}

/* Form Styles */
form label {
    display: block;
    margin-top: 1.8rem; /* More space above labels */
    margin-bottom: 0.6rem; /* More space below labels */
    font-weight: 600; /* Bolder labels */
    color: var(--text-color-dark);
    font-size: 1.05rem; /* Slightly larger label font */
}

input[type="text"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.9rem 1.2rem; /* Increased padding */
    border: 1px solid #c0c0c0; /* Slightly darker border for definition */
    border-radius: 10px; /* More rounded inputs */
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease; /* Smooth transitions */
    background-color: #ffffff; /* Pure white background */
    color: var(--text-color-dark);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color); /* Primary color border on focus */
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.3); /* More prominent focus glow */
    outline: none;
    background-color: #f9f9f9; /* Slight background change on focus */
}

textarea {
    resize: vertical;
    min-height: 100px; /* Increased minimum height for textareas */
}

/* File Inputs */
input[type="file"] {
    width: 100%; /* Ensure file input takes full width */
    padding: 0.7rem 1rem; /* Adjust padding for file input */
    border: 1px solid #c0c0c0;
    border-radius: 10px;
    background-color: #ffffff;
    cursor: pointer;
    color: var(--text-color-dark);
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem; /* Increased gap */
    margin-top: 1rem;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem; /* Space between input and label text */
    font-weight: normal;
    cursor: pointer;
    color: var(--text-color-dark);
    margin-top: 0;
    margin-bottom: 0;
    position: relative; /* For custom checkbox/radio styling */
}

/* Custom Radio/Checkbox Styling */
.radio-group input[type="radio"],
.checkbox-group input[type="checkbox"] {
    appearance: none; /* Hide default */
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #a0a0a0;
    border-radius: 50%; /* Circular for radio */
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-group input[type="checkbox"] {
    border-radius: 6px; /* Square for checkbox */
}

.radio-group input[type="radio"]:checked,
.checkbox-group input[type="checkbox"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.radio-group input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-group input[type="checkbox"]:checked::before {
    content: '\2713'; /* Checkmark */
    display: block;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Image Previews */
#profile_preview {
    display: block;
    margin: 2rem auto 1.5rem auto; /* Adjusted margins */
    width: 160px; /* Larger profile image */
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--primary-color); /* More prominent border */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15); /* Soft shadow */
}

#preview { /* Iqama image */
    display: block;
    margin: 2rem auto 1.5rem auto; /* Adjusted margins */
    max-width: 250px; /* Larger Iqama image */
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-preview-container { /* For certificate images */
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1.2rem;
    border: 2px dashed #d0d0d0; /* More visible dashed border */
    padding: 15px;
    border-radius: 10px;
    min-height: 100px; /* Ensure visibility even if no images */
    align-items: center;
    justify-content: center; /* Center images if few */
    background-color: #fcfcfc;
}

.image-preview-container img {
    width: 90px; /* Slightly larger, consistent size for multiple cert images */
    height: 90px;
    object-fit: cover;
    border-radius: 10px; /* Slightly more rounded corners for cert images */
    border: 1px solid #eee;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease; /* Hover effect */
}

.image-preview-container img:hover {
    transform: scale(1.05); /* Slight zoom on hover */
}

/* Sections */
#skilled-section,
#unskilled-section {
    background-color: #f0f5ff; /* Lighter blueish background */
    border: 1px solid #c0d0ff; /* More defined border */
    padding: 2rem; /* Increased padding */
    border-radius: 12px;
    margin-top: 2.5rem; /* More space above sections */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* Subtle shadow for sections */
}

#skilled-section label,
#unskilled-section label {
    margin-top: 1.2rem; /* Adjust label spacing within sections */
}

#unskilled-category-label {
    font-weight: 700; /* Bolder */
    margin-top: 0.8rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Button */
button[type="submit"] { /* Target submit button specifically */
    margin-top: 3rem; /* More space above button */
    padding: 1.1rem 1.8rem; /* Generous padding */
    background: linear-gradient(45deg, var(--primary-color), var(--dark-color)); /* Gradient background */
    color: #ffffff; /* White text */
    border: none;
    border-radius: 10px; /* More rounded button */
    font-size: 1.2rem; /* Larger font */
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

button[type="submit"]:disabled {
    background: #cccccc; /* Lighter gray for disabled */
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

button[type="submit"]:hover:not(:disabled) {
    background: linear-gradient(45deg, var(--dark-color), var(--primary-color)); /* Reverse gradient on hover */
    box-shadow: 0 12px 30px rgba(var(--primary-color-rgb), 0.4); /* More prominent shadow */
    transform: translateY(-3px); /* More pronounced lift effect */
}


/* Status Message */
#status {
    text-align: center;
    margin-top: 2rem;
    font-weight: 600;
    font-size: 1.15rem;
    padding: 12px;
    border-radius: 8px;
    letter-spacing: 0.3px;
}

#status[style*="color: green"] {
    background-color: #e6ffe6;
    border: 1px solid #00cc00;
    color: #008000;
}

#status[style*="color: red"] {
    background-color: #ffe6e6;
    border: 1px solid #cc0000;
    color: #cc0000;
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 1.5rem;
        padding: 2rem;
    }

    h2 {
        font-size: 2rem;
    }

    form label {
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="file"], /* Added file input here */
    select,
    textarea,
    button[type="submit"] {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 1rem;
    }

    #profile_preview {
        width: 130px;
        height: 130px;
    }

    #preview {
        max-width: 200px;
    }

    .image-preview-container img {
        width: 70px;
        height: 70px;
    }

    #skilled-section,
    #unskilled-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    form label {
        font-size: 1rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="file"], /* Added file input here */
    select,
    textarea,
    button[type="submit"] {
        font-size: 1rem;
        padding: 0.8rem 1rem;
    }

    .radio-group,
.checkbox-group {
        gap: 0.8rem;
    }

    .radio-group label,
    .checkbox-group label {
        font-size: 0.95rem;
    }

    .radio-group input[type="radio"],
    .checkbox-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .radio-group input[type="radio"]:checked::before,
    .checkbox-group input[type="checkbox"]:checked::before {
        font-size: 12px;
    }

    #profile_preview {
        width: 100px;
        height: 100px;
    }

    #preview {
        max-width: 150px;
    }

    .image-preview-container img {
        width: 50px;
        height: 50px;
    }

    #status {
        font-size: 1rem;
        margin-top: 1.5rem;
    }
}
