/* Enhanced QR System Styles - Arabic RTL Support */

/* QR Code specific styles */
.qr-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 3px solid #e5e7eb;
    background-color: #ffffff;
    padding: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.qr-image:hover {
    transform: scale(1.02);
    border-color: #8b5cf6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.qr-image.loaded {
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading placeholder for images */
.qr-image.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Enhanced Arabic typography */
.arabic-text {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', system-ui, sans-serif;
    font-feature-settings: "liga" off;
    text-rendering: optimizeLegibility;
    direction: rtl;
    text-align: right;
}

/* RTL specific fixes */
.rtl .flex-reverse {
    flex-direction: row-reverse;
}

.rtl svg {
    margin-left: 0;
    margin-right: 0.5rem;
}

.rtl .ml-1 {
    margin-left: 0;
    margin-right: 0.25rem;
}

.rtl .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

.rtl .ml-3 {
    margin-left: 0;
    margin-right: 0.75rem;
}

/* Enhanced buttons */
.btn-enhanced {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backdrop-filter: blur(10px);
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:active {
    transform: translateY(1px);
}

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Statistics animations */
.stat-number {
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* QR Container enhancements */
.qr-container {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.qr-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #8b5cf6, #3b82f6, #10b981, #f59e0b);
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-container:hover::before {
    opacity: 1;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .qr-image {
        width: 200px;
        height: 200px;
    }
    
    .arabic-text {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .btn-enhanced {
        padding: 0.75rem 1.5rem;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .qr-image {
        max-width: 200px;
        max-height: 200px;
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .btn-enhanced {
        display: none;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn-enhanced:focus,
.qr-image:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Error state for missing QR images */
.qr-image[src=""], 
.qr-image:not([src]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Crect width='200' height='200' fill='%23f3f4f6'/%3E%3Ctext x='100' y='105' text-anchor='middle' fill='%239ca3af' font-family='sans-serif' font-size='16'%3EQR Code%3C/text%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Success animations */
.success-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
