/* ═══════════════════════════════════════════════════════════
   ⭐ FLOATING RATING SYSTEM
   ═══════════════════════════════════════════════════════════ */

/* زر التقييمات العائم - صغير على اليسار */
.ratings-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #1e3a8a 100%);
    color: white;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    box-shadow: 
        0 8px 25px rgba(74, 144, 226, 0.4),
        0 4px 15px rgba(30, 58, 138, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.ratings-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.ratings-toggle:hover::before {
    animation: shimmer 1.5s ease-in-out;
    opacity: 1;
}

.ratings-toggle:hover {
    transform: translateY(-4px) scale(1.15);
    box-shadow: 
        0 15px 40px rgba(74, 144, 226, 0.6),
        0 8px 25px rgba(30, 58, 138, 0.4),
        inset 0 3px 0 rgba(255, 255, 255, 0.3),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #60a5fa 0%, #4a90e2 50%, #357abd 100%);
}

.toggle-icon {
    font-size: 1.6rem;
    animation: chartPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.ratings-toggle:hover .toggle-icon {
    font-size: 1.8rem;
    animation: chartBounce 0.6s ease-in-out;
}

.ratings-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff4757 0%, #ff3742 50%, #c44569 100%);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.4);
    animation: countPulse 2s ease-in-out infinite;
}

/* نظام التقييم العائم - صغير على اليسار */
.floating-rating {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 1001;
}

.rating-trigger {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 50%, #ff8c00 100%);
    color: #2c3e50;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    box-shadow: 
        0 8px 25px rgba(255, 215, 0, 0.4),
        0 4px 15px rgba(255, 140, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.rating-trigger::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.rating-trigger:hover::before {
    animation: shimmer 1.5s ease-in-out;
    opacity: 1;
}

.rating-trigger:hover {
    transform: translateY(-4px) scale(1.15);
    box-shadow: 
        0 15px 40px rgba(255, 215, 0, 0.6),
        0 8px 25px rgba(255, 140, 0, 0.4),
        inset 0 3px 0 rgba(255, 255, 255, 0.4),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #ffed4e 0%, #ffd700 50%, #ffb347 100%);
}

.rating-icon {
    font-size: 1.6rem;
    animation: starPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.rating-trigger:hover .rating-icon {
    font-size: 1.8rem;
    animation: starSpin 0.6s ease-in-out;
}

/* زر الدردشة العائم */
.chat-toggle {
    position: fixed;
    bottom: 140px;
    left: 20px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 50%, #075e54 100%);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 
        0 8px 25px rgba(37, 211, 102, 0.4),
        0 4px 15px rgba(7, 94, 84, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1003;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.chat-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.chat-toggle:hover::before {
    animation: shimmer 1.5s ease-in-out;
    opacity: 1;
}

.chat-toggle:hover {
    transform: translateY(-4px) scale(1.15);
    box-shadow: 
        0 15px 40px rgba(37, 211, 102, 0.6),
        0 8px 25px rgba(7, 94, 84, 0.4),
        inset 0 3px 0 rgba(255, 255, 255, 0.3),
        inset 0 -3px 0 rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #34e79a 0%, #25d366 50%, #128c7e 100%);
}

.chat-icon {
    font-size: 1.8rem;
    animation: chatPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.chat-toggle:hover .chat-icon {
    font-size: 2rem;
    animation: chatBounce 0.6s ease-in-out;
}

.chat-notification {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: notificationPulse 2s ease-in-out infinite;
}

/* الرسوم المتحركة */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

@keyframes chartPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes chartBounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.15);
    }
    75% {
        transform: scale(1.05);
    }
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes starSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes chatPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes chatBounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.2);
    }
    75% {
        transform: scale(1.05);
    }
}

@keyframes countPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .ratings-toggle {
        bottom: 15px;
        left: 15px;
        width: 50px;
        height: 50px;
    }
    
    .rating-trigger {
        width: 45px;
        height: 45px;
    }
    
    .chat-toggle {
        bottom: 130px;
        left: 15px;
        width: 55px;
        height: 55px;
    }
    
    .floating-rating {
        bottom: 75px;
        left: 15px;
    }
    
    .toggle-icon {
        font-size: 1.4rem;
    }
    
    .rating-icon {
        font-size: 1.4rem;
    }
    
    .chat-icon {
        font-size: 1.6rem;
    }
    
    .ratings-count,
    .chat-notification {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        top: -6px;
        right: -6px;
    }
}