/* 
 * Crow Nation - Analytics & Hit Rates Styling
 * Organized by component for maintenance and developer readability.
 */

:root {
    --bg-dark: #07090e;
    --panel-bg: rgba(22, 28, 45, 0.65);
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-light: rgba(255, 255, 255, 0.1);
    --accent-green: #17c970;
    --accent-blue: #3d8bff;
    --accent-gold: #f9cf25;
    --accent-red: #ff5c5c;
    --text-muted: #8a99af;
    --glow-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* ── Wrapper & Background Glows ───────────────────────────────────────── */
.an-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.an-glow-1 {
    position: absolute;
    top: 10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(23, 201, 112, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
}

.an-glow-2 {
    position: absolute;
    bottom: 10%;
    left: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(61, 139, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.an-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ── Navigation & Filters ────────────────────────────────────────────── */
.filter-bar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 8px;
    display: inline-flex;
    gap: 8px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.filter-btn {
    padding: 10px 24px;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.filter-btn.active {
    background: #fff;
    color: #000;
}

/* ── KPI Components ─────────────────────────────────────────────────── */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-green);
    opacity: 0.8;
}

.kpi-visual {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.kpi-visual i {
    font-size: 1.8rem;
}

.kpi-data {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 4px;
}

/* ── Panel Components ────────────────────────────────────────────────── */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 32px;
    padding: 32px;
    box-shadow: var(--glow-shadow);
}

.section-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.section-title i {
    color: var(--accent-green);
}

/* ── Hit Rate Matrix & Grid ──────────────────────────────────────────── */
.prob-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.prob-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.prob-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
}

.prob-grade {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.prob-val {
    font-size: 1.8rem;
    font-weight: 800;
}

.prob-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
    text-transform: uppercase;
}

/* ── Sleek Tables ───────────────────────────────────────────────────── */
.sleek-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
}

.sleek-table th {
    text-align: left;
    padding: 0 15px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sleek-table td {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 15px;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.sleek-table td:first-child {
    border-left: 1px solid var(--border-light);
    border-radius: 14px 0 0 14px;
}

.sleek-table td:last-child {
    border-right: 1px solid var(--border-light);
    border-radius: 0 14px 14px 0;
}

.val-bold {
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
}

/* ── Player Prototype Cards / Feed ──────────────────────────────────── */
.comp-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comp-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 24px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.25s ease;
}

.comp-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateX(8px);
}

.p-avatar-wrap {
    position: relative;
}

.p-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    object-fit: cover;
    background: #000;
    border: 1px solid var(--border-light);
}

.p-status {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #161c2d;
}

.p-info {
    flex: 1;
}

.p-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.p-name a {
    color: #fff;
    text-decoration: none;
}

.p-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.p-data {
    text-align: right;
}

.p-score {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.p-outcome {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 10px;
    margin-top: 6px;
    display: inline-block;
}

/* ── Single Player Widget (Hit Rates) ────────────────────────────────── */
.cn-hit-rates {
    margin-top: 40px;
    margin-bottom: 30px;
}

.cn-hit-rates .title h2 {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.cn-hit-rates .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hr-box {
    background: linear-gradient(145deg, #181d28 0%, #11141c 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
}

.hr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    font-family: 'Barlow Condensed';
    text-transform: uppercase;
    font-size: 1.1rem;
}

.hr-header .title {
    color: #59a7ff;
    font-weight: 600;
}

.hr-box:last-child .hr-header .title {
    color: #f9cf25;
}

.label-meta {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.label-meta.tier-Elite, .label-meta.tier-S-Tier, .label-meta.tier-S { background: var(--accent-green); color: #000; }
.label-meta.tier-A-Tier { background: var(--accent-blue); }
.label-meta.tier-B-Tier { background: var(--accent-gold); color: #000; }
.label-meta.pos.QB { background: #fc2b6d; }
.label-meta.pos.RB { background: #20ceb8; color: #000; }
.label-meta.pos.WR { background: #59a7ff; }
.label-meta.pos.TE { background: #fd972d; }

.hr-bar-wrap {
    width: 100%;
    display: flex;
    height: 35px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hr-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
}

.hr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a3bbd3;
}

.hr-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hr-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.hr-sample {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
}

@media (max-width: 900px) {
    .cn-hit-rates .grid {
        grid-template-columns: 1fr;
    }
}
