/* Custom styles for أمل للتشغيل الدولي */

/* Arabic font family with kerning */
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-feature-settings: 'kern';
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Container max-width utility */
.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Focus-visible outlines for better accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Mobile optimizations for small screens (<= 375px) */
@media (max-width: 375px) {
    /* Reduce padding on small screens */
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .px-8 {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    /* Adjust text sizes for better readability */
    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    .text-5xl {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
    
    .text-6xl {
        font-size: 2.5rem;
        line-height: 2.75rem;
    }
    
    /* Adjust button sizes */
    .px-8 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .py-3 {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }
    
    .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    /* Adjust spacing */
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    .space-y-6 > * + * {
        margin-top: 1rem;
    }
    
    .space-y-8 > * + * {
        margin-top: 1.25rem;
    }
    
    /* Adjust grid gaps */
    .gap-4 {
        gap: 0.75rem;
    }
    
    .gap-6 {
        gap: 1rem;
    }
    
    .gap-8 {
        gap: 1.25rem;
    }
    
    /* Ensure form elements are touch-friendly */
    input, select, textarea, button {
        min-height: 44px;
    }
    
    /* Adjust form grid for mobile */
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid.md\\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Adjust hero section for mobile */
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Adjust section padding */
    .py-16 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    /* Ensure proper text wrapping */
    .break-words {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #16a34a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #15803d;
}

/* Sticky navbar styles */
#navbar {
    transition: all 0.3s ease;
}

#navbar.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* FAQ Accordion styles */
.faq-item {
    transition: all 0.3s ease;
}

.faq-question {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

.faq-question:hover {
    background-color: #f3f4f6;
}

.faq-answer {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.faq-answer:not(.hidden) {
    max-height: 500px;
}

.faq-icon {
    transition: transform 0.3s ease;
    font-weight: bold;
    min-width: 24px;
    text-align: center;
}

/* Form Wizard Styles */
.form-step {
    transition: all 0.3s ease;
}

.form-step.hidden {
    display: none;
}

/* Form validation styles */
.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.error-message.hidden {
    display: none;
}

/* Form step transitions */
.form-step {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button states */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* File input styling */
input[type="file"] {
    border: 2px dashed #d1d5db;
    transition: border-color 0.3s ease;
    background-color: #f9fafb;
}

input[type="file"]:hover {
    border-color: #16a34a;
    background-color: #f0fdf4;
}

input[type="file"]:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background-color: #f0fdf4;
}

/* Checkbox styling */
input[type="checkbox"] {
    accent-color: #16a34a;
}

/* Form field focus states */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Additional utility classes */
.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

/* Ensure proper RTL spacing */
[dir="rtl"] .space-x-2 > * + * {
    margin-right: 0.5rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-4 > * + * {
    margin-right: 1rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-6 > * + * {
    margin-right: 1.5rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-8 > * + * {
    margin-right: 2rem;
    margin-left: 0;
}

/* Focus states for better accessibility */
.focus-ring:focus {
    outline: 2px solid #16a34a;
    outline-offset: 2px;
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
    button, a, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve button spacing on mobile */
    .flex.flex-col.sm\\:flex-row.gap-4 {
        gap: 0.75rem;
    }
}

/* Form focus styles */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* File input styling */
input[type="file"] {
    border: 2px dashed #d1d5db;
    transition: border-color 0.3s ease;
}

input[type="file"]:hover {
    border-color: #16a34a;
}

input[type="file"]:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #16a34a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile menu animation */
.mobile-menu {
    transition: all 0.3s ease;
}

.mobile-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.mobile-menu:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Success/Error message animations */
.message {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL specific adjustments */
[dir="rtl"] .space-x-4 > * + * {
    margin-right: 1rem;
    margin-left: 0;
}

[dir="rtl"] .space-x-reverse > * + * {
    margin-right: 0;
    margin-left: 1rem;
}

/* Form validation styles */
.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Custom checkbox and radio styles */
input[type="checkbox"],
input[type="radio"] {
    accent-color: #16a34a;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-primary {
        background-color: #000 !important;
    }
    
    .text-primary {
        color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
