
:root {
    --mlb-blue: #0d2c54;
    --mlb-red: #d50032;
    --mlb-light-blue: #132448;
    --mlb-gold: #ffd700;
    --mlb-dark: #1a1a1a;
    --card-bg: #ffffff;
    --card-border: #e8edf3;
    --body-bg: #f0f2f6;
}

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

body {
    font-family: 'Inter', 'Arial', 'Helvetica', sans-serif;
    background-color: var(--body-bg);
    color: #1a1a2e;
}

/* ─── HERO ─────────────────────────────────────────────── */
.hero-players {
    background: linear-gradient(135deg, #060f20 0%, #0d2c54 55%, #0f3870 100%);
    min-height: 240px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-players::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(213,0,50,0.12) 0%, transparent 60%);
}

.hero-players::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--mlb-red), transparent);
}

.hero-bg-player {
    position: absolute;
    right: 0; top: 0;
    height: 100%; width: 55%;
    object-fit: cover;
    object-position: left center;
    mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 30%, rgba(0,0,0,0.8) 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.5) 30%, rgba(0,0,0,0.8) 100%);
    opacity: 0.45;
}

.hero-ball-deco {
    position: absolute;
    right: 3%; top: 50%;
    transform: translateY(-50%);
    width: 200px; height: 200px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.hero-ball-deco::after {
    content: '';
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.04);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 52px 0 48px;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--mlb-red);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 3.4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    line-height: 1;
    margin-bottom: 12px;
}

.hero-line {
    width: 50px; height: 3px;
    background: var(--mlb-red);
    margin-bottom: 16px;
    border-radius: 2px;
}

.hero-desc {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 22px;
}

.hero-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
}

/* ─── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
    background: #fff;
    border-bottom: 1px solid #e0e3e8;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.filter-bar-inner {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 56px;
}

.btn-filtros {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--mlb-dark);
    color: #fff;
    border: none;
    padding: 0 22px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s;
    flex-shrink: 0;
}
.btn-filtros:hover { background: #2d2d2d; }
.btn-filtros i { font-size: 0.88rem; }

.filter-select-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    border-left: 1px solid #edf0f4;
    padding: 0 16px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    transition: background 0.15s;
}
.filter-select-wrap:hover { background: #fafbfc; }
.filter-select-wrap i { color: #b0b8c6; font-size: 0.85rem; flex-shrink: 0; }
.filter-select-wrap select {
    border: none; outline: none;
    background: transparent;
    font-size: 0.8rem; font-weight: 600;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    width: 100%; min-width: 0;
    appearance: none; -webkit-appearance: none;
}
.filter-select-wrap .select-arrow { color: #c8d0da; font-size: 0.68rem; flex-shrink: 0; }

.filter-search-wrap {
    border-left: 1px solid #edf0f4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    flex: 1.5;
    min-width: 180px;
    transition: background 0.15s;
}
.filter-search-wrap:focus-within { background: #fafbfc; }
.filter-search-wrap i { color: #c8d0da; font-size: 0.85rem; }
.filter-search-wrap input {
    border: none; outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: #2d3748;
    width: 100%;
}
.filter-search-wrap input::placeholder { color: #c8d0da; }

.filter-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #b0b8c6;
    padding: 0 14px;
    cursor: pointer;
    font-size: 0.85rem;
    border-left: 1px solid #edf0f4;
    transition: color 0.18s, background 0.18s;
    text-decoration: none;
}
.filter-clear-btn:hover { color: var(--mlb-red); background: #fff5f7; }

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content { padding: 24px 0 32px; }

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.results-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #4a5568;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.results-count-badge .count-num {
    font-size: 1rem;
    font-weight: 900;
    color: var(--mlb-blue);
}

/* ─── PLAYER CARDS ───────────────────────────────────────── */
.player-card-new {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    position: relative;
    transition: transform 0.22s cubic-bezier(.4,0,.2,1), box-shadow 0.22s;
    cursor: pointer;
    height: 100%;
    border: 1.5px solid var(--card-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Accent strip at top - colored per position */
.player-card-new::before {
    content: '';
    display: block;
    width: 100%;
    height: 5px;
    background: var(--pos-color, #cbd5e0);
    flex-shrink: 0;
}

.player-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.13);
    border-color: var(--pos-color, #e2e8f0);
}

.card-body-inner {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}

.card-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    width: 100%;
}

.jersey-num {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--pos-color, #9ca3af);
}

.star-btn {
    background: none;
    border: none;
    color: #d1d5db;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px;
    transition: color 0.18s, transform 0.15s;
    line-height: 1;
    position: relative;
    z-index: 2;
}
.star-btn:hover { color: var(--mlb-gold); transform: scale(1.2); }

/* Photo wrapper */
.player-photo-wrap {
    position: relative;
    margin-bottom: 10px;
}

.player-photo-round {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--pos-color, #e2e8f0);
    display: block;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.player-card-new:hover .player-photo-round {
    border-color: var(--pos-color, #cbd5e0);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pos-color, #9ca3af) 18%, transparent);
}

.player-photo-placeholder-round {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
    border: 3px solid var(--pos-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #c8d0da;
    transition: border-color 0.2s;
}

/* Division badge overlaid on photo */
.division-badge {
    position: absolute;
    bottom: -4px; right: -4px;
    background: var(--mlb-blue);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 8px;
    border: 2px solid var(--card-bg);
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.4;
}

/* Country flag */
.player-country {
    position: absolute;
    bottom: -4px; left: -4px;
    width: 22px; height: 22px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    font-size: 0.65rem;
}

.player-country img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.player-name-new {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #1a202c;
    margin-bottom: 3px;
    line-height: 1.2;
    width: 100%;
}

.player-pos-abbr {
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--pos-color, #9ca3af) 12%, transparent);
    color: var(--pos-color, #718096);
    display: inline-block;
}

.player-team-new {
    font-size: 0.64rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.3;
}

/* ── Position CSS variables applied per-card ── */
.pc-pitcher       { --pos-color: #ef4444; }
.pc-catcher       { --pos-color: #f97316; }
.pc-first_base    { --pos-color: #0d2c54; }
.pc-second_base   { --pos-color: #06b6d4; }
.pc-third_base    { --pos-color: #f59e0b; }
.pc-shortstop     { --pos-color: #8b5cf6; }
.pc-left_field    { --pos-color: #3b82f6; }
.pc-center_field  { --pos-color: #10b981; }
.pc-right_field   { --pos-color: #6366f1; }
.pc-designated_hitter { --pos-color: #06b6d4; }
.pc-utility       { --pos-color: #64748b; }
.pc-default       { --pos-color: #94a3b8; }

/* Legacy pos- classes (keep for abbr color) */
.pos-pitcher       { color: #ef4444; }
.pos-catcher       { color: #f97316; }
.pos-first_base    { color: #0d2c54; }
.pos-second_base   { color: #06b6d4; }
.pos-third_base    { color: #f59e0b; }
.pos-shortstop     { color: #8b5cf6; }
.pos-left_field    { color: #3b82f6; }
.pos-center_field  { color: #10b981; }
.pos-right_field   { color: #6366f1; }
.pos-designated_hitter { color: #06b6d4; }
.pos-utility       { color: #64748b; }
.pos-default       { color: #94a3b8; }

/* Card link overlay */
.card-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;
}
.star-btn { position: relative; z-index: 2; }

/* ─── BOTTOM BAR ─────────────────────────────────────────── */
.bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
}

.not-found-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    max-width: 340px;
}
.not-found-hint .hint-icon {
    width: 38px; height: 38px;
    background: #f0f4f8;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1rem; color: #718096;
}
.not-found-hint .hint-text { font-size: 0.76rem; color: #64748b; line-height: 1.4; }
.not-found-hint .hint-text strong { display: block; font-size: 0.8rem; color: #2d3748; margin-bottom: 2px; }
.hint-arrow { color: #cbd5e0; font-size: 0.75rem; margin-left: auto; flex-shrink: 0; }

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination-new {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pagination-new a,
.pagination-new span {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem; font-weight: 600;
    color: #4a5568;
    text-decoration: none;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    transition: all 0.15s;
}
.pagination-new a:hover { background: #f7fafc; border-color: #cbd5e0; color: var(--mlb-blue); }
.pagination-new .active-page {
    background: var(--mlb-blue);
    color: #fff;
    border-color: var(--mlb-blue);
    box-shadow: 0 2px 8px rgba(13,44,84,0.3);
}
.pagination-new .ellipsis { background: transparent; border-color: transparent; color: #a0aec0; }

.show-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.show-per-page select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem; font-weight: 600;
    background: #fff; color: #2d3748;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.show-per-page select:focus { border-color: var(--mlb-blue); }

/* ─── NO RESULTS ─────────────────────────────────────────── */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}
.no-results i { font-size: 4rem; margin-bottom: 20px; color: #e2e8f0; display: block; }
.no-results h3 { color: #4a5568; margin-bottom: 8px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 992px) {
    .hero-title { font-size: 2.4rem; }
    .hero-bg-player { width: 70%; }
    .filter-bar-inner { flex-wrap: wrap; }
}
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-stats { gap: 18px; }
    .hero-stat-num { font-size: 1.3rem; }
    .hero-bg-player { display: none; }
    .filter-bar-inner { overflow-x: auto; flex-wrap: nowrap; }
    .filter-select-wrap { flex-shrink: 0; }
    .bottom-bar { flex-direction: column; align-items: center; }
    .not-found-hint { max-width: 100%; width: 100%; }
}

/* ─── MODAL LOGIN ────────────────────────────────────────── */
.modal-mlb .modal-content {
    border-radius: 16px; border: none; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-mlb .modal-header {
    background: linear-gradient(135deg, var(--mlb-blue) 0%, var(--mlb-light-blue) 100%);
    color: white; padding: 28px; border: none;
}
.modal-mlb .modal-title {
    font-size: 1.6rem; font-weight: 900; text-transform: uppercase; letter-spacing: 2px;
}
.modal-mlb .modal-header .btn-close { filter: brightness(0) invert(1); }
.modal-mlb .modal-body { padding: 36px; }
.modal-mlb .form-label {
    font-weight: 600; color: var(--mlb-blue); text-transform: uppercase;
    font-size: 0.82rem; letter-spacing: 0.5px;
}
.modal-mlb .form-control {
    border: 2px solid #e2e8f0; border-radius: 8px; padding: 11px 14px; font-size: 0.95rem;
    transition: border-color 0.18s;
}
.modal-mlb .form-control:focus { border-color: var(--mlb-blue); box-shadow: 0 0 0 3px rgba(13,44,84,0.12); }
.modal-mlb .form-check-input:checked { background-color: var(--mlb-red); border-color: var(--mlb-red); }
.modal-mlb .error-message {
    background: #fff5f7; border: 1px solid rgba(213,0,50,0.3); color: var(--mlb-red);
    padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; font-weight: 600; font-size: 0.88rem;
}
.modal-mlb .field-error { color: var(--mlb-red); font-size: 0.82rem; margin-top: 4px; font-weight: 600; }
.modal-mlb .modal-footer { padding: 18px 36px; background: #f8fafc; border-top: 1px solid #e2e8f0; text-align: center; }
.modal-mlb .modal-footer a { color: var(--mlb-blue); font-weight: 600; text-decoration: none; }
.modal-mlb .modal-footer a:hover { color: var(--mlb-red); text-decoration: underline; }
.login-icon-modal { font-size: 2.8rem; margin-bottom: 12px; opacity: 0.9; text-align: center; }
.btn-mlb {
    background: var(--mlb-red); color: white; border: none; padding: 12px 28px;
    border-radius: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.2s; font-size: 0.92rem; cursor: pointer;
}
.btn-mlb:hover { background: #b30029; color: white; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(213,0,50,0.3); }
