/* New Matches Page Styling with Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(110, 0, 255, 0.5); }
    50% { box-shadow: 0 0 15px rgba(110, 0, 255, 0.8); }
    100% { box-shadow: 0 0 5px rgba(110, 0, 255, 0.5); }
}

.match-tabs {
    display: flex;
    background: linear-gradient(to right, #f0f0f0, #f8f8f8);
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px 8px 0 0;
    animation: fadeIn 0.5s ease-out;
}

.match-tab {
    padding: 12px 18px;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.match-tab:hover {
    color: #6e00ff;
    background-color: rgba(110, 0, 255, 0.05);
}

.match-tab.active {
    color: #6e00ff;
}

.match-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #6e00ff, #9d6eff);
    animation: slideIn 0.3s ease-out;
}

.match-tab-count {
    display: inline-block;
    background: linear-gradient(to bottom, #f0f0f0, #e6e6e6);
    color: #666;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.match-tab:hover .match-tab-count {
    background: linear-gradient(to bottom, #e6e6ff, #d9d9ff);
    transform: scale(1.05);
}

/* Sport tabs styling with animations */
.sport-tabs {
    display: flex;
    background-color: #fff;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
    padding: 10px 5px;
    border-bottom: 1px solid #eee;
    animation: fadeIn 0.7s ease-out;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sport-tab {
    padding: 6px 14px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 0 4px;
    border-radius: 20px;
    background-color: #f5f5f5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid transparent;
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.sport-tab:nth-child(1) { animation-delay: 0.1s; }
.sport-tab:nth-child(2) { animation-delay: 0.2s; }
.sport-tab:nth-child(3) { animation-delay: 0.3s; }
.sport-tab:nth-child(4) { animation-delay: 0.4s; }
.sport-tab:nth-child(5) { animation-delay: 0.5s; }

.sport-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #e0e0e0;
}

.sport-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #6e00ff, #9d6eff);
    box-shadow: 0 4px 10px rgba(110, 0, 255, 0.3);
    transform: translateY(-1px);
}

/* Match list animations */
@keyframes loadingPulse {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.match-list {
    padding: 0;
    perspective: 1000px;
    position: relative;
}

.match-list.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    animation: loadingPulse 1.5s infinite;
}

.match-list.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6e00ff;
    font-weight: bold;
    z-index: 11;
    font-size: 16px;
}

.match-list.filtering {
    min-height: 200px;
    transition: min-height 0.3s ease;
}

.match-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, display 0.5s ease;
}

.match-card.visible {
    display: block;
    animation: cardAppear 0.5s forwards;
}

.match-card.hidden {
    display: none;
}

.tab-clicked {
    animation: pulse 0.3s ease;
}

.card-hover {
    animation: glow 2s infinite;
}

/* Match card styling */
.match-card {
    background: linear-gradient(to bottom, #ffffff, #f9f9f9);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
    position: relative;
}

.match-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.match-card:nth-child(even) {
    animation-delay: 0.2s;
}

.match-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-color: #d0d0d0;
}

.match-card:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.match-league {
    background: linear-gradient(135deg, #6c7ae0, #5c6ad0);
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.match-league::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.match-content {
    padding: 15px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.match-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(110, 0, 255, 0.02) 0%, transparent 70%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-card:hover .match-content::after {
    opacity: 1;
}

.match-date {
    color: #888;
    font-size: 11px;
    width: 60px;
    text-align: center;
    background: rgba(240, 240, 240, 0.5);
    padding: 3px 0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.match-card:hover .match-date {
    background: rgba(230, 230, 250, 0.5);
    color: #6e00ff;
}

.match-teams-container {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    position: relative;
}

.match-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    transition: all 0.3s ease;
}

.match-card:hover .match-team {
    transform: scale(1.05);
}

.team-logo-container {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    background: #f9f9f9;
    border-radius: 50%;
    padding: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-card:hover .team-logo-container {
    box-shadow: 0 4px 8px rgba(110, 0, 255, 0.2);
    background: #fff;
}

.team-logo {
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.match-card:hover .team-logo {
    transform: scale(1.1);
}

.team-name {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: #333;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s ease;
    padding: 3px 5px;
    border-radius: 10px;
}

.match-card:hover .team-name {
    color: #6e00ff;
    background: rgba(230, 230, 250, 0.5);
}

.match-vs {
    font-weight: bold;
    color: #6c7ae0;
    font-size: 16px;
    position: relative;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.match-card:hover .match-vs {
    transform: scale(1.2);
    color: #6e00ff;
}

.match-time {
    color: #888;
    font-size: 11px;
    width: 60px;
    text-align: center;
    background: rgba(240, 240, 240, 0.5);
    padding: 3px 0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.match-card:hover .match-time {
    background: rgba(230, 230, 250, 0.5);
    color: #6e00ff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .match-tab {
        padding: 10px 15px;
        font-size: 13px;
    }

    .sport-tab {
        padding: 5px 10px;
        font-size: 12px;
    }

    .match-date, .match-time {
        width: 60px;
        font-size: 11px;
    }

    .team-logo-container {
        width: 35px;
        height: 35px;
    }

    .team-name {
        font-size: 11px;
    }

    .match-content {
        padding: 10px 8px;
    }

    .match-teams-container {
        width: 100%;
        margin: 8px 0;
        order: 1;
    }

    .match-date {
        order: 2;
        width: 40%;
        text-align: left;
        padding: 3px 5px;
    }

    .match-time {
        order: 3;
        width: 20%;
        text-align: center;
        padding: 3px 5px;
    }

    .match-vs {
        font-size: 14px;
    }

    .match-card {
        margin-bottom: 12px;
    }

    .match-league {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Optimize animations for mobile */
    .match-card:hover {
        transform: translateY(-2px) scale(1.005);
    }

    .match-card:hover .match-team {
        transform: scale(1.02);
    }

    .match-card:hover .match-vs {
        transform: scale(1.1);
    }
}
