/* ================================================
   MY CLUB PAGE STYLES - PREMIUM OVERHAUL
   ================================================ */

:root {
    --gold-gradient: linear-gradient(135deg, #FFD700, #FDB931);
    --silver-gradient: linear-gradient(135deg, #E0E0E0, #B0B0B0);
    --bronze-gradient: linear-gradient(135deg, #CD7F32, #8B4513);

    --pos-gk: #eb5e28;
    --pos-def: #28a745;
    /* Green - Defensive */
    --pos-mid: #007bff;
    /* Blue - Midfield */
    --pos-att: #dc3545;
    /* Red - Attack */

    --glass-bg: rgba(20, 20, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Page Header & Container */
.myclub-page-header {
    background: radial-gradient(circle at 50% 0%, rgba(58, 134, 255, 0.1), transparent 70%);
    padding-top: 80px;
    /* Offset for fixed navbar */
    min-height: 100vh;
}

#myclubContent {
    max-width: 1400px;
    /* Wider for list view */
    padding: 0 2rem;
}

/* Profile Header */
.profile-header {
    padding: 2rem;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    display: flex;
    justify-content: center;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    font-weight: 700;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-details h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(to right, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.profile-stats-badges {
    display: flex;
    gap: 1rem;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 500;
    transition: all 0.2s;
}

.stat-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-badge .badge-icon {
    font-size: 1.1rem;
    color: var(--accent-cyan);
}

/* Tab Switcher */
.tab-switcher {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 16px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 1rem;
}

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

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    flex-wrap: wrap;
    align-items: center;
}

.filter-input,
.filter-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.filter-input {
    flex: 1;
    min-width: 200px;
}

.filter-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a78bfa%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65em auto;
    padding-right: 2.5rem;
}

/* ================================================
   TABLE LIST VIEW
   ================================================ */

.card-list-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    /* Smooth corners for the container */
}

.card-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    /* Space between rows */
    margin-top: -0.5rem;
}

.card-list-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.card-list-table tbody tr {
    background: rgba(30, 30, 45, 0.6);
    backdrop-filter: blur(5px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    border-radius: 12px;
    /* Rounded rows */
}

/* Cells must have border-radius on ends to make the row look rounded */
.card-list-table tbody tr td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.card-list-table tbody tr td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.card-list-table tbody tr:hover {
    transform: scale(1.005);
    background: rgba(45, 45, 65, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.card-list-table td {
    padding: 0.75rem 1.5rem;
    vertical-align: middle;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-list-table tbody tr td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.card-list-table tbody tr td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tier Strips - Left Border Accent */
.card-list-table tbody tr.row-gold {
    box-shadow: inset 4px 0 0 #FFD700;
}

.card-list-table tbody tr.row-silver {
    box-shadow: inset 4px 0 0 #C0C0C0;
}

.card-list-table tbody tr.row-bronze {
    box-shadow: inset 4px 0 0 #CD7F32;
}

/* 1. Image Column */
.td-image {
    width: 60px;
    padding-right: 0 !important;
}

.player-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-img-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
}

/* 2. Rating Column */
.td-rating {
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    width: 80px;
    font-family: 'Inter', sans-serif;
}

.tier-gold {
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.tier-silver {
    color: #E0E0E0;
    text-shadow: 0 0 15px rgba(224, 224, 224, 0.3);
}

.tier-bronze {
    color: #CD7F32;
}

/* 3. Name Column */
.td-name {
    font-weight: 700;
    color: white;
    font-size: 1.1rem;
}

/* 4. Position Column */
.td-position {
    width: 140px;
}

.position-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: white;
    background: #333;
    min-width: 45px;
    text-align: center;
}

/* Position Colors */
.pos-GK {
    background: var(--pos-gk);
    box-shadow: 0 2px 10px rgba(235, 94, 40, 0.3);
}

/* Defense */
.pos-CB,
.pos-LB,
.pos-RB {
    background: var(--pos-def);
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

/* Midfield */
.pos-CDM,
.pos-CM,
.pos-CAM,
.pos-LM,
.pos-RM {
    background: var(--pos-mid);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

/* Attack */
.pos-ST,
.pos-CF,
.pos-LF,
.pos-RF {
    background: var(--pos-att);
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.td-position .altpos-container {
    margin-left: 0.5rem;
    display: inline-flex;
    gap: 4px;
    vertical-align: middle;
}

.altpos-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: white;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.altpos-badge:hover {
    opacity: 1;
}

/* 5. Club & Nation */
.td-club,
.td-nation {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* 6. Type */
.td-type {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 7. Value */
.td-value {
    font-family: 'Courier New', monospace;
    color: #4ade80;
    font-weight: 600;
    font-size: 1rem;
}

/* 8. Status */
.td-status {
    text-align: right;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-badge.lineup {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.untradable {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-bottom: 4rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    background: var(--primary);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.pagination-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.pagination-info {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

/* ================================================
   LINEUP VIEW
   ================================================ */

.formation-label {
    text-align: center;
    margin-bottom: 1.5rem;
}

.formation-name {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.lineup-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pitch-wrapper {
    flex: 1;
    min-width: 350px;
    max-width: 700px;
    aspect-ratio: 0.7;
    /* Typical pitch ratio */
    background:
        repeating-linear-gradient(0deg,
            #2d4a22 0px,
            #2d4a22 40px,
            #335226 40px,
            #335226 80px);
    border-radius: 12px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.pitch {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Pitch Markings */
.pitch-outline {
    position: absolute;
    top: 3%;
    left: 3%;
    right: 3%;
    bottom: 3%;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.pitch-outline::after {
    /* Center line */
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 2px solid rgba(255, 255, 255, 0.4);
}

.pitch-outline::before {
    /* Center circle */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

/* Players on Pitch */
.pitch-player {
    position: absolute;
    width: 90px;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.pitch-player-card {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 4px;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.pitch-player-card:hover {
    transform: scale(1.1);
    z-index: 10;
    border-color: var(--accent-cyan);
}

.pitch-player-rating {
    font-size: 1.1rem;
    font-weight: 800;
}

.pitch-player-name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    margin: 2px 0;
}

.pitch-player-role {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

/* Empty State on Pitch */
.pitch-player-empty {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.empty-plus {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
}

.empty-role {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    margin-top: -4px;
}

/* Stats Panel */
.lineup-stats-panel {
    width: 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stats-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--accent-cyan);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    color: white;
    font-family: 'Courier New', monospace;
}

.stat-value.gold {
    color: #FFD700;
}

/* Responsive */
@media (max-width: 1024px) {

    .td-club,
    .td-nation,
    .td-type {
        display: none;
    }
}

@media (max-width: 768px) {
    #myclubContent {
        padding: 0 1rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .card-list-table th,
    .card-list-table td {
        padding: 0.75rem 0.5rem;
    }

    .td-image {
        width: 40px;
    }

    .player-img,
    .player-img-placeholder {
        width: 32px;
        height: 32px;
    }

    .td-rating {
        width: 50px;
        font-size: 1.2rem;
    }

    .td-name {
        font-size: 0.95rem;
    }

    .position-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        min-width: 35px;
    }

    .td-position .altpos {
        display: none;
    }

    /* Hide altpos on mobile */

    .lineup-container {
        flex-direction: column;
    }

    .lineup-stats-panel {
        width: 100%;
    }
}