/**
 * REAL ODDS LIFECYCLE STYLES
 * 
 * Visual states and animations for:
 * - Odds changes (increase/decrease)
 * - Suspension states
 * - BetSlip warnings
 * - Unavailable selections
 */

/* ═══════════════════════════════════════════════════════════════
   ODDS CHANGE ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

/**
 * Odds increased (green pulse)
 */
@keyframes oddsIncrease {
    0% {
        background-color: rgba(34, 197, 94, 0);
        transform: scale(1);
    }
    50% {
        background-color: rgba(34, 197, 94, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: rgba(34, 197, 94, 0);
        transform: scale(1);
    }
}

.bc-sb-odd.odds-increased {
    animation: oddsIncrease 800ms ease-out;
}

/**
 * Odds decreased (red pulse)
 */
@keyframes oddsDecrease {
    0% {
        background-color: rgba(239, 68, 68, 0);
        transform: scale(1);
    }
    50% {
        background-color: rgba(239, 68, 68, 0.2);
        transform: scale(1.05);
    }
    100% {
        background-color: rgba(239, 68, 68, 0);
        transform: scale(1);
    }
}

.bc-sb-odd.odds-decreased {
    animation: oddsDecrease 800ms ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   SUSPENSION STATE
   ═══════════════════════════════════════════════════════════════ */

/**
 * Suspended odds button
 */
.bc-sb-odd--suspended {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.bc-sb-odd--suspended::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    pointer-events: none;
}

.bc-sb-odd--suspended .bc-sb-odd__value {
    text-decoration: line-through;
    opacity: 0.6;
}

/**
 * Suspended indicator
 */
.bc-sb-odd--suspended::after {
    content: 'SUSPENDED';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    font-weight: 700;
    color: rgba(239, 68, 68, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   BETSLIP WARNINGS
   ═══════════════════════════════════════════════════════════════ */

/**
 * Odds warning container
 */
.odds-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.odds-warning__icon {
    font-size: 16px;
    flex-shrink: 0;
}

.odds-warning__text {
    flex: 1;
    color: #d1d5db;
}

/**
 * Warning types
 */

/* Odds changed */
.odds-warning--change {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.odds-warning--change .odds-warning__text {
    color: #fbbf24;
}

/* Suspended */
.odds-warning--suspended {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.odds-warning--suspended .odds-warning__text {
    color: #f87171;
}

/* Unavailable */
.odds-warning--unavailable {
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.odds-warning--unavailable .odds-warning__text {
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════════ */

/**
 * Odds loading skeleton
 */
.bc-sb-odd--loading .bc-sb-odd__value {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: loadingShimmer 1.5s infinite;
    color: transparent;
    border-radius: 4px;
}

@keyframes loadingShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   STALE ODDS INDICATOR
   ═══════════════════════════════════════════════════════════════ */

/**
 * Stale odds (>60s old) - subtle indicator
 */
.bc-sb-odd--stale {
    opacity: 0.85;
    position: relative;
}

.bc-sb-odd--stale::before {
    content: '⏱';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════
   ODDS UNAVAILABLE STATE
   ═══════════════════════════════════════════════════════════════ */

/**
 * When odds are not available for a fixture
 */
.bc-sb-event--no-odds .bc-sb-odd {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.bc-sb-event--no-odds .bc-sb-odd__value {
    color: #6b7280;
}

/**
 * Odds unavailable message
 */
.bc-sb-odds-unavailable {
    padding: 12px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 6px;
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   BETSLIP SELECTION WITH ISSUES
   ═══════════════════════════════════════════════════════════════ */

/**
 * Selection row with odds issue
 */
.bc-sb-betslip-selection--invalid {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.bc-sb-betslip-selection--suspended {
    background: rgba(239, 68, 68, 0.05);
    opacity: 0.7;
}

.bc-sb-betslip-selection--odds-changed {
    background: rgba(255, 193, 7, 0.05);
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   ACCEPTANCE BUTTON (for odds changes)
   ═══════════════════════════════════════════════════════════════ */

/**
 * Accept new odds button
 */
.bc-sb-accept-odds {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 4px;
    color: #fbbf24;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bc-sb-accept-odds:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
}

.bc-sb-accept-odds:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Slightly smaller animations on mobile */
    .bc-sb-odd.odds-increased,
    .bc-sb-odd.odds-decreased {
        animation-duration: 600ms;
    }
    
    /* Touch-friendly warning size */
    .odds-warning {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .odds-warning__icon {
        font-size: 18px;
    }
    
    /* Larger suspended indicator */
    .bc-sb-odd--suspended::after {
        font-size: 9px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════ */

/**
 * Reduce motion for users who prefer it
 */
@media (prefers-reduced-motion: reduce) {
    .bc-sb-odd.odds-increased,
    .bc-sb-odd.odds-decreased {
        animation: none;
        background-color: rgba(255, 193, 7, 0.1);
    }
    
    .bc-sb-odd--loading .bc-sb-odd__value {
        animation: none;
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */

/**
 * Ensure proper contrast in dark mode
 */
@media (prefers-color-scheme: dark) {
    .odds-warning--change {
        background: rgba(255, 193, 7, 0.15);
        border-color: rgba(255, 193, 7, 0.4);
    }
    
    .odds-warning--suspended {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.4);
    }
}
