/* MCA Portal CSS - Version: 2025-09-29 22:56:16 - Cache Busted */
/**
 * Mobile vs Desktop Form Compatibility Styles
 * Fixes styling differences between mobile and desktop browsers
 */

/* Mobile-specific input fixes */
@media (max-width: 768px) {
    /* Prevent zoom on iOS when focusing inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 4px;
        padding: 12px !important;
        line-height: 1.4;
    }
    
    /* Fix select dropdowns on mobile */
    select {
        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23666' d='m2 0-2 2h4zm0 5 2-2h-4z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px;
        padding-right: 40px !important;
    }
    
    /* Touch-friendly button sizes */
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
        border-radius: 8px;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        touch-action: manipulation;
    }
    
    /* Fix checkbox and radio button sizes */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px !important;
        height: 20px !important;
        margin-right: 8px;
        -webkit-appearance: none;
        appearance: none;
        border: 2px solid #bd8c91;
        border-radius: 3px;
        background-color: white;
        position: relative;
    }
    
    input[type="checkbox"]:checked {
        background-color: #7a222b;
        border-color: #7a222b;
    }
    
    input[type="checkbox"]:checked::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: white;
        font-size: 14px;
        font-weight: bold;
    }
    
    input[type="radio"] {
        border-radius: 50%;
    }
    
    input[type="radio"]:checked {
        background-color: #7a222b;
        border-color: #7a222b;
    }
    
    input[type="radio"]:checked::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: white;
    }
    
    /* Improve form layout on mobile */
    .input-field {
        margin-bottom: 20px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .input-field label {
        margin-bottom: 8px !important;
        margin-right: 0 !important;
        font-size: 16px !important;
        font-weight: 500;
    }
    
    .input-field input,
    .input-field select,
    .input-field textarea {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Fix table layouts on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better error message display */
    .error-message,
    .validation-message {
        display: block !important;
        color: #9a3a44 !important;
        font-size: 14px !important;
        margin-top: 5px !important;
        padding: 5px 10px;
        background-color: rgba(154, 58, 68, 0.1);
        border-left: 3px solid #9a3a44;
        border-radius: 3px;
        animation: slideIn 0.3s ease-out;
    }
    
    /* Invalid field styling */
    .invalid {
        border-color: #9a3a44 !important;
        box-shadow: 0 0 5px rgba(154, 58, 68, 0.3) !important;
        background-color: rgba(154, 58, 68, 0.05) !important;
    }
    
    /* Progress bar mobile fixes */
    .progress-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .progress-step {
        flex: 0 0 auto;
        margin: 0 5px;
    }
    
    .step-circle {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    
    .step-title {
        font-size: 12px !important;
        width: 80px !important;
        top: 45px !important;
    }
    
    /* Form step mobile layout */
    .form-step {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        margin-bottom: 20px;
        padding: 20px;
        background-color: rgba(244, 233, 234, 0.95);
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .form-step:not(.active) {
        display: none;
    }
    
    /* Modal fixes for mobile */
    .modal {
        padding: 20px !important;
        align-items: flex-start !important;
        padding-top: 50px;
    }
    
    .modal-content {
        width: 90% !important;
        max-width: 400px !important;
        margin: 0 auto;
    }
    
    /* Button group spacing */
    .form-navigation,
    .button-group {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 20px;
    }
    
    .btn-next,
    .btn-prev,
    .submit-btn {
        flex: 1;
        max-width: 150px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .enrollment-form {
        padding: 15px !important;
        margin: 10px !important;
        width: calc(100% - 20px) !important;
    }
    
    .header {
        padding: 15px 10px !important;
    }
    
    .school-logo img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .school-name h2 {
        font-size: 18px !important;
    }
    
    .school-name p {
        font-size: 14px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 16px !important;
    }
    
    /* Single column layout for form fields */
    .student-info,
    .other-info {
        flex-direction: column !important;
    }
    
    .student-info input,
    .other-info input {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    /* Stack radio buttons vertically */
    .radio-group {
        flex-direction: column !important;
        gap: 10px;
    }
    
    .radio-container {
        display: flex;
        align-items: center;
        margin: 5px 0;
    }
}

/* Landscape mobile fixes */
@media (max-width: 768px) and (orientation: landscape) {
    .enrollment-form {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    .form-step {
        padding: 15px !important;
    }
    
    .header {
        padding: 10px !important;
        margin-bottom: 15px !important;
    }
}

/* Animation keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Focus improvements for accessibility */
input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: 2px solid #7a222b !important;
    outline-offset: 2px;
}

/* Loading state for buttons */
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Success state */
.success-message {
    color: #28a745 !important;
    background-color: rgba(40, 167, 69, 0.1) !important;
    border-left: 3px solid #28a745 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    input,
    select,
    textarea {
        border-width: 2px !important;
    }
    
    .invalid {
        border-width: 3px !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
