/* =========================
   Base
   ========================= */
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #ddd;
    color: #000;
}

.page-container {
    padding: 20px 10px;
    text-align: center;
}


/* =========================
   Header
   ========================= */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    padding: 10px;
    gap: 15px;
    flex-wrap: wrap;
}

.header a,
.header button {
    text-decoration: none;
    padding: 10px 15px;
    background-color: #444;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.header a:hover,
.header button:hover {
    background-color: #666;
}


/* =========================
   Botón principal
   ========================= */
.btn-primary {
    background-color: #0084db;
    color: white;
    padding: 14px 22px;
    border-radius: 10px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin: 20px auto;
}

.btn-primary:hover {
    background-color: #1565c0;
}

.btn-primary img {
    height: 18px;
}


/* =========================
   Login
   ========================= */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.login-info {
    font-size: 13px;
    color: #242424;
}


/* =========================
   Table Wrapper (SCROLL REAL)
   ========================= */
.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px auto;
}

/* =========================
   Series Table
   ========================= */
.series-table {
    width: max-content;         /* se adapta al contenido */
    min-width: 100%;            /* nunca menor al contenedor */
    border-collapse: collapse;
}

/* celdas */
.series-table th,
.series-table td {
    padding: 6px 8px;
    border: 1px solid #ddd;
    text-align: center;
    white-space: nowrap;
}

/* encabezado */
.series-table th {
    background-color: #ccc;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* primera columna fija */
.series-table td:first-child,
.series-table th:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 3;
}

/* columna cars */
.series-table td.cars-cell {
    min-width: 260px;
    max-width: 360px;
    text-align: left;
    white-space: normal;
}


/* =========================
   Tracks
   ========================= */
.track-cell {
    min-width: 70px;
    cursor: pointer;
}

.track-name {
    padding: 2px 4px;
    border-radius: 4px;
}

.track-owned {
    font-weight: bold;
    background: #00ff2f;
}


/* =========================
   Cars
   ========================= */
.car-class {
    margin-bottom: 4px;
}

.car-name {
    padding: 2px 4px;
    border-radius: 4px;
}

.owned-car {
    font-weight: bold;
    background: #00ff2f;
}


/* =========================
   Perfil
   ========================= */
.profile-card {
    display: inline-block;
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: left;
}


/* =========================
   Series selector
   ========================= */
.series-selector {
    max-width: 100%;
    margin: 10px auto;
    text-align: left;
    font-size: 18px;
    background: white;
    padding: 25px;
    border-radius: 12px;
}

.search-box {
    width: 100%;
    padding: 6px;
    margin-bottom: 8px;
}

.series-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.clear-btn {
    background: #e53935;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.clear-btn:hover {
    background: #c62828;
}

.series-toolbar .search-box {
    flex: 1;
}

/* =========================
   Options / Loading
   ========================= */
.loading {
    margin: 20px auto;
}

.options-bar {
    margin: 15px 0;
    text-align: center;
}

.checkbox-label {
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 6px;
}


/* =========================
   Licenses
   ========================= */
.licenses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.license-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.license-header {
    padding-left: 10px;
    margin-bottom: 10px;
}

.license-header h3 {
    margin: 0;
    font-size: 18px;
}

.license-group {
    font-size: 13px;
    color: #666;
}

.license-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.license-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}


/* =========================
   Mobile
   ========================= */
@media (max-width: 768px) {
    .table-wrapper {
        padding: 10px;
    }

    .series-table th,
    .series-table td {
        font-size: 12px;
        padding: 4px;
    }

    .series-table td.cars-cell {
        min-width: 200px;
    }
}

