@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Exact 4-Color Theme Palette */
    --color-1: #000000; /* Pure Black - Main page background & dark overlays */
    --color-2: #150050; /* Midnight Indigo - Card containers, header & panels */
    --color-3: #3F0071; /* Royal Violet - Borders, table headers, secondary accents */
    --color-4: #FB2576; /* Neon Pink - Primary buttons, key text highlights, active badges & glows */

    /* Token Aliases */
    --bg-page: var(--color-1);
    --bg-card: var(--color-2);
    --bg-card-darker: #0d0033;
    --border-soft: rgba(63, 0, 113, 0.6);
    --border-strong: var(--color-3);
    --border-pink: var(--color-4);

    --text-light: #ffffff;
    --text-pink: var(--color-4);
    --text-muted: #c3b2e6;
    --text-dark: var(--color-1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.7);
    --shadow-pink: 0 0 20px rgba(251, 37, 118, 0.35);
}

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

body {
    background-color: var(--color-1);
    background-image: 
        linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(21, 0, 80, 0.88)),
        url('../images/bg-01.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-light);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.6;
    padding-bottom: 60px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Component */
header {
    background: var(--color-2);
    border-bottom: 2px solid var(--color-3);
    padding: 24px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.brand-wrapper h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-4);
    letter-spacing: -0.5px;
}

.brand-wrapper p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-badges {
    display: flex;
    gap: 10px;
}

.badge {
    background: rgba(63, 0, 113, 0.4);
    border: 1px solid var(--color-3);
    color: var(--text-light);
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Status Lamp / Indicator Bulb */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.green-glow,
.status-dot-lamp {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    background-color: #00ff87;
    box-shadow: 0 0 8px #00ff87, 0 0 14px rgba(0, 255, 135, 0.8);
    animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.85);
        opacity: 0.75;
        box-shadow: 0 0 5px #00ff87, 0 0 8px rgba(0, 255, 135, 0.5);
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 14px #00ff87, 0 0 22px rgba(0, 255, 135, 1);
    }
    100% {
        transform: scale(0.85);
        opacity: 0.75;
        box-shadow: 0 0 5px #00ff87, 0 0 8px rgba(0, 255, 135, 0.5);
    }
}

/* Action & Nav Bar */
.nav-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--color-4);
    color: #ffffff;
    border-color: var(--color-4);
    box-shadow: 0 4px 15px rgba(251, 37, 118, 0.4);
}

.btn-primary:hover {
    background-color: #ff3d8b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 37, 118, 0.6);
}

.btn-secondary {
    background-color: var(--color-3);
    color: var(--text-light);
    border-color: var(--color-3);
}

.btn-secondary:hover {
    background-color: #530094;
    border-color: var(--color-4);
    color: #ffffff;
}

/* Card Panel Container */
.card-panel {
    background: var(--color-2);
    border: 1px solid var(--color-3);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-soft);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-4);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-3);
    padding-bottom: 10px;
}

/* Form Layout */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    background: var(--color-1);
    border: 1px solid var(--color-3);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--color-4);
    box-shadow: 0 0 8px rgba(251, 37, 118, 0.4);
}

/* Quick Test Chips */
.quick-chips {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chip-btn {
    background: var(--color-3);
    border: 1px solid var(--color-3);
    color: var(--text-light);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.chip-btn:hover {
    background: var(--color-4);
    color: #ffffff;
}

/* Stats Overview Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-item {
    background: var(--color-2);
    border: 1px solid var(--color-3);
    border-left: 4px solid var(--color-4);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-4);
    margin-top: 4px;
}

.stat-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Data Table Styling */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-3);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

th {
    background: var(--color-3);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    padding: 14px 18px;
    border-bottom: 2px solid var(--color-4);
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-3);
    color: var(--text-light);
}

tr:nth-child(even) {
    background: rgba(63, 0, 113, 0.15);
}

tr:hover {
    background: rgba(63, 0, 113, 0.4);
}

/* Custom Badges & Details */
.rank-pill {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: var(--color-3);
    color: var(--text-light);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 0.88rem;
}

.rank-top {
    background: var(--color-4);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(251, 37, 118, 0.6);
}

.points-badge {
    background: var(--color-3);
    border: 1px solid var(--color-4);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-family: var(--font-heading);
}

.gw-points {
    color: var(--color-4);
    font-weight: 700;
}

/* Modal View */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--color-2);
    border: 2px solid var(--color-4);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 850px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: var(--shadow-pink);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-3);
    padding-bottom: 12px;
}

pre.json-viewer {
    background: var(--color-1);
    color: var(--color-4);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-3);
    overflow: auto;
    font-family: monospace;
    font-size: 0.88rem;
    flex: 1;
}

@media (max-width: 768px) {
    .header-content { flex-direction: column; align-items: flex-start; }
    .form-group { min-width: 100%; }
}

/* Chip Badges */
.chip-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.chip-wc {
    background: var(--color-4);
    color: #ffffff;
}
.chip-fh {
    background: var(--color-3);
    color: #ffffff;
    border: 1px solid var(--color-4);
}
.chip-tc {
    background: #ff0055;
    color: #ffffff;
}
.chip-bb {
    background: var(--color-4);
    color: #ffffff;
}

/* Football Pitch Layout */
.pitch-container {
    background: linear-gradient(180deg, #133a1b 0%, #0d2812 100%),
                repeating-linear-gradient(0deg, transparent, transparent 35px, rgba(0, 0, 0, 0.12) 35px, rgba(0, 0, 0, 0.12) 70px);
    border: 3px solid #276c33;
    border-radius: 16px;
    padding: 30px 16px;
    position: relative;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), inset 0 0 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Pitch Field Markings */
.pitch-center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

.pitch-center-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.pitch-penalty-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 65px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top: none;
    pointer-events: none;
}

.pitch-penalty-bottom {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 65px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-bottom: none;
    pointer-events: none;
}

.pitch-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
    gap: 8px;
}

.pitch-row:last-child {
    margin-bottom: 0;
}

.pitch-player-card {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
    width: 125px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pitch-player-card:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.75);
    border-color: #FB2576;
}

.pitch-player-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.2;
}

.pitch-player-pts {
    display: inline-block;
    background: #FB2576;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(251, 37, 118, 0.4);
}

.pitch-player-captain {
    background: #FB2576;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

.pitch-player-vc {
    background: var(--color-3);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

.pitch-player-trin {
    background: #00ff87;
    color: #000000;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 3px;
}

/* Bench Container */
.bench-panel {
    background: rgba(21, 0, 80, 0.85);
    border: 1px solid var(--color-3);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.bench-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bench-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
    width: 120px;
}

@media (max-width: 600px) {
    .pitch-player-card, .bench-card {
        width: 85px;
        padding: 6px 4px;
    }
    .pitch-player-name {
        font-size: 0.72rem;
    }
    .pitch-player-pts {
        font-size: 0.72rem;
        padding: 1px 6px;
    }
}

/* Scrollable Table Max 4 Rows */
.table-scrollable-4rows {
    max-height: 235px;
    overflow-y: auto;
}

.table-scrollable-4rows th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--color-3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.table-scrollable-4rows::-webkit-scrollbar {
    width: 8px;
}

.table-scrollable-4rows::-webkit-scrollbar-track {
    background: rgba(15, 0, 40, 0.5);
    border-radius: 4px;
}

.table-scrollable-4rows::-webkit-scrollbar-thumb {
    background: var(--color-4);
    border-radius: 4px;
}

