/**
 * Frontend Styles for Student Admission Manager
 * Version: 1.1.0
 */

/* * By using CSS variables, you can easily change the theme of the form 
 * by editing just these values.
 */
.sam-admission-container, .sam-modal {
    --sam-primary-color: #0073aa;
    --sam-primary-hover-color: #005f8d;
    --sam-border-color: #ccc;
    --sam-focus-color: #0073aa;
    --sam-border-radius: 4px;
}

/* === MODAL & OVERLAY === */
.sam-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 60px 15px;
    box-sizing: border-box;
}

.sam-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;
    position: relative;
    animation: samFadeIn 0.3s ease-out;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
}

.sam-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 26px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
}
.sam-close:hover { color: #000; }

/* === FORM STYLING === */
#sam-admission-form {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    color: #333;
}

#sam-admission-form label {
    font-weight: 600;
    margin: 15px 0 4px;
    display: block;
}

#sam-admission-form .sam-checkbox-label {
    font-weight: normal;
}

#sam-admission-form input[type="text"],
#sam-admission-form input[type="email"],
#sam-admission-form input[type="tel"],
#sam-admission-form input[type="date"],
#sam-admission-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--sam-border-color);
    border-radius: var(--sam-border-radius);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Add a focus style for better UX */
#sam-admission-form input:focus,
#sam-admission-form select:focus {
    border-color: var(--sam-focus-color);
    box-shadow: 0 0 0 1px var(--sam-focus-color);
    outline: none;
}

#sam-admission-form fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-top: 20px;
    border-radius: 6px;
}

#sam-admission-form fieldset legend {
    font-weight: bold;
    padding: 0 8px;
}

/* New grid layout for address fields */
.sam-address-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* === BUTTONS & SUBMISSION === */
.sam-open-form {
    background-color: var(--sam-primary-color);
    color: #fff;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--sam-border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.sam-open-form:hover {
    background-color: var(--sam-primary-hover-color);
}

#sam-submit-btn {
    width: 100%;
    margin-top: 20px;
    background-color: var(--sam-primary-color);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: var(--sam-border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s ease;
}
#sam-submit-btn:hover {
    background-color: var(--sam-primary-hover-color);
}
#sam-submit-btn:disabled {
    background-color: #d1d1d1;
    cursor: not-allowed;
}

/* Status Message Styling */
#sam-form-status { margin-top: 15px; }
.sam-error { color: #d9534f; border: 1px solid #d9534f; padding: 10px; border-radius: var(--sam-border-radius); }
.sam-success { text-align: center; border: 1px solid #5cb85c; padding: 15px; border-radius: var(--sam-border-radius); }
.sam-success p { font-weight: 600; color: #3c763d; }
.sam-success .button { text-decoration: none; margin-top: 10px; display: inline-block; background: #5cb85c; color: #fff; padding: 10px 15px; border-radius: var(--sam-border-radius); }

/* Responsive Adjustments */
@media screen and (max-width: 600px) {
    .sam-modal-content { padding: 20px; }
}

/* Animation */
@keyframes samFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}