/* Animated Splash Screen Widget CSS */
.animated-splash-container {
    position: relative;
    width: 100%;
    background: #fff;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    /* متغيرات افتراضية يمكن تغييرها عبر JS */
    --close-duration: 0.5s;
}

/* Fixed Position (Full Screen Overlay) */
.splash-fixed {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: 100vw;
    z-index: 99999; /* زيادة الـ z-index للتأكد من تغطية المنيو والهيدر */
}

/* Relative Position */
.splash-relative {
    position: relative;
}

/* Animation Layers */
.animated-splash-layer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    z-index: 1;
    animation: slideToFinish forwards;
}

@keyframes slideToFinish {
    to { width: 100%; }
}

.animated-splash-layer.final-splash-layer {
    z-index: 2 !important;
}

/* Content Styling */
.animated-splash-content {
    color: white;
    position: relative;
    z-index: 10;
    opacity: 0;
    animation: fadeInContent 0.5s ease forwards;
    padding: 20px;
    text-align: center;
}

@keyframes fadeInContent {
    to { opacity: 1; }
}

/* Close Hint (زر الإغلاق أو النص السفلي) */
.splash-close-hint {
    font-size: 14px;
    opacity: 0.8;
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    transition: all 0.3s ease;
    margin-top: 20px;
    cursor: pointer;
}

.splash-close-hint:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* --- Close Animations Logic --- */

/* عند بدء الإغلاق، نمنع أي نقرات إضافية */
.animated-splash-container.is-closing {
    pointer-events: none;
}

/* تطبيق الأنميشن بناءً على الكلاس المضاف بواسطة JS */
.animated-splash-container.exit-fade {
    animation: fadeOut var(--close-duration) ease forwards;
}

.animated-splash-container.exit-slide-up {
    animation: slideUp var(--close-duration) cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.animated-splash-container.exit-slide-down {
    animation: slideDown var(--close-duration) cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.animated-splash-container.exit-zoom-out {
    animation: zoomOut var(--close-duration) ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

@keyframes slideUp {
    to { transform: translateY(-100%); opacity: 0.8; }
}

@keyframes slideDown {
    to { transform: translateY(100%); opacity: 0.8; }
}

@keyframes zoomOut {
    to { transform: scale(1.2); opacity: 0; visibility: hidden; }
}

/* Clickable container styling */
.animated-splash-container.splash-fixed[data-click-to-close="true"] {
    cursor: pointer;
}

/* تحسين تجربة المستخدم: منع اختيار النصوص أثناء العرض لتجنب التظليل العرضي عند النقر للإغلاق */
.animated-splash-container {
    user-select: none;
    -webkit-user-select: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .animated-splash-content h1 { font-size: 32px; }
    .animated-splash-content p { font-size: 16px; }
}