/**
 * Mobile Navigation - Advanced Animations & Effects
 * 
 * @package Romak
 * @author Alireza Aminzadeh
 */

/* ==========================================================================
   Entrance Animation
   ========================================================================== */
@keyframes slideUpFadeIn {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-bottom-nav {
    animation: slideUpFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

/* ==========================================================================
   Item Stagger Animation
   ========================================================================== */
@keyframes itemPopIn {
    0% {
        transform: scale(0.3) translateY(20px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.mobile-nav-item {
    animation: itemPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.mobile-nav-item:nth-child(1) {
    animation-delay: 0.3s;
}

.mobile-nav-item:nth-child(2) {
    animation-delay: 0.35s;
}

.mobile-nav-item:nth-child(3) {
    animation-delay: 0.4s;
}

.mobile-nav-item:nth-child(4) {
    animation-delay: 0.45s;
}

.mobile-nav-item:nth-child(5) {
    animation-delay: 0.5s;
}

/* ==========================================================================
   Floating Animation for Active Item
   ========================================================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(-4px);
    }
    50% {
        transform: translateY(-6px);
    }
}

.mobile-nav-item.active {
    animation: float 2s ease-in-out infinite;
}

/* ==========================================================================
   Shine Effect on Hover
   ========================================================================== */
@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.mobile-nav-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shine 0.6s ease-out;
    pointer-events: none;
}

/* ==========================================================================
   Magnetic Effect
   ========================================================================== */
.mobile-nav-item {
    will-change: transform;
}

/* ==========================================================================
   Loading Skeleton (when page loads)
   ========================================================================== */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
    }
}

.mobile-bottom-nav.loading .mobile-nav-item {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Badge Notification (for future use)
   ========================================================================== */
.mobile-nav-item[data-badge]::before {
    content: attr(data-badge);
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    box-shadow: 
        0 2px 8px rgba(255, 71, 87, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: badge-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

@keyframes badge-bounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Icon Rotation on Active
   ========================================================================== */
@keyframes rotate-icon {
    0% {
        transform: rotate(0deg) scale(1.15);
    }
    50% {
        transform: rotate(180deg) scale(1.15);
    }
    100% {
        transform: rotate(360deg) scale(1.15);
    }
}

.mobile-nav-item.active:active svg {
    animation: rotate-icon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Glow Wave Effect
   ========================================================================== */
@keyframes glow-wave {
    0% {
        box-shadow: 
            0 0 5px rgba(30, 84, 71, 0.2),
            0 0 10px rgba(30, 84, 71, 0.1);
    }
    50% {
        box-shadow: 
            0 0 15px rgba(30, 84, 71, 0.4),
            0 0 25px rgba(30, 84, 71, 0.2);
    }
    100% {
        box-shadow: 
            0 0 5px rgba(30, 84, 71, 0.2),
            0 0 10px rgba(30, 84, 71, 0.1);
    }
}

.mobile-nav-item.active {
    animation: 
        float 2s ease-in-out infinite,
        glow-wave 2s ease-in-out infinite;
}

/* ==========================================================================
   Haptic Feedback Simulation
   ========================================================================== */
@keyframes haptic-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    75% {
        transform: translateX(2px);
    }
}

.mobile-nav-item:active {
    animation: haptic-shake 0.1s ease-in-out;
}

/* ==========================================================================
   Breathing Effect for Notifications
   ========================================================================== */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.mobile-nav-item.has-notification::after {
    content: '';
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid rgba(10, 10, 10, 0.98);
    animation: breathe 1.5s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.6);
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */
.mobile-bottom-nav,
.mobile-nav-item {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ==========================================================================
   Dark Mode Support (Future)
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.98) 0%,
            rgba(10, 10, 10, 0.95) 100%
        );
    }
}

/* ==========================================================================
   Reduced Motion Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav,
    .mobile-nav-item,
    .mobile-nav-item svg,
    .mobile-nav-item::before,
    .mobile-nav-item::after {
        animation: none !important;
        transition: none !important;
    }
    
    .mobile-nav-item.active {
        transform: translateY(-4px);
    }
    
    .mobile-nav-item:active {
        transform: scale(0.96);
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */
@media (prefers-contrast: high) {
    .mobile-bottom-nav {
        border-top-width: 3px;
        background: rgba(0, 0, 0, 1);
    }
    
    .mobile-nav-item {
        color: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-nav-item.active {
        border: 2px solid var(--color-gold);
        background: rgba(30, 84, 71, 0.5);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .mobile-bottom-nav {
        display: none !important;
    }
}


