/* Pro Clubs World Theme - Dark Esports with Cyan Accent */

:root {
    --pcw-bg: #0b0f14;
    --pcw-surface: #141a22;
    --pcw-surface2: #10161e;
    --pcw-text: #ffffff;
    --pcw-text-muted: #a7b0be;
    --pcw-accent: #0087b3;
    --pcw-accent-2: #00a0cc;
    --pcw-border: rgba(255,255,255,0.08);
    --pcw-shadow: rgba(0, 135, 179, 0.15);
}

body {
    background-color: var(--pcw-bg);
    color: var(--pcw-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pcw-card {
    background-color: var(--pcw-surface);
    border: 1px solid var(--pcw-border);
    border-bottom: 3px solid var(--pcw-accent);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
    max-width: 100%;
}

.pcw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--pcw-shadow);
    border-bottom-color: var(--pcw-accent-2);
}

.pcw-card-large {
    min-height: 200px;
}

.pcw-card-small {
    min-height: 120px;
}

.pcw-hero {
    background: linear-gradient(135deg, var(--pcw-surface2) 0%, var(--pcw-bg) 100%);
    border-bottom: 2px solid var(--pcw-accent);
    padding: 4rem 2rem;
    text-align: center;
}

.pcw-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--pcw-text) 0%, var(--pcw-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pcw-hero p {
    font-size: 1.25rem;
    color: var(--pcw-text-muted);
    margin-bottom: 2rem;
}

.pcw-btn {
    background-color: var(--pcw-accent);
    color: var(--pcw-bg);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.pcw-btn:hover {
    background-color: var(--pcw-accent-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--pcw-shadow);
}

.pcw-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.pcw-feature-card {
    background-color: var(--pcw-surface);
    border: 1px solid var(--pcw-border);
    border-bottom: 3px solid var(--pcw-accent);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pcw-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--pcw-shadow);
    border-bottom-color: var(--pcw-accent-2);
}

.pcw-feature-card .icon {
    font-size: 3rem;
    color: var(--pcw-accent);
    margin-bottom: 1rem;
}

.pcw-feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pcw-feature-card p {
    color: var(--pcw-text-muted);
    font-size: 0.95rem;
}

.pcw-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pcw-status-upcoming {
    background-color: rgba(0, 200, 255, 0.2);
    color: var(--pcw-accent);
    border: 1px solid var(--pcw-accent);
}

.pcw-status-active {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.pcw-status-finished {
    background-color: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
    border: 1px solid #9e9e9e;
}

.pcw-rule-bullet {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.pcw-rule-bullet::before {
    content: "▸";
    color: var(--pcw-accent);
    font-size: 1.5rem;
    margin-right: 0.75rem;
    font-weight: bold;
}

.pcw-section-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    border-left: 4px solid var(--pcw-accent);
    padding-left: 1rem;
}

@media (max-width: 768px) {
    .pcw-hero h1 {
        font-size: 2.5rem;
    }

    .pcw-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Lineup Builder Styles */
.lineup-builder-page {
    min-height: 100vh;
    padding: 1rem;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--pcw-surface);
    border: 1px solid var(--pcw-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.layout-root {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    margin-top: 1.5rem;
    max-height: calc(100vh - 200px);
}

.pitch-container {
    background-color: var(--pcw-surface);
    border: 1px solid var(--pcw-border);
    border-radius: 8px;
    padding: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pitch {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 2/3;
    max-height: calc(100vh - 250px);
    background: linear-gradient(to bottom, #1a5f1a 0%, #2d8f2d 50%, #1a5f1a 100%);
    border-radius: 8px;
    border: 4px solid #fff;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
}

/* Pitch markings */
.pitch-center-circle {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pitch-center-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pitch-penalty-top,
.pitch-penalty-bottom {
    position: absolute;
    width: 50%;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    left: 50%;
    transform: translateX(-50%);
}

.pitch-penalty-top {
    top: 0;
    border-top: none;
}

.pitch-penalty-bottom {
    bottom: 0;
    border-bottom: none;
}

.pitch-goal-area-top,
.pitch-goal-area-bottom {
    position: absolute;
    width: 30%;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    left: 50%;
    transform: translateX(-50%);
}

.pitch-goal-area-top {
    top: 0;
    border-top: none;
}

.pitch-goal-area-bottom {
    bottom: 0;
    border-bottom: none;
}

/* Player cards */
.player-slot {
    position: absolute;
    z-index: 10;
}

.player-card {
    width: 80px;
    height: 110px;
    background: linear-gradient(135deg, var(--pcw-surface) 0%, var(--pcw-surface2) 100%);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    padding: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid var(--pcw-accent);
    border-bottom: 3px solid var(--pcw-accent);
}

.player-card:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px var(--pcw-shadow);
    border-color: var(--pcw-accent-2);
}

.player-rating {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--pcw-accent);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.player-position {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--pcw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--pcw-accent);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.player-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--pcw-text);
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
}

/* Side panel */
.side-panel {
    background-color: var(--pcw-surface);
    border: 1px solid var(--pcw-border);
    border-radius: 8px;
    padding: 1.5rem;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.slot-list-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.slot-list-row label {
    min-width: 50px;
    font-weight: 600;
    font-size: 0.9rem;
}

.slot-list-row select {
    flex: 1;
    padding: 0.5rem;
    background-color: var(--pcw-bg);
    color: var(--pcw-text);
    border: 1px solid var(--pcw-border);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .layout-root {
        grid-template-columns: 1fr;
    }

    .side-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .top-bar-left,
    .top-bar-right {
        justify-content: center;
    }

    .player-card {
        width: 60px;
        height: 85px;
        padding: 4px;
    }

    .player-rating {
        font-size: 1.2rem;
    }

    .player-number {
        font-size: 1rem;
    }

    .player-name {
        font-size: 0.55rem;
    }
}

/* Lineup Viewer Styles */
.lineup-viewer {
    width: 100%;
}

.pitch-container-viewer {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background-color: var(--pcw-surface);
    border-radius: 8px;
}

.lineup-viewer .player-card {
    width: 60px;
    height: 80px;
    padding: 4px;
}

.lineup-viewer .player-position {
    font-size: 0.65rem;
}

.lineup-viewer .player-name {
    font-size: 0.6rem;
}

/* ── Shared PCW Tabs (used by Club, Home, Tournaments) ───── */

.pcw-tabs.mud-tabs {
    background: transparent;
}

.pcw-tabs .mud-tabs-toolbar {
    background: #161d27;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px 10px 0 0;
    padding: 0 8px;
}

.pcw-tabs .mud-tabs-panels {
    background: #111720;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    min-height: 200px;
}

.pcw-tabs .mud-tab-active {
    color: #42a5f5 !important;
}

/* Legacy alias — keep ClubTabs working unchanged */
.club-tabs.mud-tabs { background: transparent; }
.club-tabs .mud-tabs-toolbar { background: #161d27; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px 10px 0 0; padding: 0 8px; }
.club-tabs .mud-tabs-panels { background: #111720; border: 1px solid rgba(255,255,255,0.08); border-top: none; border-radius: 0 0 10px 10px; min-height: 200px; padding: 20px; }
.club-tabs .club-tab-panel { padding: 24px !important; }
.club-tabs .club-tab-active { color: #42a5f5 !important; }

/* ── LineupBuilder Mobile — PitchView size overrides ──────────────────────────
   These MUST live here (global CSS) because Blazor CSS isolation appends the
   scope attribute to the RIGHTMOST selector token, so a rule like
   ".lbm-pitch-area .pitch-container" in a .razor.css file becomes
   ".lbm-pitch-area .pitch-container[b-xxxx]" which never matches PitchView's
   elements.  Global rules have no such transformation and reach every element. */
.lbm-pitch-area:not(.lbm-exporting) .pitch-container {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}
.lbm-pitch-area:not(.lbm-exporting) .pitch-export-area {
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    padding-bottom: 0 !important;
}
.lbm-pitch-area:not(.lbm-exporting) .pitch-scene {
    /* Maintain 3:4 ratio inside the available viewport.
       Appbar ~48 px + compact header ~34 px + tab-bar ~52 px = ~134 px overhead. */
    max-height: 100% !important;
    max-width: min(100%, calc((100dvh - 134px) * 0.75)) !important;
    margin: 0 auto !important;
}
