/*
 * LigaMaster - Premium Sports Theme Stylesheet
 */

:root {
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-header: #1e1b4b;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --accent-emerald: #10b981;
    --accent-cyan: #06b6d4;
    --accent-indigo: #6366f1;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
                      radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 40%);
    font-family: var(--font-body);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.1);
}

/* Header & Navbar */
.navbar {
    background: rgba(30, 41, 59, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-indigo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    color: #e2e8f0;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent-emerald);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, #4f46e5 100%);
    border: none;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.6rem 1.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%);
    border: none;
    font-weight: 600;
    border-radius: 0.5rem;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Tournament Cards */
.sport-badge {
    font-size: 0.75rem;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.format-badge {
    font-size: 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.status-badge-active {
    font-size: 0.75rem;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.25rem 0.6rem;
    border-radius: 2rem;
    font-weight: 600;
}

/* Match Card Structure */
.match-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.match-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
}

.match-team.winner {
    font-weight: 600;
    color: white;
}

.match-team.loser {
    color: var(--text-muted);
}

.team-logo-small {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 50%;
    background: #334155;
    margin-right: 8px;
}

.match-score-box {
    background: #1e293b;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

/* Interactive Brackets Container */
.bracket-wrapper {
    display: flex;
    overflow-x: auto;
    padding: 2rem 0;
    gap: 3rem;
    align-items: center;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 600px; /* Base height for aligning connector lines */
    min-width: 250px;
}

.bracket-match-node {
    position: relative;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 240px;
}

.bracket-match-node:hover {
    border-color: var(--accent-indigo);
}

/* Table styling */
.table {
    color: var(--text-primary);
}

.table th {
    font-family: var(--font-heading);
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Live score pulse */
.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
    margin-right: 6px;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Bracket SVG Connector Lines */
.bracket-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bracket-svg path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease, stroke-width 0.3s ease, filter 0.3s ease;
}

.bracket-svg path.active {
    stroke: var(--accent-indigo);
    stroke-width: 3px;
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.8));
}

.bracket-match-node {
    position: relative;
    z-index: 2;
}

/* Disable old lines in favor of dynamic SVGs */
.bracket-match-node::before,
.bracket-match-node::after {
    display: none !important;
}

/* Distinct winner coloring & loser styling */
.winner-highlight {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #e2e8f0 !important;
}

.winner-highlight .team-name-text {
    font-weight: 700 !important;
    color: var(--accent-emerald) !important;
}

.loser-dimmed {
    opacity: 0.55;
    transition: opacity 0.2s ease;
}

.loser-dimmed:hover {
    opacity: 0.85;
}

/* Path tracing highlights */
.bracket-match-node.path-active {
    border-color: var(--accent-indigo) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}
