/**
 * Cricket Real-Time Widget Styles
 * Enhanced animations and status indicators
 *
 * @package Cricket_Live_Scores
 * @since 2.0.0
 */

/* ========================================
   Match Card Update Animations
   ======================================== */

.cricket-match-card {
    transition: all 0.3s ease;
}

/* Updating animation */
.cricket-match-card.cricket-match-updating {
    opacity: 0.7;
    transform: scale(0.98);
}

/* Updated animation */
.cricket-match-card.cricket-match-updated {
    animation: cricketHighlight 0.6s ease-out;
}

@keyframes cricketHighlight {
    0% {
        background: rgba(70, 180, 80, 0.2);
        transform: scale(1);
    }
    50% {
        background: rgba(70, 180, 80, 0.3);
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}

/* ========================================
   Live Badge Enhanced
   ======================================== */

.cricket-live-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #dc3232;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 12px;
    text-transform: uppercase;
}

.cricket-live-pulse {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: cricketPulse 2s ease-in-out infinite;
}

@keyframes cricketPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* ========================================
   Completed Badge
   ======================================== */

.cricket-completed-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #666;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 12px;
    text-transform: uppercase;
}

/* ========================================
   Scheduled Badge
   ======================================== */

.cricket-scheduled-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 12px;
    text-transform: uppercase;
}

/* ========================================
   Upcoming Badge with Countdown
   ======================================== */

.cricket-upcoming-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}

/* ========================================
   Score Change Animation
   ======================================== */

.cricket-team-score {
    transition: all 0.3s ease;
}

.cricket-team-score.cricket-score-changed {
    animation: cricketScoreChange 0.6s ease-out;
}

@keyframes cricketScoreChange {
    0% {
        color: inherit;
        transform: scale(1);
    }
    50% {
        color: #46b450;
        transform: scale(1.15);
        font-weight: 700;
    }
    100% {
        color: inherit;
        transform: scale(1);
    }
}

/* ========================================
   Boundary/Wicket Notifications
   ======================================== */

.cricket-boundary-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: linear-gradient(135deg, #46b450, #38a169);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(70, 180, 80, 0.4);
    z-index: 1000;
    animation: cricketBoundaryNotif 2s ease-out forwards;
}

.cricket-wicket-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: linear-gradient(135deg, #dc3232, #c62828);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(220, 50, 50, 0.4);
    z-index: 1000;
    animation: cricketWicketNotif 2s ease-out forwards;
}

@keyframes cricketBoundaryNotif {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes cricketWicketNotif {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
    40% {
        transform: translate(-50%, -50%) scale(1) rotate(-5deg);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    }
}

/* ========================================
   Error Notification
   ======================================== */

.cricket-error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #dc3232;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(220, 50, 50, 0.3);
    z-index: 10000;
    animation: cricketSlideIn 0.3s ease-out;
}

.cricket-error-notification a {
    color: #fff;
    text-decoration: underline;
    margin-left: 8px;
}

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

/* ========================================
   Keyframe Animations
   ======================================== */

@keyframes cricketRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Loading Skeleton
   ======================================== */

.cricket-match-card.cricket-loading {
    position: relative;
    overflow: hidden;
}

.cricket-match-card.cricket-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    animation: cricketShimmer 1.5s infinite;
}

@keyframes cricketShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ========================================
   Mobile Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .cricket-boundary-notification,
    .cricket-wicket-notification {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* ========================================
   Reduced Motion Preferences
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cricket-match-card,
    .cricket-team-score {
        animation: none !important;
        transition: none !important;
    }

    .cricket-live-pulse {
        animation: none;
        opacity: 1;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .cricket-error-notification {
        display: none !important;
    }
}
