/*
Theme Name: Tenis Dedeportes
Theme URI: https://tenis.dedeportes.cl/
Author: Roberto Escobarg
Author URI: https://dedeportes.cl/
Description: Tema para estadísticas de tenistas chilenos. Diseño moderno y naranja.
Version: 1.11
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tenis-dedeportes
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #FF6600;
    /* Naranja moderno */
    --primary-hover: #E55A00;
    --text-dark: #1E293B;
    /* Azul oscuro/Pizarra */
    --text-muted: #64748B;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --accent-blue: #0F172A;
    /* Azul muy oscuro para títulos si se requiere */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--text-dark);
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

.fw-bold {
    font-weight: 700;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* LAYOUT PRINCIPAL */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    flex-shrink: 0;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.main-navigation a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    position: relative;
    transition: background-color 0.2s;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    left: 0;
    transition: transform 0.2s;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    bottom: -8px;
}

.site-title a {
    color: var(--primary-color);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.site-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar-area {
    width: 350px;
    flex-shrink: 0;
}

/* SECCIONES Y TÍTULOS */
.section-title {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.title-accent {
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    display: inline-block;
    margin-right: 12px;
    border-radius: 4px;
}

/* TARJETAS DE PARTIDOS */
.match-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #CBD5E1;
}

.match-info {
    width: 140px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    margin-right: 1.25rem;
}

.match-time {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.match-tournament {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.match-players {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-name {
    font-size: 0.95rem;
}

.player-identity {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.player-country {
    font-size: 0.7rem;
    color: #64748B;
    background: #F1F5F9;
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.player-scores {
    display: flex;
    gap: 0.5rem;
}

.score {
    width: 28px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.winner-score {
    font-weight: 700;
    color: var(--text-dark);
}

/* SIDEBAR Y TABLA RENDIMIENTOS */
.widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.rendimientos-table {
    width: 100%;
    border-collapse: collapse;
}

.rendimientos-table th {
    text-align: left;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.rendimientos-table td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.rendimientos-table tr:last-child td {
    border-bottom: none;
    padding-bottom: 0;
}

.rend-stat {
    color: var(--primary-color);
    font-weight: 700;
}

.site-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

/* =========================================
   PERFIL DE JUGADOR (SINGLE-JUGADOR)
   ========================================= */
.player-profile-page .profile-header {
    margin-bottom: 2rem;
}

.player-name-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: -1px;
    margin-bottom: 0.25rem;
}

.player-subtitle {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Stats Cards */
.stats-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

@media (max-width: 992px) {
    .stats-cards-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-cards-wrapper {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748B;
    margin-bottom: 1.25rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.text-purple {
    color: #A855F7;
}

.text-blue {
    color: #3B82F6;
}

.text-success {
    color: #10B981;
}

.text-danger {
    color: #EF4444;
}

/* Tables */
.theme-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    padding: 1.25rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748B;
    background-color: transparent;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1.25rem 1rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
    color: #334155;
    transition: background-color 0.2s;
}

.data-table tr:hover td {
    background-color: #F8FAFC;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.stat-highlight {
    font-weight: 800;
    color: var(--accent-blue);
}

.d-block {
    display: block;
}

.small {
    font-size: 0.8rem;
}

.mt-5 {
    margin-top: 3rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-win {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-loss {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-final {
    background-color: #E2E8F0;
    color: #475569;
}

.badge-pending {
    background-color: #FEF3C7;
    color: #92400E;
}

/* ELIMINADO DUPLICADO QUE CAUSABA ERROR DE LÍNEAS */

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0.5rem 0;
}

.text-blue {
    color: var(--accent-blue);
}

.text-success {
    color: #10B981;
}

.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.leaderboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.leaderboard-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F1F5F9;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.rank-1 {
    background: #FDE68A;
    color: #92400E;
}

.rank-2 {
    background: #E2E8F0;
    color: #475569;
}

.rank-3 {
    background: #FED7AA;
    color: #9A3412;
}

.player-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.player-info strong {
    color: var(--text-dark);
    font-size: 0.95rem;
}

.player-info .subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.score-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        width: 100%;
        margin-top: 1.5rem;
    }

    .main-navigation.toggled {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        background: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
    }

    .main-navigation li {
        border-bottom: 1px solid var(--border-color);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        display: block;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .match-info {
        width: 100px;
    }
}