/**
 * Critical fixes for loading states
 */

/* Hide Vue template expressions while Vue is loading */
[v-cloak] {
    display: none !important;
}

/* Apply skeleton styling to any element with 0.00 value during loading */
.odds-value:empty,
.odds-value[innerHTML=""],
.match-odd:empty,
.match-odd[innerHTML=""] {
    position: relative;
    height: 24px;
    width: 50px;
    background-color: #273346;
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

/* Style match cards with empty data */
.match-card:empty,
.event-item:empty {
    padding: 12px;
    background-color: #1e2835;
    border-radius: 6px;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.match-card:empty::after,
.event-item:empty::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #1e2835 0%, #273346 50%, #1e2835 100%);
    background-size: 200% 100%;
    animation: loading-shine 1.5s infinite linear;
}

@keyframes loading-shine {
    to {
        background-position: -200% 0;
    }
}

/* Immediate fix for checkboxes next to empty fields */
input[type="checkbox"] {
    opacity: 0.5;
}

/* Fix for empty betting odds fields */
.odds-value[text="0.00"],
.odds-value:contains("0.00"),
.match-odd[text="0.00"],
.match-odd:contains("0.00") {
    background-color: rgba(39, 51, 70, 0.8);
    color: transparent;
    position: relative;
}

.odds-value[text="0.00"]::after,
.odds-value:contains("0.00")::after,
.match-odd[text="0.00"]::after,
.match-odd:contains("0.00")::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Add a subtle loading indicator to the top of the page */
body.loading-data::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #0d6efd, #63a5ff);
    animation: loading-progress 2s infinite linear;
    z-index: 9999;
}

@keyframes loading-progress {
    0% {
        width: 0%;
    }
    50% {
        width: 65%;
    }
    100% {
        width: 100%;
    }
}
