/* assets/css/team_detail.css */

/* SICHERHEITS-BLOCK */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --primary: #10b981;
}
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
}
a { text-decoration: none; color: inherit; }

/* 1. HERO SECTION */
.team-hero {
    position: relative;
    padding: 60px 0 80px 0;
    margin-bottom: -40px; 
    background-color: var(--bg-card);
    box-shadow: inset 0 -50px 50px -20px #020617; 
}
.hero-inner { display: flex; justify-content: center; text-align: center; position: relative; z-index: 2; }
.hero-content { display: flex; flex-direction: column; align-items: center; }
.hero-badges { display: flex; gap: 10px; margin-bottom: 15px; }
.badge-league { background: #fff; color: #000; font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; }
.badge-year { background: rgba(0,0,0,0.3); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.hero-title { font-size: 56px; font-weight: 900; margin: 0; line-height: 1; text-transform: uppercase; letter-spacing: -2px; }
.hero-meta { margin-top: 20px; display: flex; gap: 20px; font-size: 15px; opacity: 0.9; }

/* 2. MAIN LAYOUT */
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.card {
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.05); 
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}
.card-header {
    background: rgba(255,255,255,0.03);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; color: var(--text-muted);
    display: flex; align-items: center; gap: 10px;
}

/* 3. INFO GRID (TOP 4 TILES) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px;
    margin-bottom: 30px;
    position: relative; z-index: 5;
}
.info-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex; flex-direction: column;
    min-height: 220px; 
}
.it-header {
    font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px;
    margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.it-scroll-area {
    overflow-y: auto;
    max-height: 150px;
    flex: 1; 
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) rgba(255,255,255,0.02);
}
.it-scroll-area::-webkit-scrollbar { width: 4px; }
.it-scroll-area::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.it-scroll-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.it-list { display: flex; flex-direction: column; gap: 6px; }
.it-row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.it-row span { color: var(--text-muted); }
.it-row strong { color: #fff; }

/* HOVER EFFECT FOR KADER ÜBERSICHT */
.it-row.hoverable {
    padding: 3px 6px;
    border-radius: 4px;
    cursor: help;
    transition: background-color 0.2s;
    margin-left: -6px;
    margin-right: -6px;
}
.it-row.hoverable:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.expensive-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin-top: 5px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 8px; }
.exp-player { text-align: center; cursor: pointer; padding: 4px; border-radius: 4px; transition: background 0.2s; }
.exp-player:hover { background: rgba(255,255,255,0.05); }
.exp-val { font-size: 10px; color: #fbbf24; font-weight: 700; }
.exp-name { font-size: 9px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; margin: 0 auto; }

/* 4. DETAIL GRID (MIDDLE) */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.detail-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex; flex-direction: column;
    height: 100%;
    min-height: 350px;
    max-height: 450px;
    overflow-y: auto;
}
.detail-tile::-webkit-scrollbar { width: 4px; }
.detail-tile::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.detail-tile::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.dt-header {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted);
    padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg-card); z-index: 2;
}

/* MINI TABLES */
.mini-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.mini-table th { text-align: left; color: var(--text-muted); font-size: 9px; text-transform: uppercase; padding: 6px 0; cursor: pointer; }
.mini-table td { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.05); color: #cbd5e1; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table tr:hover td { color: #fff; background: rgba(255,255,255,0.02); }
.mini-table .rank { width: 20px; color: var(--text-muted); font-weight: 700; }
.mt-right { text-align: right; }

.td-center, .th-center { text-align: center !important; }
.td-right, .th-right { text-align: right !important; }

.rank-1 td { color: #10b981; font-weight: 700; }
.rank-top td { color: #86efac; } 
.rank-mid td { color: #fca5a5; opacity: 0.8; }
.rank-bad td { color: #ef4444; } 
.rank-last td { color: #b91c1c; font-weight: 700; }

.active-row td { 
    background: rgba(255, 255, 255, 0.1) !important; 
    font-weight: 800; 
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.active-row td:first-child { 
    border-left: 3px solid #fff; 
    padding-left: 5px; 
}
.mini-table tr.clickable:hover td { background: rgba(255,255,255,0.03); color: #fff; cursor: pointer; }

/* Match List */
.match-list { display: flex; flex-direction: column; gap: 4px; }
.match-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; padding: 4px 0; transition: opacity 0.2s; border-bottom: 1px solid rgba(255,255,255,0.02); }
.match-row:hover { background: rgba(255,255,255,0.03); opacity: 1; }
.match-res { font-weight: 800; padding: 2px 6px; border-radius: 4px; min-width: 35px; text-align: center; }
.res-win { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.res-draw { background: rgba(148, 163, 184, 0.2); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }
.res-loss { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.match-sep { border-top: 1px dashed var(--border); margin: 5px 0; opacity: 0.5; }

/* 5. PITCH */
.pitch-container-wrapper { display: flex; justify-content: center; background: #0f172a; padding: 20px; border-bottom: 1px solid var(--border); }
.team-pitch { background: linear-gradient(to bottom, #064e3b, #065f46); position: relative; width: 100%; max-width: 500px; height: 600px; border: 3px solid rgba(255,255,255,0.1); border-radius: 8px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.pitch-lines { position: absolute; top: 15px; left: 15px; right: 15px; bottom: 15px; border: 2px solid rgba(255,255,255,0.2); pointer-events: none; }
.pitch-circle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100px; height: 100px; border: 2px solid rgba(255,255,255,0.2); border-radius: 50%; pointer-events: none; }
.tp-node-absolute { width: 90px; padding: 5px; border: 1px solid; border-radius: 6px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.4); cursor: pointer; transition: transform 0.2s; position: absolute; transform: translate(-50%, -50%); z-index: 10; }
.tp-node-absolute:hover { transform: translate(-50%, -50%) scale(1.15); z-index: 20; }
.tp-ovr { display: inline-block; padding: 1px 4px; border-radius: 3px; color: #fff; font-weight: 800; font-size: 9px; position: absolute; top: -6px; left: 50%; transform: translateX(-50%); box-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.tp-name { font-weight: 700; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.tp-kit { font-weight: 900; font-size: 11px; margin-top: 2px; }

/* 6. SQUAD TABLE */
#squad-list { scroll-margin-top: 140px; display: block; height: 1px; } /* Fix für Sprungmarke */
.squad-table-container { width: 100%; overflow-x: auto; max-height: 800px; overflow-y: auto; }
table.squad-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.squad-table th { 
    background: #1e293b; 
    color: var(--text-muted); 
    font-size: 10px; 
    text-transform: uppercase; 
    font-weight: 700; 
    padding: 12px 6px; 
    text-align: center; 
    border-bottom: 2px solid var(--border); 
    cursor: pointer; 
    user-select: none;
    position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
}
.squad-table th:hover { color: #fff; background: rgba(255,255,255,0.06); }
.squad-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; color: #cbd5e1; height: 48px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.squad-table tr:hover td { background: rgba(255,255,255,0.04); cursor: pointer; color: #fff; }

/* Helper classes */
.td-center { text-align: center !important; }
.td-left   { text-align: left !important; padding-left: 10px !important; }
.td-right  { text-align: right !important; padding-right: 15px !important; }

/* Cols */
.col-pos    { width: 70px; text-align: center !important; } 
.col-kit    { width: 40px; text-align: center !important; }
.col-nat    { width: 40px; text-align: center !important; }
.col-name   { width: auto; text-align: left !important; padding-left: 10px !important; } 
.col-val    { width: 100px; text-align: right !important; padding-right: 15px !important; }

.pos-badge { font-size: 9px; font-weight: 800; padding: 2px 0; width: 100%; text-align: center; border-radius: 4px; display: block; text-transform: uppercase; }
.p-goa { color: #fbbf24; background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.3); }
.p-def { color: #3b82f6; background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }
.p-mid { color: #10b981; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.p-att { color: #ef4444; background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); }

.sq-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sq-flag { height: 11px; width: auto; border-radius: 2px; }
.ovr-box { display: inline-block; padding: 2px 6px; border-radius: 4px; font-weight: 800; font-size: 11px; color: #fff; }
.val-txt { font-family: monospace; font-size: 12px; letter-spacing: -0.5px; }

/* COMPARE MODAL ITEMS */
.comp-item { padding: 12px 0; border-bottom: 1px solid rgba(56, 189, 248, 0.2); }
.comp-item:last-child { border-bottom: none; }
.pm-team-badge { padding: 6px 12px; border-radius: 6px; font-weight: 800; text-transform: uppercase; font-size: 13px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); display: inline-block; }
.compare-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; font-size: 13px; }
.comp-bar-bg { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; margin: 0 10px; overflow: hidden; position: relative; }
.comp-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; position: absolute; top: 0; }
.bar-left { right: 50%; transform-origin: right; }
.bar-right { left: 50%; transform-origin: left; }
.comp-val { width: 60px; font-weight: 800; text-align: center; padding: 4px 0; border-radius: 4px; font-size: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.comp-label { text-align: center; font-size: 10px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }

/* MODALS */
.player-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; backdrop-filter: blur(5px); align-items: center; justify-content: center; }
.player-modal { background: #0f172a; border: 1px solid #1e293b; border-radius: 16px; width: 90%; max-width: 450px; padding: 0; position: relative; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); overflow: hidden; animation: modalFadeIn 0.2s ease-out; }
@keyframes modalFadeIn { from {opacity: 0; transform: scale(0.95);} to {opacity: 1; transform: scale(1);} }
.pm-header { padding: 25px 20px; text-align: center; color: #fff; position: relative; }
.pm-close { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.2); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.pm-kit { font-size: 40px; font-weight: 900; opacity: 0.2; position: absolute; top: 10px; left: 20px; font-family: sans-serif; }
.pm-name { font-size: 24px; font-weight: 700; margin-bottom: 8px; line-height: 1.2; }
.pm-meta { display: flex; justify-content: center; gap: 15px; font-size: 14px; opacity: 0.95; align-items: center; flex-wrap: wrap; }
.pm-flag { height: 14px; width: auto; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.pm-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.pm-ratings-row { display: flex; justify-content: space-between; margin-bottom: 20px; background: #020617; padding: 15px; border-radius: 12px; border: 1px solid #1e293b; }
.pm-rating-box { text-align: center; flex: 1; }
.pm-rb-label { font-size: 10px; text-transform: uppercase; color: #94a3b8; font-weight: 600; margin-bottom: 5px; }
.pm-rb-val { font-size: 18px; font-weight: 700; color: #f8fafc; }
.pm-stars { color: #f59e0b; font-size: 11px; }
.pm-medals { color: #8b5cf6; font-size: 12px; }
.pm-section-title { font-size: 12px; text-transform: uppercase; color: #94a3b8; font-weight: 700; margin-bottom: 10px; margin-top: 15px; }
.pm-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm-stat-item { background: #020617; padding: 12px 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #1e293b; }
.pm-stat-label { font-size: 13px; color: #94a3b8; }
.pm-stat-val { font-size: 14px; font-weight: 700; color: #f8fafc; }

/* Ref/Var split container */
.split-tile-container { display: flex; gap: 10px; height: 100%; }

@media (max-width: 1100px) {
    .info-grid, .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .info-grid, .detail-grid { grid-template-columns: 1fr; }
    .col-nat, .col-age, .col-talent, .col-val { display: none; }
    .hero-title { font-size: 32px; }
    .split-tile-container { flex-direction: column; }
    .split-tile-container > div { border-left: none !important; padding-left: 0 !important; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }
}