/* Modern Card Design */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    /* transition: transform 0.2s, box-shadow 0.2s; */
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,.05);
    padding: 1.25rem 1.5rem;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.card-header i {
    margin-right: 0.5rem;
    color: #4e73df;
}

/* Student Info Box */
.student-info-box {
    background-color: #f8f9fc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4e73df;
}

.student-info-box h2 {
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #4e73df;
}

.student-info-box p {
    margin-bottom: 0.25rem;
    color: #5a5c69;
}

.student-info-box .badge {
    margin-left: 0.5rem;
}

/* Form Elements */
.form-control {
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d3e2 !important;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #4e73df !important;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25) !important;
    outline: none;
}

.form-control:hover {
    border-color: #a5b4fc !important;
}

.form-select {
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d3e2 !important;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus {
    border-color: #4e73df !important;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25) !important;
    outline: none;
}

.form-select:hover {
    border-color: #a5b4fc !important;
}

.input-group-text {
    background-color: #f8f9fc;
    border: 1px solid #d1d3e2;
    border-radius: 0.375rem;
}

/* Fieldset Design */
fieldset {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.05);
}

legend {
    width: auto;
    padding: 0 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #4e73df;
    position: relative;
}

legend::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: #4e73df;
    border-radius: 3px;
}

/* Button Styles */
.btn {
    border-radius: 0.375rem;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2e59d9;
    transform: translateY(-2px);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(46, 89, 217, 0.2);
}

.btn-outline-primary {
    color: #4e73df;
    border-color: #4e73df;
}

.btn-outline-primary:hover {
    background-color: #4e73df;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(46, 89, 217, 0.2);
}

.rounded-pill {
    border-radius: 50px !important;
}

/* Badge Design */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 30px;
}

/* Alert Styles */
.alert {
    border-radius: 0.375rem;
    padding: 1rem 1.25rem;
    border: none;
    margin-bottom: 1.5rem;
}

.alert-info {
    background-color: rgba(54, 185, 204, 0.1);
    color: #36b9cc;
    border-left: 4px solid #36b9cc;
}

.alert-danger {
    background-color: rgba(231, 74, 59, 0.1);
    color: #e74a3b;
    border-left: 4px solid #e74a3b;
}

/* Photo Upload Component Styles */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-preview-wrapper {
    position: relative;
    /* make responsive: fill available width but cap to a comfortable max */
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1; /* keep square */
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.photo-preview-wrapper:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.student-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.initials-text {
    font-size: 5rem;
}

.photo-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-preview-wrapper:hover .photo-upload-overlay {
    opacity: 1;
}

.photo-upload-overlay i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.photo-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.photo-requirements {
    width: 100%;
    max-width: 300px;
    text-align: center;
}

/* Alert box styling for photo requirements */
.alert-info {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.alert-info ul {
    padding-left: 1.5rem;
}

.alert-info li {
    margin-bottom: 0.25rem;
}

/* Form Check */
.form-check-input:checked {
    background-color: #4e73df;
    border-color: #4e73df;
}

.form-check-label {
    font-weight: 500;
    padding-left: 0.5rem;
}

/* Required Field Indicator */
.text-danger {
    color: #e74a3b !important;
}

/* Edit Button */
#editButton {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

/* Assessment Info Box */
.assessment-info {
    background-color: #f8f9fc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4e73df;
}

.assessment-info h2 {
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #4e73df;
}

.assessment-info p {
    margin-bottom: 0.25rem;
    color: #5a5c69;
}

.assessment-info .badge {
    margin-left: 0.5rem;
}

/* Form validation styling */
.is-invalid {
    border: 2px solid #e74a3b !important;
    padding-right: calc(1.5em + 0.75rem) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e74a3b'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e74a3b' stroke='none'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
}

.is-invalid:focus {
    border: 2px solid #e74a3b !important;
    box-shadow: 0 0 0 0.25rem rgba(231, 74, 59, 0.25) !important;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #e74a3b;
}

/* Select2 Customization */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #d1d3e2 !important;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    height: auto;
    min-height: calc(1.5em + 0.75rem + 2px);
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border: 2px solid #4e73df !important;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25) !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #d1d3e2;
    border-radius: 0.375rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__option--highlighted[aria-selected] {
    background-color: #4e73df;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-down {
    animation: slideDown 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    fieldset {
        padding: 1rem;
    }
    
    .student-info-box, .assessment-info {
        padding: 1rem;
    }
    
    .student-info-box h2, .assessment-info h2 {
        font-size: 1.5rem;
    }
    
    .photo-preview-wrapper {
        max-width: 250px;
        aspect-ratio: 1 / 1;
    }
    
    .initials-text {
        font-size: 4rem;
    }
    
    #editButton {
        top: 1rem;
        right: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
    }
    
    legend {
        font-size: 1.1rem;
    }
    
    .photo-requirements {
        max-width: 250px;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    /* Mobile photo section centering */
    .row.mb-3.justify-content-center.align-items-center {
        text-align: center !important;
    }
    
    .row.mb-3.justify-content-center.align-items-center .col-12 {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .photo-upload-container {
        margin: 0 auto !important;
        text-align: center !important;
    }
}

@media (max-width: 575.98px) {
    .photo-preview-wrapper {
        max-width: 200px;
        aspect-ratio: 1 / 1;
    }
    
    .initials-text {
        font-size: 3rem;
    }
    
    .photo-upload-overlay i {
        font-size: 2rem;
    }
    
    .photo-requirements {
        max-width: 200px;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    /* Extra small screen centering */
    .row.mb-3.justify-content-center.align-items-center {
        display: block !important;
        text-align: center !important;
    }
    
    .row.mb-3.justify-content-center.align-items-center .col-12 {
        display: block !important;
        text-align: center !important;
        margin: 0 auto !important;
        float: none !important;
        padding: 0 15px !important;
        margin-bottom: 1rem !important;
    }
    
    fieldset {
        padding: 0.75rem;
    }
    
    legend {
        font-size: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Ensure disabled fields still have visible borders */
.form-control:disabled, .form-select:disabled {
    background-color: #f8f9fc;
    opacity: 0.65;
    border: 1px solid #d1d3e2 !important;
}

/* Ensure enabled fields have visible borders */
.form-control:enabled, .form-select:enabled {
    border: 1px solid #d1d3e2 !important;
}

/* Additional form control states */
.form-control:not(:focus):not(:disabled) {
    border: 1px solid #d1d3e2 !important;
}

.form-select:not(:focus):not(:disabled) {
    border: 1px solid #d1d3e2 !important;
}

/* Ensure Select2 elements maintain borders when enabled */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #d1d3e2 !important;
}

/* Override any Bootstrap defaults that might remove borders */
.form-control, .form-select {
    border: 1px solid #d1d3e2 !important;
}

.form-control:focus, .form-select:focus {
    border: 2px solid #4e73df !important;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25) !important;
}

/* Ensure borders are always visible */
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], 
select, textarea {
    border: 1px solid #d1d3e2 !important;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, 
input[type="date"]:focus, select:focus, textarea:focus {
    border: 2px solid #4e73df !important;
    box-shadow: 0 0 0 0.25rem rgba(78, 115, 223, 0.25) !important;
    outline: none !important;
}

/* End of CSS */