﻿/* Reset & Base */
:root {
    --primary: #121212; /* Deep Dark */
    --accent: #d81e5b; 
    --accent-blue: #00ff85; 
    --glass: rgba(255, 255, 255, 0.03); /* More transparent */
    --glass-border: rgba(255, 255, 255, 0.08);
    --text: #f0f0f0;
    --text-muted: #888888;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: var(--primary); /* Solid dark instead of gradient for minimalism */
    min-height: 100vh;
    overflow-x: hidden; 
}

/* Optional Ambient Glow */
.background-ambient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(216, 30, 91, 0.05) 0%, rgba(0, 255, 133, 0.02) 40%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.container-large {
    max-width: 1400px; /* Wider for editorial feel */
    margin: 0 auto;
    padding: 60px 40px; /* Ample margins */
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 20px;
}

h1 {
    font-weight: 300; /* Lighter weight for elegance */
    font-size: 2.5rem;
    letter-spacing: 2px;
    color: var(--text);
    text-transform: uppercase;
}

.view-toggles {
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--text);
    border-bottom: 1px solid var(--text); /* Minimal active state */
}

/* Typography */
.section-title {
    font-weight: 300;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--text);
    letter-spacing: 1px;
}

.editorial-heading {
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

/* Grid */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Match Card */
.match-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 4px; /* Less rounded for editorial look */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
}

.match-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.match-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    position: absolute;
    top: 15px;
    left: 30px;
}

.team-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 40%;
    margin-top: 15px; /* space for date */
}

.team-crest-small {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: grayscale(20%); /* Slightly muted for elegance */
    transition: filter 0.3s;
}

.match-card:hover .team-crest-small {
    filter: grayscale(0%);
}

.team-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.vs {
    font-weight: 300;
    color: var(--glass-border);
    font-size: 1.2rem;
    margin-top: 15px;
}

/* Prediction Stage */
.action-bar {
    margin-bottom: 30px;
}

.text-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.text-link-btn:hover {
    color: var(--text);
}

.highlight-link {
    color: var(--accent-blue);
}

/* Hero First View: Abstract Pitch */
.prediction-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
    min-height: 50vh;
    justify-content: center;
    position: relative;
}

.abstract-pitch {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 300px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.01) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    overflow: hidden;
}

.pitch-line, .pitch-circle {
    position: absolute;
    border: 1px solid var(--glass-border);
}

.pitch-center-line {
    width: 1px;
    height: 100%;
    left: 50%;
    top: 0;
}

.pitch-center-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.hero-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    gap: 20px;
}

.hero-crest {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.hero-name {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.hero-vs {
    font-size: 3rem;
    font-weight: 100;
    color: var(--glass-border);
    z-index: 1;
}

/* Predict Action */
.predict-action-area {
    margin-top: 50px;
    height: 80px; /* Fixed height to prevent layout shift */
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--text);
    color: var(--text);
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--text);
    color: var(--primary);
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
}

/* Loading State */
.loading-elegant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 300px;
}

.scanning-text {
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    animation: pulse 2s infinite;
}

.scanning-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    animation: scan 1.5s infinite linear;
}

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

@keyframes scan {
    0% { transform: scaleX(0); opacity: 0; }
    50% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(0); opacity: 0; }
}

/* Results Layout */
.prediction-results-container {
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
    transition: opacity 1s ease, transform 1s ease;
}

.results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

/* Minimal Probabilities */
.prob-showcase {
    margin-bottom: 60px;
}

.minimal-bar {
    height: 4px; /* Very thin line */
    background: var(--glass-border);
    border-radius: 0;
    margin-bottom: 15px;
}

.minimal-labels {
    font-size: 1.5rem;
    font-weight: 300;
}

.home-color { color: #f0f0f0; } /* Subtle mapping rather than loud colors */
.draw-color { color: var(--text-muted); }
.away-color { color: #f0f0f0; }

/* Analysis Content */
.prose {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-weight: 300;
}
.prose p {
    margin-bottom: 1.5em;
}

/* Radar side */
.results-side {
    border-left: 1px solid var(--glass-border);
    padding-left: 60px;
}
.radar-charts-container {
    width: 100%;
    height: 350px;
}

/* General Utilities */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

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

/* Table */
.minimal-table {
    border: none;
    background: transparent;
}

.minimal-table table {
    width: 100%;
}

.minimal-table th, .minimal-table td {
    padding: 20px 10px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 300;
}
.minimal-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 1024px) {
    .results-layout {
        grid-template-columns: 1fr;
    }
    .results-side {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--glass-border);
        padding-top: 40px;
    }
    .abstract-pitch {
        padding: 0 20px;
    }
    .hero-vs {
        font-size: 2rem;
    }
}

/* Interactive Pitch in First View */
.interactive-pitch-hero {
    width: 100%;
    margin-top: -20px;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease forwards;
}
.prediction-hero { margin-bottom: 40px; }


/* --- Premium Interactive Pitch System --- */
.interactive-pitch-hero {
    width: 100%;
    margin: 40px 0;
    padding: 0 20px;
    animation: fadeIn 1s ease forwards;
}

.board-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.bench-sidebar {
    width: 180px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.bench-sidebar h5 {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 20px;
    text-align: center;
}

.bench-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
}

.unified-pitch {
    flex: 1;
    height: 500px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    position: relative;
    display: flex;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.pitch-line-center {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(255,255,255,0.05);
}

.pitch-circle-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.team-half {
    flex: 1;
    display: flex;
    justify-content: space-around;
    padding: 40px 20px;
}

.pitch-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* --- Player Token Style --- */
.pitch-player {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: grab;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}

.pitch-player:active {
    cursor: grabbing;
}

.player-dot {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    margin-bottom: 8px;
    transition: transform 0.3s;
}

.home-token .player-dot { background: var(--accent-blue); box-shadow: 0 0 15px rgba(0, 150, 255, 0.4); }
.away-token .player-dot { background: #ff4d4d; box-shadow: 0 0 15px rgba(255, 77, 77, 0.4); }

.player-info {
    text-align: center;
    pointer-events: none;
}

.pos-tag {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.name-tag {
    font-size: 0.75rem;
    font-weight: 400;
    color: #fff;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pitch-player:hover {
    transform: scale(1.1);
}

.pitch-player:hover .player-dot {
    transform: scale(1.2);
}

.tm-value {
    display: none; /* Hide market value icons as requested - they clutter the field */
}

/* Drag & Drop Visuals */
.drag-over {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.dragging {
    opacity: 0.4;
}


/* Win Probability Bars */
.prob-showcase {
    margin-bottom: 40px;
}

.prob-bar-wrapper.minimal-bar {
    display: flex;
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    overflow: hidden;
    margin: 15px 0;
}

.prob-bar {
    height: 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.prob-bar.home {
    background: #ff4d4d; /* Red */
}

.prob-bar.draw {
    background: #aaaaaa; /* Gray */
}

.prob-bar.away {
    background: #4d4dff; /* Blue */
}

.prob-labels.minimal-labels {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 500;
}

.home-color { color: #ff4d4d; }
.draw-color { color: #aaaaaa; }
.away-color { color: #4d4dff; }


/* --- Mobile Responsiveness for Pitch --- */
@media (max-width: 900px) {
    .board-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .bench-sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .bench-list {
        flex-direction: row;
        flex-wrap: wrap;
        min-height: 80px;
    }
    
    .unified-pitch {
        width: 100%;
        min-height: 400px;
    }
}


/* --- Vertical Interactive Pitch for Mobile --- */
@media (max-width: 900px) {
    .unified-pitch {
        flex-direction: column;
        height: auto;
        min-height: 600px;
    }

    .pitch-line-center {
        width: 100%;
        height: 1px;
        left: 0;
        top: 50%;
    }

    .pitch-circle-center {
        left: 50%;
        top: 50%;
    }

    .team-half {
        flex-direction: column;
        padding: 20px;
        height: 50%;
    }

    .pitch-row {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
        gap: 8px;
        height: auto;
        padding: 5px 0;
    }
}

.pitch-player.selected-for-swap .player-dot { transform: scale(1.5); box-shadow: 0 0 20px #00ff85; border: 2px solid #fff; }

/* --- Hamburger Menu --- */
.hamburger-menu {
    position: relative;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
}

.hamburger-btn span {
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: all 0.3s linear;
    transform-origin: 1px;
}

.hamburger-btn.open span:nth-child(1) { transform: rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg); }

.nav-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 99;
}

.nav-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown .nav-btn {
    text-align: right;
    width: 100%;
    padding: 10px;
}

/* Hide old view-toggles if any remain */
.view-toggles { display: none !important; }

/* --- General Mobile Layout Fixes --- */
@media (max-width: 768px) {
    body {
        width: 100vw;
        max-width: 100%;
    }
    .container-large {
        padding: 20px 15px; /* Reduce side padding so grid fits */
        overflow-x: hidden;
    }
    .grid-list {
        grid-template-columns: 1fr; /* Force single column on mobile */
        gap: 20px;
    }
    .match-card {
        padding: 20px;
    }
    .app-header {
        margin-bottom: 30px;
    }
    h1 {
        font-size: 1.8rem;
    }
}
