/* Enhanced iOS Picker Styles - تحسينات شاملة للتصميم والأداء */

/* iOS Date Picker Container - محسن */
.ios-date-picker {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.ios-date-picker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.ios-date-picker:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 6px 15px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Picker Columns Layout - تحسين التخطيط */
.ios-picker-columns {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    min-height: 220px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    flex-wrap: nowrap;
}

.ios-picker-column {
    flex: 1;
    max-width: 80px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ios-picker-column:hover {
    transform: scale(1.02);
}

/* Enhanced iOS Picker Styles */
.enhanced-ios-picker {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.06),
        inset 0 -1px 0 rgba(255, 255, 255, 0.9);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.enhanced-ios-picker:hover {
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.9),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mask Gradients - تحسين التدرجات */
.picker-mask-top,
.picker-mask-bottom {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.3s ease;
}

.picker-mask-top {
    top: 0;
    height: 88px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(255, 255, 255, 0.95) 20%,
        rgba(255, 255, 255, 0.8) 40%, 
        rgba(255, 255, 255, 0.4) 70%,
        rgba(255, 255, 255, 0.1) 90%,
        transparent 100%);
}

.picker-mask-bottom {
    bottom: 0;
    height: 88px;
    background: linear-gradient(to top, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(255, 255, 255, 0.95) 20%,
        rgba(255, 255, 255, 0.8) 40%, 
        rgba(255, 255, 255, 0.4) 70%,
        rgba(255, 255, 255, 0.1) 90%,
        transparent 100%);
}

/* Selection Indicator - مؤشر التحديد المحسن */
.picker-selection-indicator {
    position: absolute;
    left: 6px;
    right: 6px;
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.08) 0%, 
        rgba(0, 122, 255, 0.12) 50%,
        rgba(0, 122, 255, 0.08) 100%);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 10px;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 2px 8px rgba(0, 122, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.picker-selection-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    border-radius: 9px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Options Container - حاوية الخيارات المحسنة */
.picker-options-container {
    position: relative;
    padding: 88px 0;
    cursor: grab;
    outline: none;
    will-change: transform;
    transition: none;
}

.picker-options-container:active {
    cursor: grabbing;
}

.picker-options-container:focus {
    outline: 2px solid #007AFF;
    outline-offset: -2px;
    border-radius: 8px;
}

/* Enhanced Picker Options */
.enhanced-picker-option {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 400;
    color: #1a1a1a;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.01em;
}

.enhanced-picker-option:hover {
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.05) 0%, 
        rgba(0, 122, 255, 0.08) 100%);
    transform: scale(1.02);
    color: #007AFF;
}

.enhanced-picker-option.selected {
    color: #007AFF;
    font-weight: 600;
    transform: scale(1.08);
    text-shadow: 0 0 12px rgba(0, 122, 255, 0.3);
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.08) 0%, 
        rgba(0, 122, 255, 0.12) 100%);
    border: 1px solid rgba(0, 122, 255, 0.2);
    box-shadow: 
        0 2px 8px rgba(0, 122, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.enhanced-picker-option.adjacent {
    opacity: 0.75;
    transform: scale(0.96);
    color: #666;
}

.enhanced-picker-option.distant {
    opacity: 0.45;
    transform: scale(0.92);
    color: #999;
}

.enhanced-picker-option.focused {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.1) 0%, 
        rgba(0, 122, 255, 0.15) 100%);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* Animation Classes - فئات الرسوم المتحركة */
.picker-option-selecting {
    animation: selectPulse 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes selectPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
    }
    50% { 
        transform: scale(1.12); 
        box-shadow: 0 0 0 8px rgba(0, 122, 255, 0.2);
    }
    100% { 
        transform: scale(1.08); 
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    }
}

/* Haptic Feedback Animation */
.picker-haptic-feedback {
    animation: hapticPulse 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes hapticPulse {
    0% { 
        transform: scale(1); 
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.05); 
        filter: brightness(1.1);
    }
    100% { 
        transform: scale(1); 
        filter: brightness(1);
    }
}

/* Scrolling State */
.picker-scrolling .picker-selection-indicator {
    box-shadow: 
        0 0 20px rgba(0, 122, 255, 0.4),
        0 2px 8px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.12) 0%, 
        rgba(0, 122, 255, 0.18) 50%,
        rgba(0, 122, 255, 0.12) 100%);
}

.picker-scrolling .enhanced-picker-option.selected {
    animation: scrollingPulse 0.6s ease-in-out infinite;
}

@keyframes scrollingPulse {
    0%, 100% { 
        text-shadow: 0 0 12px rgba(0, 122, 255, 0.3);
    }
    50% { 
        text-shadow: 0 0 20px rgba(0, 122, 255, 0.5);
    }
}

/* Date Picker Specific Styles */
.date-picker-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.date-picker-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.date-picker-subtitle {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

/* Action Buttons */
.date-picker-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.date-picker-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.date-picker-btn::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.5s;
}

.date-picker-btn:hover::before {
    left: 100%;
}

.date-picker-btn.primary {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.date-picker-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.date-picker-btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.date-picker-btn.secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.date-picker-btn.secondary:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ios-date-picker {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .ios-picker-columns {
        gap: 6px;
        min-height: 160px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .ios-picker-column {
        flex: 1;
        min-width: 0;
    }
    
    .enhanced-picker-option {
        font-size: 16px;
        height: 40px;
    }
    
    .picker-mask-top,
    .picker-mask-bottom {
        height: 80px;
    }
    
    .picker-options-container {
        padding: 80px 0;
    }
    
    .date-picker-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .date-picker-btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .ios-date-picker {
        padding: 16px 12px;
    }
    
    .ios-picker-columns {
        gap: 4px;
        min-height: 140px;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .ios-picker-column {
        flex: 1;
        min-width: 0;
    }
    
    .enhanced-picker-option {
        font-size: 15px;
        height: 36px;
    }
    
    .picker-mask-top,
    .picker-mask-bottom {
        height: 72px;
    }
    
    .picker-options-container {
        padding: 72px 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .enhanced-ios-picker {
        background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .picker-mask-top {
        background: linear-gradient(to bottom, 
            rgba(28, 28, 30, 0.98) 0%, 
            rgba(28, 28, 30, 0.95) 20%,
            rgba(28, 28, 30, 0.8) 40%, 
            rgba(28, 28, 30, 0.4) 70%,
            rgba(28, 28, 30, 0.1) 90%,
            transparent 100%);
    }
    
    .picker-mask-bottom {
        background: linear-gradient(to top, 
            rgba(28, 28, 30, 0.98) 0%, 
            rgba(28, 28, 30, 0.95) 20%,
            rgba(28, 28, 30, 0.8) 40%, 
            rgba(28, 28, 30, 0.4) 70%,
            rgba(28, 28, 30, 0.1) 90%,
            transparent 100%);
    }
    
    .enhanced-picker-option {
        color: #ffffff;
    }
    
    .enhanced-picker-option.adjacent {
        color: #ababab;
    }
    
    .enhanced-picker-option.distant {
        color: #666666;
    }
    
    .ios-date-picker {
        background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    }
    
    .date-picker-title {
        color: #ffffff;
    }
    
    .date-picker-subtitle {
        color: #ababab;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .enhanced-picker-option.selected {
        background: #007AFF;
        color: white;
        border: 2px solid #ffffff;
    }
    
    .picker-selection-indicator {
        border: 2px solid #007AFF;
        background: rgba(0, 122, 255, 0.2);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .enhanced-picker-option,
    .picker-selection-indicator,
    .date-picker-btn,
    .ios-date-picker {
        transition: none;
        animation: none;
    }
    
    .picker-option-selecting,
    .picker-haptic-feedback {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .ios-date-picker {
        box-shadow: none;
        border: 1px solid #000;
        background: white;
    }
    
    .picker-mask-top,
    .picker-mask-bottom {
        display: none;
    }
    
    .enhanced-picker-option.selected {
        background: #f0f0f0;
        color: #000;
        font-weight: bold;
    }
}

