/* ===== KNOCKOUT TOURNAMENT STYLES ===== */

/* Base styles */
* {
    box-sizing: border-box;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Input number spinner removal */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #F97316;
    border-radius: 50%;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #F97316;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Bracket connector lines */
.bracket-connector {
    position: relative;
}

.bracket-connector::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%;
    width: 16px;
    height: 2px;
    background: #D1D5DB;
}

/* Group standings table */
.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th,
.standings-table td {
    padding: 8px 12px;
    text-align: left;
}

.standings-table th {
    font-weight: 600;
    color: #6B7280;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 2px solid #E5E7EB;
}

.standings-table tr:not(:last-child) td {
    border-bottom: 1px solid #F3F4F6;
}

.standings-table tr.qualified {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1), transparent);
}

.standings-table tr.best-third {
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.1), transparent);
}

/* Match cards */
.match-card {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 12px;
    transition: background 0.2s;
}

.match-card:hover {
    background: #F3F4F6;
}

.match-card.completed {
    background: #F0FDF4;
}

/* Score inputs */
.score-input {
    width: 40px;
    height: 32px;
    text-align: center;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.score-input:focus {
    outline: none;
    border-color: #F97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.score-input.winner {
    background: #DCFCE7;
    border-color: #22C55E;
}

/* Knockout bracket */
.knockout-match {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    width: 220px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.knockout-match:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.knockout-team {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background: #F9FAFB;
}

.knockout-team.winner {
    background: #DCFCE7;
}

.knockout-team .team-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.knockout-team .team-score {
    font-weight: 700;
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

/* Champion banner */
.champion-banner {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 2px solid #F59E0B;
    border-radius: 16px;
    padding: 16px 24px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #92400E;
}

/* Toast notifications */
.toast {
    background: #1F2937;
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.3s ease-out;
}

/* Loading spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E5E7EB;
    border-top-color: #F97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .knockout-match {
        width: 180px;
        padding: 12px;
    }

    .knockout-team .team-name {
        font-size: 12px;
    }

    .standings-table th,
    .standings-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .knockout-match {
        width: 160px;
        padding: 10px;
    }
}
