/**
 * تنسيقات نافذة طلب تفعيل تتبع الموقع
 * MotionSpotter Location Permission Popup Styles
 */

/* أنيميشن النافذة المنبثقة */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* النافذة المنبثقة */
#locationPermissionPopup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
}

#locationPermissionPopup .backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

#popupContent {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideInUp 0.3s ease-out;
}

#popupContent.closing {
    animation: slideOutDown 0.3s ease-in;
}

/* تدرج الألوان المخصص */
.bg-gradient-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-gradient-error {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* تأثيرات الأزرار */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

/* تأثير النبض للزر الرئيسي */
#enableLocationBtn {
    position: relative;
    overflow: hidden;
}

#enableLocationBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#enableLocationBtn:hover::before {
    left: 100%;
}

/* مؤشر التحميل المخصص */
.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* تأثيرات الأيقونات */
.icon-bounce {
    animation: bounce 2s infinite;
}

.icon-pulse {
    animation: pulse 2s infinite;
}

/* رسائل الحالة */
.status-message {
    border-radius: 12px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.status-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #b8dacc;
    color: #155724;
}

.status-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #f1b0b7;
    color: #721c24;
}

.status-message.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffeaa7;
    color: #856404;
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 640px) {
    #popupContent {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .popup-header {
        padding: 1.5rem;
    }
    
    .popup-content {
        padding: 1.5rem;
    }
    
    .popup-footer {
        padding: 1rem 1.5rem;
    }
}

/* تحسينات للأجهزة اللوحية */
@media (min-width: 641px) and (max-width: 1024px) {
    #popupContent {
        max-width: 500px;
    }
}

/* تأثيرات التركيز للوصولية */
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* تحسينات للطباعة */
@media print {
    #locationPermissionPopup,
    #helpModal {
        display: none !important;
    }
}

/* تأثيرات الحركة المتقدمة */
.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-out-right {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* تأثيرات الخلفية المتحركة */
.animated-background {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* تحسينات الوصولية */
.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;
}

/* تأثيرات التمرير السلس */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* تحسينات للوضع المظلم */
@media (prefers-color-scheme: dark) {
    #locationPermissionPopup {
        color-scheme: dark;
    }
    
    #popupContent {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .popup-footer {
        background-color: #374151;
    }
}

/* تأثيرات الانتقال المتقدمة */
.transition-all-smooth {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* تحسينات الأداء */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* تأثيرات الظلال المتقدمة */
.shadow-glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.shadow-glow-green {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.shadow-glow-red {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}
