/* Arabic RTL Support */
body {
    direction: rtl;
    font-family: 'Cairo', 'Arial', sans-serif;
}

/* Custom Arabic Typography */
.auth-title,
.auth-form-title,
.auth-subtitle,
.auth-form-subtitle {
    font-family: 'Cairo', 'Arial', sans-serif;
    font-weight: 700;
}

/* Form Input RTL Support */
.form-control {
    text-align: right;
    direction: rtl;
}

.form-control::placeholder {
    text-align: right;
    direction: rtl;
}

/* Button RTL Support */
.btn {
    font-family: 'Cairo', 'Arial', sans-serif;
    font-weight: 600;
}

/* Label RTL Support */
.form-label {
    font-family: 'Cairo', 'Arial', sans-serif;
    font-weight: 600;
    text-align: right;
}

/* Alert RTL Support */
.alert {
    text-align: right;
    direction: rtl;
}

/* Notification RTL Support */
.position-fixed {
    text-align: right;
    direction: rtl;
}

/* Custom Animations for Arabic */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-left {
    animation: slideInLeft 0.8s ease-out;
}

.auth-right {
    animation: slideInRight 0.8s ease-out;
}

/* Custom Loading Animation */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Larkon Theme Form Controls - Original Colors and Borders */
.form-control {
    border: 1px solid #d8dfe7 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    background: white !important;
}

.form-control:focus {
    border-color: #ff6c2f !important;
    box-shadow: 0 0 0 4px rgba(255, 108, 47, 0.15) !important;
    background: white !important;
    outline: none !important;
}

.form-control.is-invalid {
    border-color: #ef5f5f !important;
    box-shadow: 0 0 0 4px rgba(239, 95, 95, 0.15) !important;
}

.form-control.is-valid {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15) !important;
}

/* Larkon Theme Checkbox - Original Orange */
.form-check-input {
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #d8dfe7 !important;
    border-radius: 4px !important;
    background-color: white !important;
    transition: all 0.3s ease !important;
    accent-color: #ff6c2f !important;
}

.form-check-input:checked {
    background-color: #ff6c2f !important;
    border-color: #ff6c2f !important;
}

.form-check-input:focus {
    border-color: #ff6c2f !important;
    box-shadow: 0 0 0 4px rgba(255, 108, 47, 0.15) !important;
    outline: none !important;
}

.form-check-input:hover {
    border-color: #ff6c2f !important;
}

.form-check-label {
    font-weight: 500 !important;
    color: #2c3e50 !important;
    margin-right: 8px !important;
    font-family: 'Cairo', 'Arial', sans-serif !important;
}

/* Larkon Theme Button Colors - Original Orange */
.btn-soft-primary {
    background: rgba(255, 108, 47, 0.1) !important;
    color: #ff6c2f !important;
    border: 1px solid rgba(255, 108, 47, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-soft-primary:hover {
    background: #ff6c2f !important;
    color: white !important;
    border-color: #ff6c2f !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 108, 47, 0.3) !important;
}

.btn-soft-dark {
    background: rgba(52, 58, 64, 0.1) !important;
    color: #343a40 !important;
    border: 1px solid rgba(52, 58, 64, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-soft-dark:hover {
    background: #343a40 !important;
    color: white !important;
    border-color: #343a40 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(52, 58, 64, 0.3) !important;
}

/* Additional Larkon Theme Button Colors */
.btn-soft-success {
    background: rgba(40, 167, 69, 0.1) !important;
    color: #28a745 !important;
    border: 1px solid rgba(40, 167, 69, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-soft-success:hover {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.btn-soft-warning {
    background: rgba(255, 193, 7, 0.1) !important;
    color: #ffc107 !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-soft-warning:hover {
    background: #ffc107 !important;
    color: #212529 !important;
    border-color: #ffc107 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
}

.btn-soft-danger {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-soft-danger:hover {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.btn-soft-info {
    background: rgba(23, 162, 184, 0.1) !important;
    color: #17a2b8 !important;
    border: 1px solid rgba(23, 162, 184, 0.2) !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.btn-soft-info:hover {
    background: #17a2b8 !important;
    color: white !important;
    border-color: #17a2b8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3) !important;
}

/* Custom Error States */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.15);
}

/* Custom Success States */
.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

/* Mobile Optimizations */
@media (max-width: 576px) {
    .auth-container {
        padding: 10px;
    }
    
    .auth-card {
        margin: 0;
        border-radius: 10px;
    }
    
    .auth-left,
    .auth-right {
        padding: 20px 15px;
    }
    
    .auth-title {
        font-size: 1.8rem;
    }
    
    .auth-form-title {
        font-size: 1.4rem;
    }
    
    .form-control {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Tablet Optimizations */
@media (min-width: 577px) and (max-width: 768px) {
    .auth-card {
        margin: 20px;
    }
    
    .auth-left {
        padding: 40px 30px;
    }
    
    .auth-right {
        padding: 40px 30px;
    }
}

/* Desktop Optimizations */
@media (min-width: 1200px) {
    .auth-card {
        max-width: 1400px;
    }
    
    .auth-left {
        padding: 80px 60px;
    }
    
    .auth-right {
        padding: 80px 60px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .auth-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .auth-container {
        background: white !important;
    }
    
    .auth-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .auth-left {
        background: white !important;
        color: black !important;
    }
}

/* Accessibility Improvements */
.form-control:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Custom Scrollbar for Webkit Browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* Custom Selection */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #2c3e50;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.2);
    color: #2c3e50;
}
