/**
 * Frontend Styles for Visa Forms
 *
 * Note: Most styles are inline for better Elementor compatibility,
 * but these are additional enhancements
 */

/* Form container enhancements */
.avf-form-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Loading state */
.avf-form.avf-form-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Field validation states */
.avf-field-wrapper.avf-field-has-error input,
.avf-field-wrapper.avf-field-has-error select,
.avf-field-wrapper.avf-field-has-error textarea {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
}

.avf-field-error {
    animation: slideDown 0.3s ease;
}

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

/* Form message animations */
.avf-form-message {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Submit button states */
.avf-submit-button:active {
    transform: translateY(-1px) !important;
}

.avf-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.avf-submit-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* File upload button enhancement */
input[type="file"]::-webkit-file-upload-button {
    padding: 8px 15px;
    background: #2036A4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.3s;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #1a2d89;
}

/* Radio and checkbox custom styles */
input[type="radio"]:checked {
    accent-color: #2036A4;
}

input[type="checkbox"]:checked {
    accent-color: #2036A4;
}

/* Focus states for accessibility */
.avf-form input:focus,
.avf-form select:focus,
.avf-form textarea:focus {
    outline: none;
}

.avf-form input:focus-visible,
.avf-form select:focus-visible,
.avf-form textarea:focus-visible {
    outline: 2px solid #2036A4;
    outline-offset: 2px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .avf-form-container {
        padding: 20px 15px !important;
        border-radius: 8px !important;
    }

    .avf-field-label {
        font-size: 14px !important;
    }

    .avf-form input,
    .avf-form select,
    .avf-form textarea {
        font-size: 14px !important;
    }

    .avf-submit-button {
        font-size: 14px !important;
        padding: 12px 30px !important;
    }
}

@media (max-width: 480px) {
    .avf-form-container {
        box-shadow: none !important;
        border: 1px solid #e0e0e0;
    }

    .avf-radio-group,
    .avf-checkbox-group {
        gap: 10px !important;
    }
}

/* Print styles */
@media print {
    .avf-submit-button,
    .avf-form-actions {
        display: none;
    }
}

/* RTL support */
[dir="rtl"] .avf-form {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .avf-required-star {
    margin-left: 0;
    margin-right: 3px;
}

/* Accessibility enhancements */
.avf-form label {
    cursor: pointer;
}

.avf-form input:disabled,
.avf-form select:disabled,
.avf-form textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Skip to form errors (for screen readers) */
.avf-skip-to-errors {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.avf-skip-to-errors:focus {
    position: static;
    width: auto;
    height: auto;
}

/* Loading overlay */
.avf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.avf-loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #2036A4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Elementor compatibility */
.elementor-widget-container .avf-form-container {
    max-width: 100%;
}

/* Success checkmark animation */
.avf-success-checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    color: white;
    text-align: center;
    line-height: 20px;
    margin-right: 8px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Error icon animation */
.avf-error-icon {
    display: inline-block;
    margin-right: 8px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
