/* =====================================================
   Unlock Meta | وسطاء ميتا
   Animations CSS
   ===================================================== */

/* AOS Custom Overrides */
[data-aos] {
    pointer-events: none;
}
[data-aos].aos-animate {
    pointer-events: auto;
}

/* Robust AOS fallback: never leave page content invisible if the AOS CDN is unavailable. */
body:not(.aos-ready) [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* =====================================================
   Particle / Orb Animations
   ===================================================== */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(8, 102, 255, 0.3), transparent);
    top: 10%;
    right: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 201, 255, 0.2), transparent);
    bottom: 10%;
    left: -5%;
    animation-delay: -4s;
    animation-duration: 15s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(8, 102, 255, 0.15), transparent);
    top: 50%;
    left: 40%;
    animation-delay: -8s;
    animation-duration: 18s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, -20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* =====================================================
   Shine Effect
   ===================================================== */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transform: rotate(15deg);
    animation: shineMove 4s infinite;
}

@keyframes shineMove {
    0% { left: -60%; }
    60%, 100% { left: 160%; }
}

/* =====================================================
   Count Up Animation
   ===================================================== */
.counter-value {
    display: inline-block;
    transition: all 0.1s ease;
}

/* =====================================================
   Typing Cursor
   ===================================================== */
.typing-cursor::after {
    content: '|';
    animation: typingBlink 0.8s infinite;
    color: var(--primary);
    font-weight: 300;
}

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

/* =====================================================
   Gradient Border Animation
   ===================================================== */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 200%;
    z-index: -1;
    animation: gradientRotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

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

/* =====================================================
   Wave Effect
   ===================================================== */
.wave-divider {
    position: relative;
    overflow: hidden;
}

.wave-divider::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60'%3E%3Cpath d='M0,30 C300,60 600,0 900,30 C1050,45 1150,15 1200,30 L1200,60 L0,60Z' fill='%23F5F9FF'/%3E%3C/svg%3E") no-repeat bottom center;
    background-size: cover;
}

/* =====================================================
   Hero Particles
   ===================================================== */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: particleFly 8s infinite;
}

@keyframes particleFly {
    0% { opacity: 0; transform: translateY(100px) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-200px) scale(1); }
}

/* =====================================================
   Ripple Effect
   ===================================================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to { transform: scale(4); opacity: 0; }
}

/* =====================================================
   Stagger Animation Helpers
   ===================================================== */
.stagger-1 { animation-delay: 0.1s !important; }
.stagger-2 { animation-delay: 0.2s !important; }
.stagger-3 { animation-delay: 0.3s !important; }
.stagger-4 { animation-delay: 0.4s !important; }
.stagger-5 { animation-delay: 0.5s !important; }
.stagger-6 { animation-delay: 0.6s !important; }

/* =====================================================
   Loading Spinner
   ===================================================== */
.spinner-meta {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(8, 102, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spinMeta 0.7s linear infinite;
}

@keyframes spinMeta {
    to { transform: rotate(360deg); }
}

/* =====================================================
   Skeleton Loading
   ===================================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 70%; margin-bottom: 16px; }
.skeleton-card { height: 200px; border-radius: var(--radius-lg); }

/* =====================================================
   Notification Badge Pulse
   ===================================================== */
.badge-pulse {
    position: relative;
}

.badge-pulse::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* =====================================================
   Hover Scale
   ===================================================== */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hover-scale:hover { transform: scale(1.05); }

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* =====================================================
   Text Reveal Animation
   ===================================================== */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: textRevealUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* =====================================================
   Custom Scrollbar
   ===================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(8, 102, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =====================================================
   Reduced Motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #loading-screen { display: none !important; }
    [data-aos] { opacity: 1 !important; transform: none !important; }
}

/* =====================================================
   Notification Toast Ticket (Desktop + Mobile)
   ===================================================== */

/* ---- Toast Ticket (pops from top-center / top-left) ---- */
.notif-toast-ticket {
    position: fixed;
    top: 80px;
    left: 24px;
    z-index: 99999;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(8, 102, 255, 0.28), 0 6px 24px rgba(0,0,0,0.15);
    overflow: hidden;
    transform: translateY(-120px) scale(0.92);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease;
    border: 1.5px solid rgba(8, 102, 255, 0.25);
}

.notif-toast-ticket.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.notif-toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 18px 14px;
}

.notif-toast-icon {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary, #0866FF), var(--primary-light, #4A90FF));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(8, 102, 255, 0.35);
    animation: bellRing 0.6s ease 0.4s both;
}

@keyframes bellRing {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(18deg); }
    30%  { transform: rotate(-16deg); }
    45%  { transform: rotate(12deg); }
    60%  { transform: rotate(-8deg); }
    80%  { transform: rotate(4deg); }
    100% { transform: rotate(0deg); }
}

.notif-toast-text {
    flex: 1;
    min-width: 0;
}

.notif-toast-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1C1E21;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-toast-msg {
    font-size: 0.8rem;
    color: #65676B;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-toast-close {
    background: none;
    border: none;
    color: #8A8D91;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    margin-top: -2px;
}

.notif-toast-close:hover {
    background: #F0F2F5;
    color: #1C1E21;
}

/* Animated progress bar at the bottom */
.notif-toast-progress {
    height: 3px;
    background: linear-gradient(90deg, var(--primary, #0866FF), var(--primary-light, #4A90FF));
    border-radius: 0 0 18px 18px;
    animation: toastTimer 6s linear forwards;
    transform-origin: right center;
}

@keyframes toastTimer {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Left-side accent stripe */
.notif-toast-ticket::before {
    content: '';
    position: absolute;
    right: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    background: linear-gradient(180deg, var(--primary, #0866FF), var(--primary-light, #4A90FF));
    border-radius: 4px 0 0 4px;
}

/* ---- Mobile Notification Ticket Cards ---- */
.notif-ticket-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    border: 1.5px solid #E4E6EA;
    background: #fff;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.notif-ticket-card:hover {
    border-color: var(--primary, #0866FF);
    box-shadow: 0 6px 24px rgba(8, 102, 255, 0.12);
    transform: translateY(-2px);
}

.notif-ticket-card.unread {
    border-color: rgba(8, 102, 255, 0.25);
    background: linear-gradient(135deg, #f0f6ff, #fafcff);
}

.notif-ticket-card.unread::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary, #0866FF), var(--primary-light, #4A90FF));
    border-radius: 0 16px 16px 0;
}

.notif-ticket-icon-wrap {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary, #0866FF), var(--primary-light, #4A90FF));
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 14px rgba(8, 102, 255, 0.28);
}

.notif-unread-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 11px;
    height: 11px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50%       { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.notif-ticket-content {
    flex: 1;
    min-width: 0;
}

.notif-ticket-head {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1C1E21;
    margin-bottom: 4px;
    line-height: 1.3;
}

.notif-ticket-body-text {
    font-size: 0.8rem;
    color: #65676B;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.notif-ticket-foot {
    font-size: 0.72rem;
    color: #8A8D91;
}

.notif-ticket-arrow {
    color: #C8CDD4;
    font-size: 0.75rem;
    align-self: center;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.notif-ticket-card:hover .notif-ticket-arrow {
    color: var(--primary, #0866FF);
    transform: translateX(-3px);
}

/* ---- Desktop Dropdown Notification Items ---- */
.dropdown-menu #notificationsList li a.dropdown-item {
    transition: background 0.2s;
}

.dropdown-menu #notificationsList .bg-primary-subtle {
    border-right: 3px solid var(--primary, #0866FF);
}

/* Mobile: stack toast at top center */
@media (max-width: 576px) {
    .notif-toast-ticket {
        left: 16px;
        right: 16px;
        width: auto;
        top: 75px;
    }
}
